aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_ialloc_btree.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2008-10-30 02:11:19 -0400
committerLachlan McIlroy <lachlan@sgi.com>2008-10-30 02:11:19 -0400
commit60197e8df364df326dcbb987519f367ad0ee1a11 (patch)
tree18b38d1711a49363fd5f20f04159b360ee3ec833 /fs/xfs/xfs_ialloc_btree.h
parent5b4d89ae0f5ae45c7fa1dfc616fd2bb8634bb7b7 (diff)
[XFS] Cleanup maxrecs calculation.
Clean up the way the maximum and minimum records for the btree blocks are calculated. For the alloc and inobt btrees all the values are pre-calculated in xfs_mount_common, and we switch the current loop around the ugly generic macros that use cpp token pasting to generate type names to two small helpers in normal C code. For the bmbt and bmdr trees these helpers also exist, but can be called during runtime, too. Here we also kill various macros dealing with them and inline the logic into the get_minrecs / get_maxrecs / get_dmaxrecs methods in xfs_bmap_btree.c. Note that all these new helpers take an xfs_mount * argument which will be needed to determine the size of a btree block once we add support for extended btree blocks with CRCs and other RAS information. SGI-PV: 988146 SGI-Modid: xfs-linux-melb:xfs-kern:32292a Signed-off-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: Donald Douwsma <donaldd@sgi.com> Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_ialloc_btree.h')
-rw-r--r--fs/xfs/xfs_ialloc_btree.h9
1 files changed, 1 insertions, 8 deletions
diff --git a/fs/xfs/xfs_ialloc_btree.h b/fs/xfs/xfs_ialloc_btree.h
index ff7406b4bac3..f0fc1e46e62b 100644
--- a/fs/xfs/xfs_ialloc_btree.h
+++ b/fs/xfs/xfs_ialloc_btree.h
@@ -85,14 +85,6 @@ typedef struct xfs_btree_sblock xfs_inobt_block_t;
85#define XFS_INOBT_CLR_FREE(rp,i) ((rp)->ir_free &= ~XFS_INOBT_MASK(i)) 85#define XFS_INOBT_CLR_FREE(rp,i) ((rp)->ir_free &= ~XFS_INOBT_MASK(i))
86 86
87/* 87/*
88 * Real block structures have a size equal to the disk block size.
89 */
90#define XFS_INOBT_BLOCK_MAXRECS(lev,cur) ((cur)->bc_mp->m_inobt_mxr[lev != 0])
91#define XFS_INOBT_BLOCK_MINRECS(lev,cur) ((cur)->bc_mp->m_inobt_mnr[lev != 0])
92#define XFS_INOBT_IS_LAST_REC(cur) \
93 ((cur)->bc_ptrs[0] == be16_to_cpu(XFS_BUF_TO_INOBT_BLOCK((cur)->bc_bufs[0])->bb_numrecs))
94
95/*
96 * Maximum number of inode btree levels. 88 * Maximum number of inode btree levels.
97 */ 89 */
98#define XFS_IN_MAXLEVELS(mp) ((mp)->m_in_maxlevels) 90#define XFS_IN_MAXLEVELS(mp) ((mp)->m_in_maxlevels)
@@ -118,5 +110,6 @@ typedef struct xfs_btree_sblock xfs_inobt_block_t;
118 110
119extern struct xfs_btree_cur *xfs_inobt_init_cursor(struct xfs_mount *, 111extern struct xfs_btree_cur *xfs_inobt_init_cursor(struct xfs_mount *,
120 struct xfs_trans *, struct xfs_buf *, xfs_agnumber_t); 112 struct xfs_trans *, struct xfs_buf *, xfs_agnumber_t);
113extern int xfs_inobt_maxrecs(struct xfs_mount *, int, int);
121 114
122#endif /* __XFS_IALLOC_BTREE_H__ */ 115#endif /* __XFS_IALLOC_BTREE_H__ */