On 7/20/11 4:57 PM, Eric Sandeen wrote: > Code to count the number of blocks in the last partial > group is cut and pasted around the e2fsprogs codebase, and > is wrong in at least one instancem as pointed out by > Yongqiang Yang (but not fixed in this patch). > > Making this a helper function should improve matters. > > Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxx> > --- Argh V3 coming today, I got a little too fast and loose sending this one at the end of the day yesterday didn't I: > @@ -499,18 +499,8 @@ retry: > ext2fs_bg_flags_zap(fs, i); > if (csum_flag) > ext2fs_bg_flags_set(fs, i, EXT2_BG_INODE_UNINIT | EXT2_BG_INODE_ZEROED); > - if (i == fs->group_desc_count-1) { > - numblocks = (ext2fs_blocks_count(fs->super) - > - fs->super->s_first_data_block) % > - fs->super->s_blocks_per_group; > - if (!numblocks) > - numblocks = fs->super->s_blocks_per_group; > - } else { > - numblocks = fs->super->s_blocks_per_group; > - if (csum_flag) > - ext2fs_bg_flags_set(fs, i, > - EXT2_BG_BLOCK_UNINIT); still need to do that flag set with the new helper. - Eric > - } > + > + numblocks = ext2fs_group_blocks_count(fs, i); > > has_super = ext2fs_bg_has_super(fs, i); > if (has_super) { > > -- > To unsubscribe from this list: send the line "unsubscribe linux-ext4" in > the body of a message to majordomo@xxxxxxxxxxxxxxx > More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html