diff options
author | Christoph Hellwig <hch@lst.de> | 2011-07-08 08:35:27 -0400 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2011-07-08 08:35:27 -0400 |
commit | 4f6ae1a49ed5c81501d6f7385416bb4e07289e99 (patch) | |
tree | f9e302754cff53ad96eaca3b0b4de1fd91a9beb2 /fs/xfs/xfs_dir2_sf.c | |
parent | 78f70cd7b7e8fd44dc89af4f72fb110d865338a1 (diff) |
xfs: avoid usage of struct xfs_dir2_block
In most places we can simply pass around and use the struct xfs_dir2_data_hdr,
which is the first and most important member of struct xfs_dir2_block instead
of the full structure.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Alex Elder <aelder@sgi.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Diffstat (limited to 'fs/xfs/xfs_dir2_sf.c')
-rw-r--r-- | fs/xfs/xfs_dir2_sf.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/xfs/xfs_dir2_sf.c b/fs/xfs/xfs_dir2_sf.c index 3a1e3f4e3fa..515efa5d29c 100644 --- a/fs/xfs/xfs_dir2_sf.c +++ b/fs/xfs/xfs_dir2_sf.c | |||
@@ -141,7 +141,7 @@ xfs_dir2_sfe_put_ino( | |||
141 | int /* size for sf form */ | 141 | int /* size for sf form */ |
142 | xfs_dir2_block_sfsize( | 142 | xfs_dir2_block_sfsize( |
143 | xfs_inode_t *dp, /* incore inode pointer */ | 143 | xfs_inode_t *dp, /* incore inode pointer */ |
144 | xfs_dir2_block_t *block, /* block directory data */ | 144 | xfs_dir2_data_hdr_t *hdr, /* block directory data */ |
145 | xfs_dir2_sf_hdr_t *sfhp) /* output: header for sf form */ | 145 | xfs_dir2_sf_hdr_t *sfhp) /* output: header for sf form */ |
146 | { | 146 | { |
147 | xfs_dir2_dataptr_t addr; /* data entry address */ | 147 | xfs_dir2_dataptr_t addr; /* data entry address */ |
@@ -161,7 +161,7 @@ xfs_dir2_block_sfsize( | |||
161 | mp = dp->i_mount; | 161 | mp = dp->i_mount; |
162 | 162 | ||
163 | count = i8count = namelen = 0; | 163 | count = i8count = namelen = 0; |
164 | btp = xfs_dir2_block_tail_p(mp, block); | 164 | btp = xfs_dir2_block_tail_p(mp, hdr); |
165 | blp = xfs_dir2_block_leaf_p(btp); | 165 | blp = xfs_dir2_block_leaf_p(btp); |
166 | 166 | ||
167 | /* | 167 | /* |
@@ -174,7 +174,7 @@ xfs_dir2_block_sfsize( | |||
174 | * Calculate the pointer to the entry at hand. | 174 | * Calculate the pointer to the entry at hand. |
175 | */ | 175 | */ |
176 | dep = (xfs_dir2_data_entry_t *) | 176 | dep = (xfs_dir2_data_entry_t *) |
177 | ((char *)block + xfs_dir2_dataptr_to_off(mp, addr)); | 177 | ((char *)hdr + xfs_dir2_dataptr_to_off(mp, addr)); |
178 | /* | 178 | /* |
179 | * Detect . and .., so we can special-case them. | 179 | * Detect . and .., so we can special-case them. |
180 | * . is not included in sf directories. | 180 | * . is not included in sf directories. |
@@ -255,6 +255,7 @@ xfs_dir2_block_to_sf( | |||
255 | ASSERT(error != ENOSPC); | 255 | ASSERT(error != ENOSPC); |
256 | goto out; | 256 | goto out; |
257 | } | 257 | } |
258 | |||
258 | /* | 259 | /* |
259 | * The buffer is now unconditionally gone, whether | 260 | * The buffer is now unconditionally gone, whether |
260 | * xfs_dir2_shrink_inode worked or not. | 261 | * xfs_dir2_shrink_inode worked or not. |
@@ -276,7 +277,7 @@ xfs_dir2_block_to_sf( | |||
276 | /* | 277 | /* |
277 | * Set up to loop over the block's entries. | 278 | * Set up to loop over the block's entries. |
278 | */ | 279 | */ |
279 | btp = xfs_dir2_block_tail_p(mp, block); | 280 | btp = xfs_dir2_block_tail_p(mp, &block->hdr); |
280 | ptr = (char *)block->u; | 281 | ptr = (char *)block->u; |
281 | endptr = (char *)xfs_dir2_block_leaf_p(btp); | 282 | endptr = (char *)xfs_dir2_block_leaf_p(btp); |
282 | sfep = xfs_dir2_sf_firstentry(sfp); | 283 | sfep = xfs_dir2_sf_firstentry(sfp); |