Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0+
0002 /*
0003  * Copyright (C) 2017 Oracle.  All Rights Reserved.
0004  * Author: Darrick J. Wong <darrick.wong@oracle.com>
0005  */
0006 #include "xfs.h"
0007 #include "xfs_fs.h"
0008 #include "xfs_shared.h"
0009 #include "xfs_format.h"
0010 #include "xfs_log_format.h"
0011 #include "xfs_trans_resv.h"
0012 #include "xfs_mount.h"
0013 #include "xfs_inode.h"
0014 #include "xfs_btree.h"
0015 #include "scrub/scrub.h"
0016 #include "xfs_ag.h"
0017 
0018 /* Figure out which block the btree cursor was pointing to. */
0019 static inline xfs_fsblock_t
0020 xchk_btree_cur_fsbno(
0021     struct xfs_btree_cur    *cur,
0022     int         level)
0023 {
0024     if (level < cur->bc_nlevels && cur->bc_levels[level].bp)
0025         return XFS_DADDR_TO_FSB(cur->bc_mp,
0026                 xfs_buf_daddr(cur->bc_levels[level].bp));
0027 
0028     if (level == cur->bc_nlevels - 1 &&
0029         (cur->bc_flags & XFS_BTREE_ROOT_IN_INODE))
0030         return XFS_INO_TO_FSB(cur->bc_mp, cur->bc_ino.ip->i_ino);
0031 
0032     return NULLFSBLOCK;
0033 }
0034 
0035 /*
0036  * We include this last to have the helpers above available for the trace
0037  * event implementations.
0038  */
0039 #define CREATE_TRACE_POINTS
0040 #include "scrub/trace.h"