From: Theodore Ts'o Date: Mon, 7 Mar 2016 02:30:07 +0000 (-0500) Subject: Merge branch 'maint' into next X-Git-Tag: v1.43-WIP-2016-03-15~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6d4bb11487c989de6ab1637c8cc53cad42013c1e;p=thirdparty%2Fe2fsprogs.git Merge branch 'maint' into next --- 6d4bb11487c989de6ab1637c8cc53cad42013c1e diff --cc resize/resize2fs.c index f8df67944,dc22b9d7d..d0a525b20 --- a/resize/resize2fs.c +++ b/resize/resize2fs.c @@@ -56,19 -56,26 +56,29 @@@ static errcode_t mark_table_blocks(ext2 static errcode_t clear_sparse_super2_last_group(ext2_resize_t rfs); static errcode_t reserve_sparse_super2_last_group(ext2_resize_t rfs, ext2fs_block_bitmap meta_bmap); +static errcode_t resize_group_descriptors(ext2_resize_t rfs, blk64_t new_size); +static errcode_t move_bg_metadata(ext2_resize_t rfs); +static errcode_t zero_high_bits_in_inodes(ext2_resize_t rfs); /* - * Some helper CPP macros + * Some helper functions to check if a block is in a metadata area */ - #define IS_BLOCK_BM(fs, i, blk) ((blk) == ext2fs_block_bitmap_loc((fs),(i))) - #define IS_INODE_BM(fs, i, blk) ((blk) == ext2fs_inode_bitmap_loc((fs),(i))) + static inline int is_block_bm(ext2_filsys fs, unsigned int grp, blk64_t blk) + { + return blk == ext2fs_block_bitmap_loc(fs, grp); + } - #define IS_INODE_TB(fs, i, blk) (((blk) >= ext2fs_inode_table_loc((fs), (i))) && \ - ((blk) < (ext2fs_inode_table_loc((fs), (i)) + \ - (fs)->inode_blocks_per_group))) + static inline int is_inode_bm(ext2_filsys fs, unsigned int grp, blk64_t blk) + { + return blk == ext2fs_inode_bitmap_loc(fs, grp); + } + + static inline int is_inode_tb(ext2_filsys fs, unsigned int grp, blk64_t blk) + { + return blk >= ext2fs_inode_table_loc(fs, grp) && + blk < (ext2fs_inode_table_loc(fs, grp) + + fs->inode_blocks_per_group); + } /* Some bigalloc helper macros which are more succint... */ #define B2C(x) EXT2FS_B2C(fs, (x)) @@@ -1191,11 -878,11 +1201,11 @@@ static void mark_fs_metablock(ext2_resi rfs->needed_blocks++; return; } - if (fs->super->s_feature_incompat & EXT4_FEATURE_INCOMPAT_FLEX_BG) { + if (ext2fs_has_feature_flex_bg(fs->super)) { dgrp_t i; - for (i=0; i < rfs->old_fs->group_desc_count; i++) { - if (IS_BLOCK_BM(fs, i, blk)) { + for (i = 0; i < rfs->old_fs->group_desc_count; i++) { + if (is_block_bm(fs, i, blk)) { ext2fs_block_bitmap_loc_set(fs, i, 0); rfs->needed_blocks++; return;