Linux Audio

Check our new training course

Loading...
Note: File does not exist in v3.5.6.
 1/*
 2 * Copyright (C) 2017 Oracle.  All Rights Reserved.
 3 *
 4 * Author: Darrick J. Wong <darrick.wong@oracle.com>
 5 *
 6 * This program is free software; you can redistribute it and/or
 7 * modify it under the terms of the GNU General Public License
 8 * as published by the Free Software Foundation; either version 2
 9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it would be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write the Free Software Foundation,
18 * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301, USA.
19 */
20#include "xfs.h"
21#include "xfs_fs.h"
22#include "xfs_shared.h"
23#include "xfs_format.h"
24#include "xfs_log_format.h"
25#include "xfs_trans_resv.h"
26#include "xfs_mount.h"
27#include "xfs_defer.h"
28#include "xfs_da_format.h"
29#include "xfs_inode.h"
30#include "xfs_btree.h"
31#include "xfs_trans.h"
32#include "xfs_bit.h"
33#include "scrub/xfs_scrub.h"
34#include "scrub/scrub.h"
35#include "scrub/common.h"
36
37/* Figure out which block the btree cursor was pointing to. */
38static inline xfs_fsblock_t
39xfs_scrub_btree_cur_fsbno(
40	struct xfs_btree_cur		*cur,
41	int				level)
42{
43	if (level < cur->bc_nlevels && cur->bc_bufs[level])
44		return XFS_DADDR_TO_FSB(cur->bc_mp, cur->bc_bufs[level]->b_bn);
45	else if (level == cur->bc_nlevels - 1 &&
46		 cur->bc_flags & XFS_BTREE_LONG_PTRS)
47		return XFS_INO_TO_FSB(cur->bc_mp, cur->bc_private.b.ip->i_ino);
48	else if (!(cur->bc_flags & XFS_BTREE_LONG_PTRS))
49		return XFS_AGB_TO_FSB(cur->bc_mp, cur->bc_private.a.agno, 0);
50	return NULLFSBLOCK;
51}
52
53/*
54 * We include this last to have the helpers above available for the trace
55 * event implementations.
56 */
57#define CREATE_TRACE_POINTS
58#include "scrub/trace.h"