Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=8d7... Commit: 8d754e9b2381229d8687f40b4ad0d81b8a0b3467 Parent: 9f288bf60cc6d6b5285ba207d277a382c53f8460 Author: Bob Peterson bob@ganesha.peterson AuthorDate: Mon Jan 25 14:54:39 2010 -0600 Committer: Bob Peterson rpeterso@redhat.com CommitterDate: Tue Jan 26 14:39:32 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 --- gfs2/fsck/pass1.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/gfs2/fsck/pass1.c b/gfs2/fsck/pass1.c index aab44a9..8bb5915 100644 --- a/gfs2/fsck/pass1.c +++ b/gfs2/fsck/pass1.c @@ -865,13 +865,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); @@ -1190,7 +1190,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;
cluster-commits@lists.stg.fedorahosted.org