diff options
author | Dave Chinner <dchinner@redhat.com> | 2012-06-22 04:50:14 -0400 |
---|---|---|
committer | Ben Myers <bpm@sgi.com> | 2012-07-01 15:50:07 -0400 |
commit | 1d9025e56143c0c4aebebdb62e46618d3d284218 (patch) | |
tree | c31b34008dbd17ac1811c73cc515ea7f6247e2f0 /fs/xfs/xfs_da_btree.h | |
parent | 3605431fb9739a30ccd0c6380ae8e3c6f8e670a5 (diff) |
xfs: remove struct xfs_dabuf and infrastructure
The struct xfs_dabuf now only tracks a single xfs_buf and all the
information it holds can be gained directly from the xfs_buf. Hence
we can remove the struct dabuf and pass the xfs_buf around
everywhere.
Kill the struct dabuf and the associated infrastructure.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_da_btree.h')
-rw-r--r-- | fs/xfs/xfs_da_btree.h | 32 |
1 files changed, 5 insertions, 27 deletions
diff --git a/fs/xfs/xfs_da_btree.h b/fs/xfs/xfs_da_btree.h index 0b64c4a37afb..9f37aa03eb38 100644 --- a/fs/xfs/xfs_da_btree.h +++ b/fs/xfs/xfs_da_btree.h | |||
@@ -133,20 +133,6 @@ typedef struct xfs_da_args { | |||
133 | { XFS_DA_OP_CILOOKUP, "CILOOKUP" } | 133 | { XFS_DA_OP_CILOOKUP, "CILOOKUP" } |
134 | 134 | ||
135 | /* | 135 | /* |
136 | * Structure to describe buffer(s) for a block. | ||
137 | * This is needed in the directory version 2 format case, when | ||
138 | * multiple non-contiguous fsblocks might be needed to cover one | ||
139 | * logical directory block. | ||
140 | * If the buffer count is 1 then the data pointer points to the | ||
141 | * same place as the b_addr field for the buffer, else to kmem_alloced memory. | ||
142 | */ | ||
143 | typedef struct xfs_dabuf { | ||
144 | short bbcount; /* how large is data in bbs */ | ||
145 | void *data; /* pointer for buffers' data */ | ||
146 | struct xfs_buf *bp; /* actually nbuf of these */ | ||
147 | } xfs_dabuf_t; | ||
148 | |||
149 | /* | ||
150 | * Storage for holding state during Btree searches and split/join ops. | 136 | * Storage for holding state during Btree searches and split/join ops. |
151 | * | 137 | * |
152 | * Only need space for 5 intermediate nodes. With a minimum of 62-way | 138 | * Only need space for 5 intermediate nodes. With a minimum of 62-way |
@@ -154,7 +140,7 @@ typedef struct xfs_dabuf { | |||
154 | * which is slightly more than enough. | 140 | * which is slightly more than enough. |
155 | */ | 141 | */ |
156 | typedef struct xfs_da_state_blk { | 142 | typedef struct xfs_da_state_blk { |
157 | xfs_dabuf_t *bp; /* buffer containing block */ | 143 | struct xfs_buf *bp; /* buffer containing block */ |
158 | xfs_dablk_t blkno; /* filesystem blkno of buffer */ | 144 | xfs_dablk_t blkno; /* filesystem blkno of buffer */ |
159 | xfs_daddr_t disk_blkno; /* on-disk blkno (in BBs) of buffer */ | 145 | xfs_daddr_t disk_blkno; /* on-disk blkno (in BBs) of buffer */ |
160 | int index; /* relevant index into block */ | 146 | int index; /* relevant index into block */ |
@@ -207,7 +193,7 @@ struct xfs_nameops { | |||
207 | * Routines used for growing the Btree. | 193 | * Routines used for growing the Btree. |
208 | */ | 194 | */ |
209 | int xfs_da_node_create(xfs_da_args_t *args, xfs_dablk_t blkno, int level, | 195 | int xfs_da_node_create(xfs_da_args_t *args, xfs_dablk_t blkno, int level, |
210 | xfs_dabuf_t **bpp, int whichfork); | 196 | struct xfs_buf **bpp, int whichfork); |
211 | int xfs_da_split(xfs_da_state_t *state); | 197 | int xfs_da_split(xfs_da_state_t *state); |
212 | 198 | ||
213 | /* | 199 | /* |
@@ -237,14 +223,14 @@ int xfs_da_grow_inode_int(struct xfs_da_args *args, xfs_fileoff_t *bno, | |||
237 | int count); | 223 | int count); |
238 | int xfs_da_get_buf(struct xfs_trans *trans, struct xfs_inode *dp, | 224 | int xfs_da_get_buf(struct xfs_trans *trans, struct xfs_inode *dp, |
239 | xfs_dablk_t bno, xfs_daddr_t mappedbno, | 225 | xfs_dablk_t bno, xfs_daddr_t mappedbno, |
240 | xfs_dabuf_t **bp, int whichfork); | 226 | struct xfs_buf **bp, int whichfork); |
241 | int xfs_da_read_buf(struct xfs_trans *trans, struct xfs_inode *dp, | 227 | int xfs_da_read_buf(struct xfs_trans *trans, struct xfs_inode *dp, |
242 | xfs_dablk_t bno, xfs_daddr_t mappedbno, | 228 | xfs_dablk_t bno, xfs_daddr_t mappedbno, |
243 | xfs_dabuf_t **bpp, int whichfork); | 229 | struct xfs_buf **bpp, int whichfork); |
244 | xfs_daddr_t xfs_da_reada_buf(struct xfs_trans *trans, struct xfs_inode *dp, | 230 | xfs_daddr_t xfs_da_reada_buf(struct xfs_trans *trans, struct xfs_inode *dp, |
245 | xfs_dablk_t bno, int whichfork); | 231 | xfs_dablk_t bno, int whichfork); |
246 | int xfs_da_shrink_inode(xfs_da_args_t *args, xfs_dablk_t dead_blkno, | 232 | int xfs_da_shrink_inode(xfs_da_args_t *args, xfs_dablk_t dead_blkno, |
247 | xfs_dabuf_t *dead_buf); | 233 | struct xfs_buf *dead_buf); |
248 | 234 | ||
249 | uint xfs_da_hashname(const __uint8_t *name_string, int name_length); | 235 | uint xfs_da_hashname(const __uint8_t *name_string, int name_length); |
250 | enum xfs_dacmp xfs_da_compname(struct xfs_da_args *args, | 236 | enum xfs_dacmp xfs_da_compname(struct xfs_da_args *args, |
@@ -254,15 +240,7 @@ enum xfs_dacmp xfs_da_compname(struct xfs_da_args *args, | |||
254 | xfs_da_state_t *xfs_da_state_alloc(void); | 240 | xfs_da_state_t *xfs_da_state_alloc(void); |
255 | void xfs_da_state_free(xfs_da_state_t *state); | 241 | void xfs_da_state_free(xfs_da_state_t *state); |
256 | 242 | ||
257 | void xfs_da_buf_done(xfs_dabuf_t *dabuf); | ||
258 | void xfs_da_log_buf(struct xfs_trans *tp, xfs_dabuf_t *dabuf, uint first, | ||
259 | uint last); | ||
260 | void xfs_da_brelse(struct xfs_trans *tp, xfs_dabuf_t *dabuf); | ||
261 | void xfs_da_binval(struct xfs_trans *tp, xfs_dabuf_t *dabuf); | ||
262 | xfs_daddr_t xfs_da_blkno(xfs_dabuf_t *dabuf); | ||
263 | |||
264 | extern struct kmem_zone *xfs_da_state_zone; | 243 | extern struct kmem_zone *xfs_da_state_zone; |
265 | extern struct kmem_zone *xfs_dabuf_zone; | ||
266 | extern const struct xfs_nameops xfs_default_nameops; | 244 | extern const struct xfs_nameops xfs_default_nameops; |
267 | 245 | ||
268 | #endif /* __XFS_DA_BTREE_H__ */ | 246 | #endif /* __XFS_DA_BTREE_H__ */ |