Patchwork ext4: Remove unnecessary ext4_get_group_info in ext4_mb_load_buddy.

login
register
mail settings
Submitter Tao Ma
Date July 17, 2011, 3:11 p.m.
Message ID <1310915483-2906-1-git-send-email-tm@tao.ma>
Download mbox | patch
Permalink /patch/105071/
State Accepted
Headers show

Comments

Tao Ma - July 17, 2011, 3:11 p.m.
From: Tao Ma <boyu.mt@taobao.com>

ext4_mb_load_buddy() calls ext4_get_group_info() for setting both
"grp" and "e4b->bd_info", but it could do "e4b->bd_info = grp".

Reported-by:  Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Tao Ma <boyu.mt@taobao.com>
---
 fs/ext4/mballoc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Theodore Ts'o - July 23, 2011, 8:19 p.m.
On Sun, Jul 17, 2011 at 11:11:21PM +0800, Tao Ma wrote:
> From: Tao Ma <boyu.mt@taobao.com>
> 
> ext4_mb_load_buddy() calls ext4_get_group_info() for setting both
> "grp" and "e4b->bd_info", but it could do "e4b->bd_info = grp".
> 
> Reported-by:  Andreas Dilger <adilger@whamcloud.com>
> Signed-off-by: Tao Ma <boyu.mt@taobao.com>

Thanks, added to the ext4 tree.

					- Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index 4e7d055..e7749b7 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -1125,7 +1125,7 @@  ext4_mb_load_buddy(struct super_block *sb, ext4_group_t group,
 	grp = ext4_get_group_info(sb, group);
 
 	e4b->bd_blkbits = sb->s_blocksize_bits;
-	e4b->bd_info = ext4_get_group_info(sb, group);
+	e4b->bd_info = grp;
 	e4b->bd_sb = sb;
 	e4b->bd_group = group;
 	e4b->bd_buddy_page = NULL;