summaryrefslogtreecommitdiff
path: root/fs/xfs/scrub
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2024-04-25 16:17:00 +0300
committerChandan Babu R <chandanbabu@kernel.org>2024-04-26 08:49:03 +0300
commit4d893a40514e9c4ee6e3be48ed1b77efb38c313b (patch)
tree130677a85995233ddccb90a3db5eace6e9b9a29d /fs/xfs/scrub
parent14ee22fef420c864c0869419e54aa4e88f64b4e6 (diff)
downloadlinux-4d893a40514e9c4ee6e3be48ed1b77efb38c313b.tar.xz
xfs: factor out a xfs_dir_createname_args helper
Add a helper to switch between the different directory formats for creating a directory entry and to handle the XFS_DA_OP_JUSTCHECK flag based on the passed in ino number field. 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 fa1a9954d48d..a1e31b782788 100644
--- a/fs/xfs/scrub/dir_repair.c
+++ b/fs/xfs/scrub/dir_repair.c
@@ -687,7 +687,6 @@ xrep_dir_replay_createname(
{
struct xfs_scrub *sc = rd->sc;
struct xfs_inode *dp = rd->sc->tempip;
- bool is_block, is_leaf;
int error;
ASSERT(S_ISDIR(VFS_I(dp)->i_mode));
@@ -702,23 +701,7 @@ xrep_dir_replay_createname(
rd->args.inumber = inum;
rd->args.total = total;
rd->args.op_flags = XFS_DA_OP_ADDNAME | XFS_DA_OP_OKNOENT;
-
- if (dp->i_df.if_format == XFS_DINODE_FMT_LOCAL)
- return xfs_dir2_sf_addname(&rd->args);
-
- error = xfs_dir2_isblock(&rd->args, &is_block);
- if (error)
- return error;
- if (is_block)
- return xfs_dir2_block_addname(&rd->args);
-
- error = xfs_dir2_isleaf(&rd->args, &is_leaf);
- if (error)
- return error;
- if (is_leaf)
- return xfs_dir2_leaf_addname(&rd->args);
-
- return xfs_dir2_node_addname(&rd->args);
+ return xfs_dir_createname_args(&rd->args);
}
/* Replay a stashed removename onto the temporary directory. */