* [PATCH] ext[234]: cleanup ext[234]_bg_num_gdb()
@ 2007-12-08 15:31 Akinobu Mita
2007-12-12 5:41 ` Andrew Morton
0 siblings, 1 reply; 2+ messages in thread
From: Akinobu Mita @ 2007-12-08 15:31 UTC (permalink / raw)
To: linux-ext4; +Cc: Stephen Tweedie, Andrew Morton, adilger
Use ext[234]_bg_has_super() to remove duplicate code.
Cc: Stephen Tweedie <sct@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: adilger@clusterfs.com
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
---
fs/ext2/balloc.c | 5 +----
fs/ext3/balloc.c | 6 +-----
fs/ext4/balloc.c | 6 +-----
3 files changed, 3 insertions(+), 14 deletions(-)
Index: 2.6-git/fs/ext2/balloc.c
===================================================================
--- 2.6-git.orig/fs/ext2/balloc.c
+++ 2.6-git/fs/ext2/balloc.c
@@ -1466,9 +1466,6 @@ int ext2_bg_has_super(struct super_block
*/
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;
}
Index: 2.6-git/fs/ext3/balloc.c
===================================================================
--- 2.6-git.orig/fs/ext3/balloc.c
+++ 2.6-git/fs/ext3/balloc.c
@@ -1782,11 +1782,7 @@ static unsigned long ext3_bg_num_gdb_met
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;
}
/**
Index: 2.6-git/fs/ext4/balloc.c
===================================================================
--- 2.6-git.orig/fs/ext4/balloc.c
+++ 2.6-git/fs/ext4/balloc.c
@@ -1902,11 +1902,7 @@ static unsigned long ext4_bg_num_gdb_met
static unsigned long ext4_bg_num_gdb_nometa(struct super_block *sb, int 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;
}
/**
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] ext[234]: cleanup ext[234]_bg_num_gdb()
2007-12-08 15:31 [PATCH] ext[234]: cleanup ext[234]_bg_num_gdb() Akinobu Mita
@ 2007-12-12 5:41 ` Andrew Morton
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2007-12-12 5:41 UTC (permalink / raw)
To: Akinobu Mita; +Cc: linux-ext4, Stephen Tweedie, adilger
On Sun, 9 Dec 2007 00:31:56 +0900 Akinobu Mita <akinobu.mita@gmail.com> wrote:
> Use ext[234]_bg_has_super() to remove duplicate code.
Would prefer one patch per filesystem, please.
After fixing the rejects, I now have patches which affect ext2 and ext3
but which have a merging dependency upon ext4.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-12-12 5:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-08 15:31 [PATCH] ext[234]: cleanup ext[234]_bg_num_gdb() Akinobu Mita
2007-12-12 5:41 ` Andrew Morton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).