diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2008-01-28 10:37:35 +0000 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2008-03-31 10:39:46 +0100 |
commit | ecc30c79157103e8bd7492043ee992b763443832 (patch) | |
tree | 51b1af9b58dfcf1b561888a6752255ac86070808 /fs/gfs2/super.c | |
parent | 941e6d7d09aaf455c0d7ad383f7f5ae67e4ccf16 (diff) | |
download | op-kernel-dev-ecc30c79157103e8bd7492043ee992b763443832.zip op-kernel-dev-ecc30c79157103e8bd7492043ee992b763443832.tar.gz |
[GFS2] Streamline indirect pointer tree height calculation
This patch improves the calculation of the tree height in order to reduce
the number of operations which are carried out on each call to gfs2_block_map.
In the common case, we now make a single comparison, rather than calculating
the required tree height from scratch each time. Also in the case that the
tree does need some extra height, we start from the current height rather from
zero when we work out what the new height ought to be.
In addition the di_height field is moved into the inode proper and reduced
in size to a u8 since the value must be between 0 and GFS2_MAX_META_HEIGHT (10).
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/super.c')
-rw-r--r-- | fs/gfs2/super.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c index ef0562c..88497b0 100644 --- a/fs/gfs2/super.c +++ b/fs/gfs2/super.c @@ -316,6 +316,7 @@ int gfs2_read_sb(struct gfs2_sbd *sdp, struct gfs2_glock *gl, int silent) sdp->sd_heightsize[x] = space; } sdp->sd_max_height = x; + sdp->sd_heightsize[x] = ~0; gfs2_assert(sdp, sdp->sd_max_height <= GFS2_MAX_META_HEIGHT); sdp->sd_jheightsize[0] = sdp->sd_sb.sb_bsize - @@ -334,6 +335,7 @@ int gfs2_read_sb(struct gfs2_sbd *sdp, struct gfs2_glock *gl, int silent) sdp->sd_jheightsize[x] = space; } sdp->sd_max_jheight = x; + sdp->sd_jheightsize[x] = ~0; gfs2_assert(sdp, sdp->sd_max_jheight <= GFS2_MAX_META_HEIGHT); return 0; |