]> www.infradead.org Git - users/hch/xfsprogs.git/commitdiff
xfs: pass a file mode instead of file type to xfs_imeta_iget
authorChristoph Hellwig <hch@lst.de>
Fri, 12 Apr 2024 05:04:52 +0000 (07:04 +0200)
committerChristoph Hellwig <hch@lst.de>
Fri, 12 Apr 2024 06:00:43 +0000 (08:00 +0200)
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 <hch@lst.de>
libxfs/xfs_imeta.c
libxfs/xfs_imeta.h

index 50f8f77c89f5e18694c73eff9f65c2f92b359b3f..e8dc94938073cdd12928b191dcf648167ce477b9 100644 (file)
@@ -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;
 
index 4e9ae35d247754ab0dc742c2db52d55bcf10a738..308bf8022c91dcf9ca243d647344c19d7d6a3277 100644 (file)
@@ -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);