xfs: remove xfs_imeta_lookup
authorChristoph Hellwig <hch@lst.de>
Wed, 17 Jul 2024 06:46:04 +0000 (08:46 +0200)
committerChristoph Hellwig <hch@lst.de>
Wed, 17 Jul 2024 12:31:20 +0000 (14:31 +0200)
Source kernel commit: 87851dac01cdd077c6e643c063d83c6f719b89ce

xfs_imeta_lookup is now only called by xfs_imeta_load, so fold it into
that.

Signed-off-by: Christoph Hellwig <hch@lst.de>
libxfs/xfs_imeta.c
libxfs/xfs_imeta.h

index 0efdc3f7c8bbfa03b4b78e296318d379b8e0b9f0..af07ea02fbc04dbc40161a6c65fc58dbd36481f3 100644 (file)
@@ -118,28 +118,9 @@ corrupt:
 }
 
 /*
- * Look up a metadata inode from the metadata directory.  If the path
+ * Look up and read a metadata inode from the metadata directory.  If the path
  * component doesn't exist, return -ENOENT.
  */
-int
-xfs_imeta_lookup(
-       struct xfs_trans                *tp,
-       struct xfs_inode                *dp,
-       const char                      *path,
-       xfs_ino_t                       *inop)
-{
-       struct xfs_name                 xname;
-       int                             error;
-
-       xfs_imeta_set_xname(&xname, path, XFS_DIR3_FT_UNKNOWN);
-
-       xfs_ilock(dp, XFS_ILOCK_EXCL);
-       error = xfs_imeta_lookup_component(tp, dp, &xname, inop);
-       xfs_iunlock(dp, XFS_ILOCK_EXCL);
-
-       return error;
-}
-
 int
 xfs_imeta_load(
        struct xfs_trans        *tp,
@@ -148,10 +129,15 @@ xfs_imeta_load(
        umode_t                 mode,
        struct xfs_inode        **ipp)
 {
+       struct xfs_name         xname;
        int                     error;
        xfs_ino_t               ino;
 
-       error = xfs_imeta_lookup(tp, dp, path, &ino);
+       xfs_imeta_set_xname(&xname, path, XFS_DIR3_FT_UNKNOWN);
+
+       xfs_ilock(dp, XFS_ILOCK_EXCL);
+       error = xfs_imeta_lookup_component(tp, dp, &xname, &ino);
+       xfs_iunlock(dp, XFS_ILOCK_EXCL);
        if (error)
                return error;
        return xfs_imeta_iget(tp, ino, mode, ipp);
index 1391b4ee1693879ad27f2c6db22f708d857a19ff..218a149e82696105f15d315de41be1605fe68d5c 100644 (file)
@@ -27,8 +27,6 @@ struct xfs_imeta_update {
        unsigned int            ip_locked:1;
 };
 
-int xfs_imeta_lookup(struct xfs_trans *tp, struct xfs_inode *dp,
-               const char *path, xfs_ino_t *ino);
 int xfs_imeta_load(struct xfs_trans *tp, struct xfs_inode *dp,
                const char *path, umode_t mode, struct xfs_inode **ipp);