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>
This commit is contained in:
Christoph Hellwig 2011-07-08 14:35:27 +02:00
parent 78f70cd7b7
commit 4f6ae1a49e
6 changed files with 106 additions and 109 deletions

View file

@ -72,7 +72,7 @@ xfs_dir2_data_check(
bf = d->hdr.bestfree;
p = (char *)d->u;
if (be32_to_cpu(d->hdr.magic) == XFS_DIR2_BLOCK_MAGIC) {
btp = xfs_dir2_block_tail_p(mp, (xfs_dir2_block_t *)d);
btp = xfs_dir2_block_tail_p(mp, &d->hdr);
lep = xfs_dir2_block_leaf_p(btp);
endp = (char *)lep;
} else
@ -348,7 +348,7 @@ xfs_dir2_data_freescan(
*/
p = (char *)d->u;
if (be32_to_cpu(d->hdr.magic) == XFS_DIR2_BLOCK_MAGIC) {
btp = xfs_dir2_block_tail_p(mp, (xfs_dir2_block_t *)d);
btp = xfs_dir2_block_tail_p(mp, &d->hdr);
endp = (char *)xfs_dir2_block_leaf_p(btp);
} else
endp = (char *)d + mp->m_dirblksize;
@ -537,7 +537,7 @@ xfs_dir2_data_make_free(
xfs_dir2_block_tail_t *btp; /* block tail */
ASSERT(be32_to_cpu(d->hdr.magic) == XFS_DIR2_BLOCK_MAGIC);
btp = xfs_dir2_block_tail_p(mp, (xfs_dir2_block_t *)d);
btp = xfs_dir2_block_tail_p(mp, &d->hdr);
endptr = (char *)xfs_dir2_block_leaf_p(btp);
}
/*