[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>
This commit is contained in:
Christoph Hellwig
2008-10-30 16:55:23 +11:00
committed by Lachlan McIlroy
parent 8c4ed633e6
commit ce5e42db42
5 changed files with 32 additions and 27 deletions

View File

@@ -2085,6 +2085,14 @@ xfs_inobt_dup_cursor(
cur->bc_private.a.agbp, cur->bc_private.a.agno);
}
STATIC int
xfs_inobt_get_maxrecs(
struct xfs_btree_cur *cur,
int level)
{
return cur->bc_mp->m_inobt_mxr[level != 0];
}
#ifdef XFS_BTREE_TRACE
ktrace_t *xfs_inobt_trace_buf;
@@ -2153,6 +2161,7 @@ xfs_inobt_trace_record(
static const struct xfs_btree_ops xfs_inobt_ops = {
.dup_cursor = xfs_inobt_dup_cursor,
.get_maxrecs = xfs_inobt_get_maxrecs,
#ifdef XFS_BTREE_TRACE
.trace_enter = xfs_inobt_trace_enter,