summaryrefslogtreecommitdiff
path: root/fs/xfs/scrub/listxattr.c
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2024-04-22 09:48:15 -0700
committerDarrick J. Wong <djwong@kernel.org>2024-04-23 16:55:15 -0700
commit6efbbdeb140603351e1413aee79e789bf2279a2b (patch)
treeca6d101fa639a8b85447519d3f4d15c247f1dc65 /fs/xfs/scrub/listxattr.c
parent55edcd1f86474f973fccf5c5ccc8bc7908893142 (diff)
xfs: add a per-leaf block callback to xchk_xattr_walk
Add a second callback function to xchk_xattr_walk so that we can do something in between attr leaf blocks. This will be used by the next patch to see if we should flush cached parent pointer updates to constrain memory usage. Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/xfs/scrub/listxattr.c')
-rw-r--r--fs/xfs/scrub/listxattr.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/fs/xfs/scrub/listxattr.c b/fs/xfs/scrub/listxattr.c
index cbe5911ecbbc..256ff7700c94 100644
--- a/fs/xfs/scrub/listxattr.c
+++ b/fs/xfs/scrub/listxattr.c
@@ -221,6 +221,7 @@ xchk_xattr_walk_node(
struct xfs_scrub *sc,
struct xfs_inode *ip,
xchk_xattr_fn attr_fn,
+ xchk_xattrleaf_fn leaf_fn,
void *priv)
{
struct xfs_attr3_icleaf_hdr leafhdr;
@@ -252,6 +253,12 @@ xchk_xattr_walk_node(
xfs_trans_brelse(sc->tp, leaf_bp);
+ if (leaf_fn) {
+ error = leaf_fn(sc, priv);
+ if (error)
+ goto out_bitmap;
+ }
+
/* Make sure we haven't seen this new leaf already. */
len = 1;
if (xdab_bitmap_test(&seen_dablks, leafhdr.forw, &len)) {
@@ -288,6 +295,7 @@ xchk_xattr_walk(
struct xfs_scrub *sc,
struct xfs_inode *ip,
xchk_xattr_fn attr_fn,
+ xchk_xattrleaf_fn leaf_fn,
void *priv)
{
int error;
@@ -308,5 +316,5 @@ xchk_xattr_walk(
if (xfs_attr_is_leaf(ip))
return xchk_xattr_walk_leaf(sc, ip, attr_fn, priv);
- return xchk_xattr_walk_node(sc, ip, attr_fn, priv);
+ return xchk_xattr_walk_node(sc, ip, attr_fn, leaf_fn, priv);
}