diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2008-01-28 05:37:35 -0500 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2008-03-31 05:39:46 -0400 |
commit | ecc30c79157103e8bd7492043ee992b763443832 (patch) | |
tree | 51b1af9b58dfcf1b561888a6752255ac86070808 /fs/gfs2/incore.h | |
parent | 941e6d7d09aaf455c0d7ad383f7f5ae67e4ccf16 (diff) |
[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/incore.h')
-rw-r--r-- | fs/gfs2/incore.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h index 525dcae352d6..43472baa92e7 100644 --- a/fs/gfs2/incore.h +++ b/fs/gfs2/incore.h | |||
@@ -246,7 +246,6 @@ struct gfs2_dinode_host { | |||
246 | u64 di_goal_data; /* data block goal */ | 246 | u64 di_goal_data; /* data block goal */ |
247 | u64 di_generation; /* generation number for NFS */ | 247 | u64 di_generation; /* generation number for NFS */ |
248 | u32 di_flags; /* GFS2_DIF_... */ | 248 | u32 di_flags; /* GFS2_DIF_... */ |
249 | u16 di_height; /* height of metadata */ | ||
250 | /* These only apply to directories */ | 249 | /* These only apply to directories */ |
251 | u16 di_depth; /* Number of bits in the table */ | 250 | u16 di_depth; /* Number of bits in the table */ |
252 | u32 di_entries; /* The number of entries in the directory */ | 251 | u32 di_entries; /* The number of entries in the directory */ |
@@ -268,6 +267,7 @@ struct gfs2_inode { | |||
268 | u64 i_last_rg_alloc; | 267 | u64 i_last_rg_alloc; |
269 | 268 | ||
270 | struct rw_semaphore i_rw_mutex; | 269 | struct rw_semaphore i_rw_mutex; |
270 | u8 i_height; | ||
271 | }; | 271 | }; |
272 | 272 | ||
273 | /* | 273 | /* |
@@ -490,9 +490,9 @@ struct gfs2_sbd { | |||
490 | u32 sd_qc_per_block; | 490 | u32 sd_qc_per_block; |
491 | u32 sd_max_dirres; /* Max blocks needed to add a directory entry */ | 491 | u32 sd_max_dirres; /* Max blocks needed to add a directory entry */ |
492 | u32 sd_max_height; /* Max height of a file's metadata tree */ | 492 | u32 sd_max_height; /* Max height of a file's metadata tree */ |
493 | u64 sd_heightsize[GFS2_MAX_META_HEIGHT]; | 493 | u64 sd_heightsize[GFS2_MAX_META_HEIGHT + 1]; |
494 | u32 sd_max_jheight; /* Max height of journaled file's meta tree */ | 494 | u32 sd_max_jheight; /* Max height of journaled file's meta tree */ |
495 | u64 sd_jheightsize[GFS2_MAX_META_HEIGHT]; | 495 | u64 sd_jheightsize[GFS2_MAX_META_HEIGHT + 1]; |
496 | 496 | ||
497 | struct gfs2_args sd_args; /* Mount arguments */ | 497 | struct gfs2_args sd_args; /* Mount arguments */ |
498 | struct gfs2_tune sd_tune; /* Filesystem tuning structure */ | 498 | struct gfs2_tune sd_tune; /* Filesystem tuning structure */ |