diff --git a/fs/ext2/balloc.c b/fs/ext2/balloc.c index f86207b345a93f342b9878c08dd643ef8a67a19b..e7b2bafa1dd91cd69f8caf4597654a6355c3a666 100644 --- a/fs/ext2/balloc.c +++ b/fs/ext2/balloc.c @@ -1533,9 +1533,6 @@ int ext2_bg_has_super(struct super_block *sb, int group) */ unsigned long ext2_bg_num_gdb(struct super_block *sb, int group) { - if (EXT2_HAS_RO_COMPAT_FEATURE(sb,EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER)&& - !ext2_group_sparse(group)) - return 0; - return EXT2_SB(sb)->s_gdb_count; + return ext2_bg_has_super(sb, group) ? EXT2_SB(sb)->s_gdb_count : 0; } diff --git a/fs/ext3/balloc.c b/fs/ext3/balloc.c index 245949ead658953f1967776782a8f59a46a04ffa..a75713031105159ab82472301be86abef9ccc0af 100644 --- a/fs/ext3/balloc.c +++ b/fs/ext3/balloc.c @@ -1848,11 +1848,7 @@ static unsigned long ext3_bg_num_gdb_meta(struct super_block *sb, int group) static unsigned long ext3_bg_num_gdb_nometa(struct super_block *sb, int group) { - if (EXT3_HAS_RO_COMPAT_FEATURE(sb, - EXT3_FEATURE_RO_COMPAT_SPARSE_SUPER) && - !ext3_group_sparse(group)) - return 0; - return EXT3_SB(sb)->s_gdb_count; + return ext3_bg_has_super(sb, group) ? EXT3_SB(sb)->s_gdb_count : 0; } /** diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c index 7b42cc18ef8c38065046f09a01299954505b4333..0737e05ba3dd22842429f287356ca1c500265943 100644 --- a/fs/ext4/balloc.c +++ b/fs/ext4/balloc.c @@ -2011,11 +2011,7 @@ static unsigned long ext4_bg_num_gdb_meta(struct super_block *sb, static unsigned long ext4_bg_num_gdb_nometa(struct super_block *sb, ext4_group_t group) { - if (EXT4_HAS_RO_COMPAT_FEATURE(sb, - EXT4_FEATURE_RO_COMPAT_SPARSE_SUPER) && - !ext4_group_sparse(group)) - return 0; - return EXT4_SB(sb)->s_gdb_count; + return ext4_bg_has_super(sb, group) ? EXT4_SB(sb)->s_gdb_count : 0; } /**