* [Cluster-devel] [PATCH 1/5] GFS2: optimize rbm_from_block wrt bi_start
@ 2013-09-11 18:43 Bob Peterson
0 siblings, 0 replies; only message in thread
From: Bob Peterson @ 2013-09-11 18:43 UTC (permalink / raw)
To: cluster-devel.redhat.com
In function gfs2_rbm_from_block, it starts by checking if the block
falls within the first bitmap. It does so by checking if the rbm's
offset is less than (rbm->bi->bi_start + rbm->bi->bi_len) * GFS2_NBBY.
However, the first bitmap will always have bi_start==0. Therefore
this is an unnecessary calculation in a function that gets called
billions of times. This patch removes the reference to bi_start.
---
fs/gfs2/rgrp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
index 6931743..7a6fa03 100644
--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
@@ -262,7 +262,7 @@ static int gfs2_rbm_from_block(struct gfs2_rbm *rbm, u64 block)
rbm->bi = rbm->rgd->rd_bits;
rbm->offset = (u32)(rblock);
/* Check if the block is within the first block */
- if (rbm->offset < (rbm->bi->bi_start + rbm->bi->bi_len) * GFS2_NBBY)
+ if (rbm->offset < rbm->bi->bi_len * GFS2_NBBY)
return 0;
/* Adjust for the size diff between gfs2_meta_header and gfs2_rgrp */
--
1.8.3.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2013-09-11 18:43 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-11 18:43 [Cluster-devel] [PATCH 1/5] GFS2: optimize rbm_from_block wrt bi_start Bob Peterson
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).