aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_alloc_btree.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_alloc_btree.h')
-rw-r--r--fs/xfs/xfs_alloc_btree.h25
1 files changed, 18 insertions, 7 deletions
diff --git a/fs/xfs/xfs_alloc_btree.h b/fs/xfs/xfs_alloc_btree.h
index ff1f71d069c4..579f9c7e0872 100644
--- a/fs/xfs/xfs_alloc_btree.h
+++ b/fs/xfs/xfs_alloc_btree.h
@@ -78,16 +78,27 @@ typedef struct xfs_btree_sblock xfs_alloc_block_t;
78 78
79/* 79/*
80 * Record, key, and pointer address macros for btree blocks. 80 * Record, key, and pointer address macros for btree blocks.
81 *
82 * (note that some of these may appear unused, but they are used in userspace)
81 */ 83 */
82#define XFS_ALLOC_REC_ADDR(bb,i,cur) \ 84#define XFS_ALLOC_REC_ADDR(mp, block, index) \
83 XFS_BTREE_REC_ADDR(xfs_alloc, bb, i) 85 ((xfs_alloc_rec_t *) \
84 86 ((char *)(block) + \
85#define XFS_ALLOC_KEY_ADDR(bb,i,cur) \ 87 sizeof(struct xfs_btree_sblock) + \
86 XFS_BTREE_KEY_ADDR(xfs_alloc, bb, i) 88 (((index) - 1) * sizeof(xfs_alloc_rec_t))))
87 89
88#define XFS_ALLOC_PTR_ADDR(bb,i,cur) \ 90#define XFS_ALLOC_KEY_ADDR(mp, block, index) \
89 XFS_BTREE_PTR_ADDR(xfs_alloc, bb, i, XFS_ALLOC_BLOCK_MAXRECS(1, cur)) 91 ((xfs_alloc_key_t *) \
92 ((char *)(block) + \
93 sizeof(struct xfs_btree_sblock) + \
94 ((index) - 1) * sizeof(xfs_alloc_key_t)))
90 95
96#define XFS_ALLOC_PTR_ADDR(mp, block, index, maxrecs) \
97 ((xfs_alloc_ptr_t *) \
98 ((char *)(block) + \
99 sizeof(struct xfs_btree_sblock) + \
100 (maxrecs) * sizeof(xfs_alloc_key_t) + \
101 ((index) - 1) * sizeof(xfs_alloc_ptr_t)))
91 102
92extern struct xfs_btree_cur *xfs_allocbt_init_cursor(struct xfs_mount *, 103extern struct xfs_btree_cur *xfs_allocbt_init_cursor(struct xfs_mount *,
93 struct xfs_trans *, struct xfs_buf *, 104 struct xfs_trans *, struct xfs_buf *,