aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_alloc_btree.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2008-10-30 01:55:23 -0400
committerLachlan McIlroy <lachlan@sgi.com>2008-10-30 01:55:23 -0400
commitce5e42db421a41b1ad0cfd68c6058566b963e14b (patch)
tree7723f47e468c6b933a89361462c04436fe617cda /fs/xfs/xfs_alloc_btree.c
parent8c4ed633e65d0bd0a25d45aad9b4646e3236cad7 (diff)
[XFS] add get_maxrecs btree operation
Factor xfs_btree_maxrecs into a per-btree operation. The get_maxrecs method is based on a patch from Dave Chinner. SGI-PV: 985583 SGI-Modid: xfs-linux-melb:xfs-kern:32188a Signed-off-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: Lachlan McIlroy <lachlan@sgi.com> Signed-off-by: Bill O'Donnell <billodo@sgi.com> Signed-off-by: David Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs/xfs_alloc_btree.c')
-rw-r--r--fs/xfs/xfs_alloc_btree.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/xfs/xfs_alloc_btree.c b/fs/xfs/xfs_alloc_btree.c
index 9c91dfcb6f29..1f268b6f4362 100644
--- a/fs/xfs/xfs_alloc_btree.c
+++ b/fs/xfs/xfs_alloc_btree.c
@@ -2219,6 +2219,14 @@ xfs_allocbt_dup_cursor(
2219 cur->bc_btnum); 2219 cur->bc_btnum);
2220} 2220}
2221 2221
2222STATIC int
2223xfs_allocbt_get_maxrecs(
2224 struct xfs_btree_cur *cur,
2225 int level)
2226{
2227 return cur->bc_mp->m_alloc_mxr[level != 0];
2228}
2229
2222#ifdef XFS_BTREE_TRACE 2230#ifdef XFS_BTREE_TRACE
2223ktrace_t *xfs_allocbt_trace_buf; 2231ktrace_t *xfs_allocbt_trace_buf;
2224 2232
@@ -2287,6 +2295,7 @@ xfs_allocbt_trace_record(
2287 2295
2288static const struct xfs_btree_ops xfs_allocbt_ops = { 2296static const struct xfs_btree_ops xfs_allocbt_ops = {
2289 .dup_cursor = xfs_allocbt_dup_cursor, 2297 .dup_cursor = xfs_allocbt_dup_cursor,
2298 .get_maxrecs = xfs_allocbt_get_maxrecs,
2290 2299
2291#ifdef XFS_BTREE_TRACE 2300#ifdef XFS_BTREE_TRACE
2292 .trace_enter = xfs_allocbt_trace_enter, 2301 .trace_enter = xfs_allocbt_trace_enter,