aboutsummaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_trace.h
diff options
context:
space:
mode:
authorGravatar Darrick J. Wong <djwong@kernel.org> 2023-04-11 18:59:55 -0700
committerGravatar Darrick J. Wong <djwong@kernel.org> 2023-04-11 18:59:55 -0700
commit9b2e5a234c89f097ec36f922763dfa1465dc06f8 (patch)
tree70dd0e29d57d54b4bcafdd8516f70281d325ed75 /fs/xfs/xfs_trace.h
parentxfs: give xfs_refcount_intent its own perag reference (diff)
downloadlinux-9b2e5a234c89f097ec36f922763dfa1465dc06f8.tar.gz
linux-9b2e5a234c89f097ec36f922763dfa1465dc06f8.tar.bz2
linux-9b2e5a234c89f097ec36f922763dfa1465dc06f8.zip
xfs: create traced helper to get extra perag references
There are a few places in the XFS codebase where a caller has either an active or a passive reference to a perag structure and wants to give a passive reference to some other piece of code. Btree cursor creation and inode walks are good examples of this. Replace the open-coded logic with a helper to do this. The new function adds a few safeguards -- it checks that there's at least one reference to the perag structure passed in, and it records the refcount bump in the ftrace information. This makes it much easier to debug perag refcounting problems. Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Dave Chinner <dchinner@redhat.com>
Diffstat (limited to 'fs/xfs/xfs_trace.h')
-rw-r--r--fs/xfs/xfs_trace.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/xfs/xfs_trace.h b/fs/xfs/xfs_trace.h
index 9c0006c55fec..db09bb771765 100644
--- a/fs/xfs/xfs_trace.h
+++ b/fs/xfs/xfs_trace.h
@@ -190,6 +190,7 @@ DEFINE_EVENT(xfs_perag_class, name, \
TP_ARGS(pag, caller_ip))
DEFINE_PERAG_REF_EVENT(xfs_perag_get);
DEFINE_PERAG_REF_EVENT(xfs_perag_get_tag);
+DEFINE_PERAG_REF_EVENT(xfs_perag_hold);
DEFINE_PERAG_REF_EVENT(xfs_perag_put);
DEFINE_PERAG_REF_EVENT(xfs_perag_grab);
DEFINE_PERAG_REF_EVENT(xfs_perag_grab_tag);