From 4bcfa1a5b276a10a2088a77412685e059cfa54bc Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Fri, 12 Apr 2024 07:04:52 +0200 Subject: [PATCH] xfs: pass a file mode instead of file type to xfs_imeta_iget Source kernel commit: 3e3f172d55ff6b43bfa821d4dd4ee9822839dee3 The file type is a directory entry concept, the inode stores the file mode. Pass that to xfs_imeta_iget to avoid conversions and make the code easier to read. Signed-off-by: Christoph Hellwig --- libxfs/xfs_imeta.c | 5 ++--- libxfs/xfs_imeta.h | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/libxfs/xfs_imeta.c b/libxfs/xfs_imeta.c index 50f8f77c8..e8dc94938 100644 --- a/libxfs/xfs_imeta.c +++ b/libxfs/xfs_imeta.c @@ -460,8 +460,7 @@ xfs_imeta_dir_parent( return -ENOENT; /* Grab a new reference to the metadir root dir. */ - error = xfs_imeta_iget(tp, mp->m_metadirip->i_ino, XFS_DIR3_FT_DIR, - &dp); + error = xfs_imeta_iget(tp, mp->m_metadirip->i_ino, S_IFDIR, &dp); if (error) return error; @@ -480,7 +479,7 @@ xfs_imeta_dir_parent( * Grab the child inode while we still have the parent * directory locked. */ - error = xfs_imeta_iget(tp, ino, XFS_DIR3_FT_DIR, &ip); + error = xfs_imeta_iget(tp, ino, S_IFDIR, &ip); if (error) goto out_rele; diff --git a/libxfs/xfs_imeta.h b/libxfs/xfs_imeta.h index 4e9ae35d2..308bf8022 100644 --- a/libxfs/xfs_imeta.h +++ b/libxfs/xfs_imeta.h @@ -113,7 +113,7 @@ void xfs_imeta_resv_free_inode(struct xfs_inode *ip); int xfs_imeta_resv_init_inode(struct xfs_inode *ip, xfs_filblks_t ask); /* Must be implemented by the libxfs client */ -int xfs_imeta_iget(struct xfs_trans *tp, xfs_ino_t ino, unsigned char ftype, +int xfs_imeta_iget(struct xfs_trans *tp, xfs_ino_t ino, umode_t mode, struct xfs_inode **ipp); void xfs_imeta_irele(struct xfs_inode *ip); -- 2.50.1