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_leaf.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_leaf.c')
-rw-r--r-- | fs/xfs/xfs_dir2_leaf.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/xfs/xfs_dir2_leaf.c b/fs/xfs/xfs_dir2_leaf.c index 7f7769ea2be8..1b048dad360f 100644 --- a/fs/xfs/xfs_dir2_leaf.c +++ b/fs/xfs/xfs_dir2_leaf.c | |||
@@ -64,7 +64,7 @@ xfs_dir2_block_to_leaf( | |||
64 | { | 64 | { |
65 | __be16 *bestsp; /* leaf's bestsp entries */ | 65 | __be16 *bestsp; /* leaf's bestsp entries */ |
66 | xfs_dablk_t blkno; /* leaf block's bno */ | 66 | xfs_dablk_t blkno; /* leaf block's bno */ |
67 | xfs_dir2_block_t *block; /* block structure */ | 67 | xfs_dir2_data_hdr_t *hdr; /* block header */ |
68 | xfs_dir2_leaf_entry_t *blp; /* block's leaf entries */ | 68 | xfs_dir2_leaf_entry_t *blp; /* block's leaf entries */ |
69 | xfs_dir2_block_tail_t *btp; /* block's tail */ | 69 | xfs_dir2_block_tail_t *btp; /* block's tail */ |
70 | xfs_inode_t *dp; /* incore directory inode */ | 70 | xfs_inode_t *dp; /* incore directory inode */ |
@@ -101,9 +101,9 @@ xfs_dir2_block_to_leaf( | |||
101 | } | 101 | } |
102 | ASSERT(lbp != NULL); | 102 | ASSERT(lbp != NULL); |
103 | leaf = lbp->data; | 103 | leaf = lbp->data; |
104 | block = dbp->data; | 104 | hdr = dbp->data; |
105 | xfs_dir2_data_check(dp, dbp); | 105 | xfs_dir2_data_check(dp, dbp); |
106 | btp = xfs_dir2_block_tail_p(mp, block); | 106 | btp = xfs_dir2_block_tail_p(mp, hdr); |
107 | blp = xfs_dir2_block_leaf_p(btp); | 107 | blp = xfs_dir2_block_leaf_p(btp); |
108 | /* | 108 | /* |
109 | * Set the counts in the leaf header. | 109 | * Set the counts in the leaf header. |
@@ -123,23 +123,23 @@ xfs_dir2_block_to_leaf( | |||
123 | * tail be free. | 123 | * tail be free. |
124 | */ | 124 | */ |
125 | xfs_dir2_data_make_free(tp, dbp, | 125 | xfs_dir2_data_make_free(tp, dbp, |
126 | (xfs_dir2_data_aoff_t)((char *)blp - (char *)block), | 126 | (xfs_dir2_data_aoff_t)((char *)blp - (char *)hdr), |
127 | (xfs_dir2_data_aoff_t)((char *)block + mp->m_dirblksize - | 127 | (xfs_dir2_data_aoff_t)((char *)hdr + mp->m_dirblksize - |
128 | (char *)blp), | 128 | (char *)blp), |
129 | &needlog, &needscan); | 129 | &needlog, &needscan); |
130 | /* | 130 | /* |
131 | * Fix up the block header, make it a data block. | 131 | * Fix up the block header, make it a data block. |
132 | */ | 132 | */ |
133 | block->hdr.magic = cpu_to_be32(XFS_DIR2_DATA_MAGIC); | 133 | hdr->magic = cpu_to_be32(XFS_DIR2_DATA_MAGIC); |
134 | if (needscan) | 134 | if (needscan) |
135 | xfs_dir2_data_freescan(mp, (xfs_dir2_data_t *)block, &needlog); | 135 | xfs_dir2_data_freescan(mp, (xfs_dir2_data_t *)hdr, &needlog); |
136 | /* | 136 | /* |
137 | * Set up leaf tail and bests table. | 137 | * Set up leaf tail and bests table. |
138 | */ | 138 | */ |
139 | ltp = xfs_dir2_leaf_tail_p(mp, leaf); | 139 | ltp = xfs_dir2_leaf_tail_p(mp, leaf); |
140 | ltp->bestcount = cpu_to_be32(1); | 140 | ltp->bestcount = cpu_to_be32(1); |
141 | bestsp = xfs_dir2_leaf_bests_p(ltp); | 141 | bestsp = xfs_dir2_leaf_bests_p(ltp); |
142 | bestsp[0] = block->hdr.bestfree[0].length; | 142 | bestsp[0] = hdr->bestfree[0].length; |
143 | /* | 143 | /* |
144 | * Log the data header and leaf bests table. | 144 | * Log the data header and leaf bests table. |
145 | */ | 145 | */ |