aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_da_btree.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_da_btree.h')
-rw-r--r--fs/xfs/xfs_da_btree.h38
1 files changed, 6 insertions, 32 deletions
diff --git a/fs/xfs/xfs_da_btree.h b/fs/xfs/xfs_da_btree.h
index dbf7c074ae73..132adafb041e 100644
--- a/fs/xfs/xfs_da_btree.h
+++ b/fs/xfs/xfs_da_btree.h
@@ -32,7 +32,7 @@ struct zone;
32/* 32/*
33 * This structure is common to both leaf nodes and non-leaf nodes in the Btree. 33 * This structure is common to both leaf nodes and non-leaf nodes in the Btree.
34 * 34 *
35 * Is is used to manage a doubly linked list of all blocks at the same 35 * It is used to manage a doubly linked list of all blocks at the same
36 * level in the Btree, and to identify which type of block this is. 36 * level in the Btree, and to identify which type of block this is.
37 */ 37 */
38#define XFS_DA_NODE_MAGIC 0xfebe /* magic number: non-leaf blocks */ 38#define XFS_DA_NODE_MAGIC 0xfebe /* magic number: non-leaf blocks */
@@ -133,24 +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 */
143typedef struct xfs_dabuf {
144 int nbuf; /* number of buffer pointers present */
145 short dirty; /* data needs to be copied back */
146 short bbcount; /* how large is data in bbs */
147 void *data; /* pointer for buffers' data */
148 struct xfs_buf *bps[1]; /* actually nbuf of these */
149} xfs_dabuf_t;
150#define XFS_DA_BUF_SIZE(n) \
151 (sizeof(xfs_dabuf_t) + sizeof(struct xfs_buf *) * ((n) - 1))
152
153/*
154 * Storage for holding state during Btree searches and split/join ops. 136 * Storage for holding state during Btree searches and split/join ops.
155 * 137 *
156 * 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
@@ -158,7 +140,7 @@ typedef struct xfs_dabuf {
158 * which is slightly more than enough. 140 * which is slightly more than enough.
159 */ 141 */
160typedef struct xfs_da_state_blk { 142typedef struct xfs_da_state_blk {
161 xfs_dabuf_t *bp; /* buffer containing block */ 143 struct xfs_buf *bp; /* buffer containing block */
162 xfs_dablk_t blkno; /* filesystem blkno of buffer */ 144 xfs_dablk_t blkno; /* filesystem blkno of buffer */
163 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 */
164 int index; /* relevant index into block */ 146 int index; /* relevant index into block */
@@ -211,7 +193,7 @@ struct xfs_nameops {
211 * Routines used for growing the Btree. 193 * Routines used for growing the Btree.
212 */ 194 */
213int xfs_da_node_create(xfs_da_args_t *args, xfs_dablk_t blkno, int level, 195int xfs_da_node_create(xfs_da_args_t *args, xfs_dablk_t blkno, int level,
214 xfs_dabuf_t **bpp, int whichfork); 196 struct xfs_buf **bpp, int whichfork);
215int xfs_da_split(xfs_da_state_t *state); 197int xfs_da_split(xfs_da_state_t *state);
216 198
217/* 199/*
@@ -241,14 +223,14 @@ int xfs_da_grow_inode_int(struct xfs_da_args *args, xfs_fileoff_t *bno,
241 int count); 223 int count);
242int xfs_da_get_buf(struct xfs_trans *trans, struct xfs_inode *dp, 224int xfs_da_get_buf(struct xfs_trans *trans, struct xfs_inode *dp,
243 xfs_dablk_t bno, xfs_daddr_t mappedbno, 225 xfs_dablk_t bno, xfs_daddr_t mappedbno,
244 xfs_dabuf_t **bp, int whichfork); 226 struct xfs_buf **bp, int whichfork);
245int xfs_da_read_buf(struct xfs_trans *trans, struct xfs_inode *dp, 227int xfs_da_read_buf(struct xfs_trans *trans, struct xfs_inode *dp,
246 xfs_dablk_t bno, xfs_daddr_t mappedbno, 228 xfs_dablk_t bno, xfs_daddr_t mappedbno,
247 xfs_dabuf_t **bpp, int whichfork); 229 struct xfs_buf **bpp, int whichfork);
248xfs_daddr_t xfs_da_reada_buf(struct xfs_trans *trans, struct xfs_inode *dp, 230xfs_daddr_t xfs_da_reada_buf(struct xfs_trans *trans, struct xfs_inode *dp,
249 xfs_dablk_t bno, int whichfork); 231 xfs_dablk_t bno, int whichfork);
250int xfs_da_shrink_inode(xfs_da_args_t *args, xfs_dablk_t dead_blkno, 232int xfs_da_shrink_inode(xfs_da_args_t *args, xfs_dablk_t dead_blkno,
251 xfs_dabuf_t *dead_buf); 233 struct xfs_buf *dead_buf);
252 234
253uint xfs_da_hashname(const __uint8_t *name_string, int name_length); 235uint xfs_da_hashname(const __uint8_t *name_string, int name_length);
254enum xfs_dacmp xfs_da_compname(struct xfs_da_args *args, 236enum xfs_dacmp xfs_da_compname(struct xfs_da_args *args,
@@ -258,15 +240,7 @@ enum xfs_dacmp xfs_da_compname(struct xfs_da_args *args,
258xfs_da_state_t *xfs_da_state_alloc(void); 240xfs_da_state_t *xfs_da_state_alloc(void);
259void xfs_da_state_free(xfs_da_state_t *state); 241void xfs_da_state_free(xfs_da_state_t *state);
260 242
261void xfs_da_buf_done(xfs_dabuf_t *dabuf);
262void xfs_da_log_buf(struct xfs_trans *tp, xfs_dabuf_t *dabuf, uint first,
263 uint last);
264void xfs_da_brelse(struct xfs_trans *tp, xfs_dabuf_t *dabuf);
265void xfs_da_binval(struct xfs_trans *tp, xfs_dabuf_t *dabuf);
266xfs_daddr_t xfs_da_blkno(xfs_dabuf_t *dabuf);
267
268extern struct kmem_zone *xfs_da_state_zone; 243extern struct kmem_zone *xfs_da_state_zone;
269extern struct kmem_zone *xfs_dabuf_zone;
270extern const struct xfs_nameops xfs_default_nameops; 244extern const struct xfs_nameops xfs_default_nameops;
271 245
272#endif /* __XFS_DA_BTREE_H__ */ 246#endif /* __XFS_DA_BTREE_H__ */