summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_trace.c
blob: 74eae4258e6b58c452676c658a0b2fa1719f1ea9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright (c) 2009, Christoph Hellwig
 * All Rights Reserved.
 */
#include "xfs.h"
#include "xfs_fs.h"
#include "xfs_shared.h"
#include "xfs_bit.h"
#include "xfs_format.h"
#include "xfs_log_format.h"
#include "xfs_trans_resv.h"
#include "xfs_mount.h"
#include "xfs_defer.h"
#include "xfs_da_format.h"
#include "xfs_inode.h"
#include "xfs_btree.h"
#include "xfs_da_btree.h"
#include "xfs_alloc.h"
#include "xfs_bmap.h"
#include "xfs_attr.h"
#include "xfs_trans.h"
#include "xfs_log.h"
#include "xfs_log_priv.h"
#include "xfs_buf_item.h"
#include "xfs_quota.h"
#include "xfs_dquot_item.h"
#include "xfs_dquot.h"
#include "xfs_log_recover.h"
#include "xfs_filestream.h"
#include "xfs_fsmap.h"
#include "xfs_btree_staging.h"
#include "xfs_icache.h"
#include "xfs_ag.h"
#include "xfs_ag_resv.h"
#include "xfs_error.h"
#include "scrub/xfile.h"
#include "scrub/xfbtree.h"
#include "xfs_btree_mem.h"
#include "xfs_bmap.h"
#include "xfs_swapext.h"
#include "xfs_xchgrange.h"
#include "xfs_rtgroup.h"
#include "xfs_rmap.h"
#include "xfs_refcount.h"
#include "xfs_fsrefs.h"

static inline void
xfs_rmapbt_crack_agno_opdev(
	struct xfs_btree_cur	*cur,
	xfs_agnumber_t		*agno,
	dev_t			*opdev)
{
	if (cur->bc_flags & XFS_BTREE_IN_MEMORY) {
		*agno = 0;
		*opdev = xfbtree_target(cur->bc_mem.xfbtree)->bt_dev;
	} else if (cur->bc_flags & XFS_BTREE_ROOT_IN_INODE) {
		*agno = cur->bc_ino.rtg->rtg_rgno;
		*opdev = cur->bc_mp->m_rtdev_targp->bt_dev;
	} else {
		*agno = cur->bc_ag.pag->pag_agno;
		*opdev = cur->bc_mp->m_super->s_dev;
	}
}

static inline void
xfs_refcountbt_crack_agno_opdev(
	struct xfs_btree_cur	*cur,
	xfs_agnumber_t		*agno,
	dev_t			*opdev)
{
	return xfs_rmapbt_crack_agno_opdev(cur, agno, opdev);
}

/*
 * We include this last to have the helpers above available for the trace
 * event implementations.
 */
#define CREATE_TRACE_POINTS
#include "xfs_trace.h"