diff options
author | Chengguang Xu <cgxu519@mykernel.net> | 2019-11-04 19:40:33 +0800 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2019-11-06 16:25:15 +0100 |
commit | 90f3741c2b567d3f16c13d574dbd5d42ed076b2e (patch) | |
tree | 489a0a35a7dbab7485cc76913843e001c46c9420 /fs/ext2/super.c | |
parent | eb9e47fc230aafc3ac1e5eeae6d0d8d5e108bbae (diff) |
ext2: code cleanup by calling ext2_group_last_block_no()
Call common helper ext2_group_last_block_no() to
calculate group last block number.
Link: https://lore.kernel.org/r/20191104114036.9893-2-cgxu519@mykernel.net
Signed-off-by: Chengguang Xu <cgxu519@mykernel.net>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/ext2/super.c')
-rw-r--r-- | fs/ext2/super.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/fs/ext2/super.c b/fs/ext2/super.c index 30c630d73f0f..4cd401a2f207 100644 --- a/fs/ext2/super.c +++ b/fs/ext2/super.c @@ -702,13 +702,7 @@ static int ext2_check_descriptors(struct super_block *sb) for (i = 0; i < sbi->s_groups_count; i++) { struct ext2_group_desc *gdp = ext2_get_group_desc(sb, i, NULL); ext2_fsblk_t first_block = ext2_group_first_block_no(sb, i); - ext2_fsblk_t last_block; - - if (i == sbi->s_groups_count - 1) - last_block = le32_to_cpu(sbi->s_es->s_blocks_count) - 1; - else - last_block = first_block + - (EXT2_BLOCKS_PER_GROUP(sb) - 1); + ext2_fsblk_t last_block = ext2_group_last_block_no(sb, i); if (le32_to_cpu(gdp->bg_block_bitmap) < first_block || le32_to_cpu(gdp->bg_block_bitmap) > last_block) |