]>
git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blob - fs/xfs/scrub/trace.c
2 * Copyright (C) 2017 Oracle. All Rights Reserved.
4 * Author: Darrick J. Wong <darrick.wong@oracle.com>
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.
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.
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.
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_defer.h"
30 #include "xfs_inode.h"
31 #include "xfs_btree.h"
32 #include "xfs_trans.h"
34 #include "scrub/xfs_scrub.h"
35 #include "scrub/scrub.h"
36 #include "scrub/common.h"
38 /* Figure out which block the btree cursor was pointing to. */
39 static inline xfs_fsblock_t
40 xfs_scrub_btree_cur_fsbno(
41 struct xfs_btree_cur
*cur
,
44 if (level
< cur
->bc_nlevels
&& cur
->bc_bufs
[level
])
45 return XFS_DADDR_TO_FSB(cur
->bc_mp
, cur
->bc_bufs
[level
]->b_bn
);
46 else if (level
== cur
->bc_nlevels
- 1 &&
47 cur
->bc_flags
& XFS_BTREE_LONG_PTRS
)
48 return XFS_INO_TO_FSB(cur
->bc_mp
, cur
->bc_private
.b
.ip
->i_ino
);
49 else if (!(cur
->bc_flags
& XFS_BTREE_LONG_PTRS
))
50 return XFS_AGB_TO_FSB(cur
->bc_mp
, cur
->bc_private
.a
.agno
, 0);
55 * We include this last to have the helpers above available for the trace
56 * event implementations.
58 #define CREATE_TRACE_POINTS
59 #include "scrub/trace.h"