commit 259dcbe89d0edf896f4a504bc2d627df0d6e4e9f Author: Bob Peterson <bob@ganesha.peterson> Date: Mon Jan 25 14:54:39 2010 -0600 fsck.gfs2: small parameter passing optimization This patch is a small optimization in a very often-used function, done for performance purposes. Function handle_di in pass1 derives the block number from the buffer already passed in rather than having the block number passed in as well, and wasting time pushing it to the stack and off the stack. rhbz#455300 diff --git a/gfs2/fsck/pass1.c b/gfs2/fsck/pass1.c index f7c81ff..9fce798 100644 --- a/gfs2/fsck/pass1.c +++ b/gfs2/fsck/pass1.c @@ -880,13 +880,13 @@ struct metawalk_fxns rangecheck_fxns = { .check_eattr_leaf = rangecheck_eattr_leaf, }; -static int handle_di(struct gfs2_sbd *sdp, struct gfs2_buffer_head *bh, - uint64_t block) +static int handle_di(struct gfs2_sbd *sdp, struct gfs2_buffer_head *bh) { uint8_t q; struct gfs2_inode *ip; int error; struct block_count bc = {0}; + uint64_t block = bh->b_blocknr; long bad_pointers; q = block_type(block); @@ -1224,7 +1224,7 @@ int pass1(struct gfs2_sbd *sbp) } check_n_fix_bitmap(sbp, block, gfs2_block_free); - } else if (handle_di(sbp, bh, block) < 0) { + } else if (handle_di(sbp, bh) < 0) { stack; brelse(bh); return FSCK_ERROR;