}
/*
- * 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,
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);
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);