xfs: add repair helpers for the reference count btree
Add a couple of functions to the refcount btree and generic btree code that will be used to repair the refcountbt. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Dave Chinner <dchinner@redhat.com>
This commit is contained in:
@@ -88,6 +88,23 @@ xfs_refcount_lookup_ge(
|
||||
return xfs_btree_lookup(cur, XFS_LOOKUP_GE, stat);
|
||||
}
|
||||
|
||||
/*
|
||||
* Look up the first record equal to [bno, len] in the btree
|
||||
* given by cur.
|
||||
*/
|
||||
int
|
||||
xfs_refcount_lookup_eq(
|
||||
struct xfs_btree_cur *cur,
|
||||
xfs_agblock_t bno,
|
||||
int *stat)
|
||||
{
|
||||
trace_xfs_refcount_lookup(cur->bc_mp, cur->bc_private.a.agno, bno,
|
||||
XFS_LOOKUP_LE);
|
||||
cur->bc_rec.rc.rc_startblock = bno;
|
||||
cur->bc_rec.rc.rc_blockcount = 0;
|
||||
return xfs_btree_lookup(cur, XFS_LOOKUP_EQ, stat);
|
||||
}
|
||||
|
||||
/* Convert on-disk record to in-core format. */
|
||||
void
|
||||
xfs_refcount_btrec_to_irec(
|
||||
|
Reference in New Issue
Block a user