summaryrefslogtreecommitdiff
path: root/fs/xfs/scrub
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2024-04-25 15:17:02 +0200
committerChandan Babu R <chandanbabu@kernel.org>2024-04-26 11:19:04 +0530
commitdfe5febe2b6a175d730861441bff4f726fc58a6c (patch)
tree005d98cdfb6d8c5f5d30bd224adde91ad0a89290 /fs/xfs/scrub
parent3866e6e669e2c1b3eebf580b8779ea55838c3f5a (diff)
xfs: factor out a xfs_dir_replace_args helper
Add a helper to switch between the different directory formats for removing a directory entry. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: "Darrick J. Wong" <djwong@kernel.org> Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>
Diffstat (limited to 'fs/xfs/scrub')
-rw-r--r--fs/xfs/scrub/dir_repair.c19
1 files changed, 1 insertions, 18 deletions
diff --git a/fs/xfs/scrub/dir_repair.c b/fs/xfs/scrub/dir_repair.c
index 98e4ed25cc23..64679fe08446 100644
--- a/fs/xfs/scrub/dir_repair.c
+++ b/fs/xfs/scrub/dir_repair.c
@@ -1513,7 +1513,6 @@ xrep_dir_replace(
xfs_extlen_t total)
{
struct xfs_scrub *sc = rd->sc;
- bool is_block, is_leaf;
int error;
ASSERT(S_ISDIR(VFS_I(dp)->i_mode));
@@ -1525,23 +1524,7 @@ xrep_dir_replace(
xrep_dir_init_args(rd, dp, name);
rd->args.inumber = inum;
rd->args.total = total;
-
- if (dp->i_df.if_format == XFS_DINODE_FMT_LOCAL)
- return xfs_dir2_sf_replace(&rd->args);
-
- error = xfs_dir2_isblock(&rd->args, &is_block);
- if (error)
- return error;
- if (is_block)
- return xfs_dir2_block_replace(&rd->args);
-
- error = xfs_dir2_isleaf(&rd->args, &is_leaf);
- if (error)
- return error;
- if (is_leaf)
- return xfs_dir2_leaf_replace(&rd->args);
-
- return xfs_dir2_node_replace(&rd->args);
+ return xfs_dir_replace_args(&rd->args);
}
/*