Skip to content

Commit

Permalink
ext2: code cleanup for descriptor_loc()
Browse files Browse the repository at this point in the history
Code cleanup by removing unnecessary variable
in descriptor_loc().

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Chengguang Xu <[email protected]>
Signed-off-by: Jan Kara <[email protected]>
  • Loading branch information
cgxu519 authored and jankara committed Nov 19, 2019
1 parent 6fcbcec commit 545886f
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions fs/ext2/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -800,18 +800,15 @@ static unsigned long descriptor_loc(struct super_block *sb,
{
struct ext2_sb_info *sbi = EXT2_SB(sb);
unsigned long bg, first_meta_bg;
int has_super = 0;

first_meta_bg = le32_to_cpu(sbi->s_es->s_first_meta_bg);

if (!EXT2_HAS_INCOMPAT_FEATURE(sb, EXT2_FEATURE_INCOMPAT_META_BG) ||
nr < first_meta_bg)
return (logic_sb_block + nr + 1);
bg = sbi->s_desc_per_block * nr;
if (ext2_bg_has_super(sb, bg))
has_super = 1;

return ext2_group_first_block_no(sb, bg) + has_super;
return ext2_group_first_block_no(sb, bg) + ext2_bg_has_super(sb, bg);
}

static int ext2_fill_super(struct super_block *sb, void *data, int silent)
Expand Down

0 comments on commit 545886f

Please sign in to comment.