diff options
author | Bob Peterson <rpeterso@redhat.com> | 2013-09-17 13:12:15 -0400 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2013-09-18 10:39:53 +0100 |
commit | e579ed4f446e64748a2d26eed8f8b28f728495bd (patch) | |
tree | d525f8e67afd5b5d589eb93d8c9f0499c668b4a4 /fs/gfs2/incore.h | |
parent | b8708905199a85eebbd820f98d18e045c32077bf (diff) | |
download | linux-e579ed4f446e64748a2d26eed8f8b28f728495bd.tar.gz linux-e579ed4f446e64748a2d26eed8f8b28f728495bd.tar.bz2 linux-e579ed4f446e64748a2d26eed8f8b28f728495bd.zip |
GFS2: Introduce rbm field bii
This is a respin of the original patch. As Steve pointed out, the
introduction of field bii makes it easy to eliminate bi itself.
This revised patch does just that, replacing bi with bii.
This patch adds a new field to the rbm structure, called bii,
which is an index into the array of bitmaps for an rgrp.
This replaces *bi which was a pointer to the bitmap.
This is being done for further optimizations.
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/incore.h')
-rw-r--r-- | fs/gfs2/incore.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h index f1a3243dfaf2..8c8f110d8e35 100644 --- a/fs/gfs2/incore.h +++ b/fs/gfs2/incore.h @@ -102,19 +102,25 @@ struct gfs2_rgrpd { struct gfs2_rbm { struct gfs2_rgrpd *rgd; - struct gfs2_bitmap *bi; /* Bitmap must belong to the rgd */ u32 offset; /* The offset is bitmap relative */ + int bii; /* Bitmap index */ }; +static inline struct gfs2_bitmap *rbm_bi(const struct gfs2_rbm *rbm) +{ + return rbm->rgd->rd_bits + rbm->bii; +} + static inline u64 gfs2_rbm_to_block(const struct gfs2_rbm *rbm) { - return rbm->rgd->rd_data0 + (rbm->bi->bi_start * GFS2_NBBY) + rbm->offset; + return rbm->rgd->rd_data0 + (rbm_bi(rbm)->bi_start * GFS2_NBBY) + + rbm->offset; } static inline bool gfs2_rbm_eq(const struct gfs2_rbm *rbm1, const struct gfs2_rbm *rbm2) { - return (rbm1->rgd == rbm2->rgd) && (rbm1->bi == rbm2->bi) && + return (rbm1->rgd == rbm2->rgd) && (rbm1->bii == rbm2->bii) && (rbm1->offset == rbm2->offset); } |