From 70b0c3656f12964a6dac104214c904c66e626058 Mon Sep 17 00:00:00 2001 From: Steven Whitehouse Date: Fri, 2 Sep 2011 16:08:09 +0100 Subject: GFS2: Use cached rgrp in gfs2_rlist_add() Each block which is deallocated, requires a call to gfs2_rlist_add() and each of those calls was calling gfs2_blk2rgrpd() in order to figure out which rgrp the block belonged in. This can be speeded up by making use of the rgrp cached in the inode. We also reset this cached rgrp in case the block has changed rgrp. This should provide a big reduction in gfs2_blk2rgrpd() calls during deallocation. Signed-off-by: Steven Whitehouse --- fs/gfs2/dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fs/gfs2/dir.c') diff --git a/fs/gfs2/dir.c b/fs/gfs2/dir.c index 90b877b..8ccad24 100644 --- a/fs/gfs2/dir.c +++ b/fs/gfs2/dir.c @@ -1821,7 +1821,7 @@ static int leaf_dealloc(struct gfs2_inode *dip, u32 index, u32 len, if (blk != leaf_no) brelse(bh); - gfs2_rlist_add(sdp, &rlist, blk); + gfs2_rlist_add(dip, &rlist, blk); l_blocks++; } -- cgit v1.1