]> git.apps.os.sepia.ceph.com Git - xfsprogs-dev.git/commit
xfs: create traced helper to get extra perag references
authorDarrick J. Wong <djwong@kernel.org>
Tue, 30 May 2023 08:48:02 +0000 (10:48 +0200)
committerCarlos Maiolino <cem@kernel.org>
Fri, 9 Jun 2023 08:27:50 +0000 (10:27 +0200)
commit11e716f40c71da49b073eb287c14a908c1fbeb01
treeec102df0381a747c8fc44f2c77746971bbc0ea9f
parentb2c5c83de26cbb7097384ebcdc72b08bcaa3ad13
xfs: create traced helper to get extra perag references

Source kernel commit: 9b2e5a234c89f097ec36f922763dfa1465dc06f8

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>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
include/xfs_trace.h
libxfs/xfs_ag.c
libxfs/xfs_ag.h
libxfs/xfs_alloc_btree.c
libxfs/xfs_ialloc_btree.c
libxfs/xfs_refcount_btree.c
libxfs/xfs_rmap_btree.c