aboutsummaryrefslogtreecommitdiffstats
path: root/fs/namei.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/namei.c')
-rw-r--r--fs/namei.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/fs/namei.c b/fs/namei.c
index defaa47c11d4..3bdb29615a9d 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -1172,6 +1172,37 @@ int fastcall path_lookup(const char *name, unsigned int flags,
1172 return do_path_lookup(AT_FDCWD, name, flags, nd); 1172 return do_path_lookup(AT_FDCWD, name, flags, nd);
1173} 1173}
1174 1174
1175/**
1176 * vfs_path_lookup - lookup a file path relative to a dentry-vfsmount pair
1177 * @dentry: pointer to dentry of the base directory
1178 * @mnt: pointer to vfs mount of the base directory
1179 * @name: pointer to file name
1180 * @flags: lookup flags
1181 * @nd: pointer to nameidata
1182 */
1183int vfs_path_lookup(struct dentry *dentry, struct vfsmount *mnt,
1184 const char *name, unsigned int flags,
1185 struct nameidata *nd)
1186{
1187 int retval;
1188
1189 /* same as do_path_lookup */
1190 nd->last_type = LAST_ROOT;
1191 nd->flags = flags;
1192 nd->depth = 0;
1193
1194 nd->mnt = mntget(mnt);
1195 nd->dentry = dget(dentry);
1196
1197 retval = path_walk(name, nd);
1198 if (unlikely(!retval && !audit_dummy_context() && nd->dentry &&
1199 nd->dentry->d_inode))
1200 audit_inode(name, nd->dentry->d_inode);
1201
1202 return retval;
1203
1204}
1205
1175static int __path_lookup_intent_open(int dfd, const char *name, 1206static int __path_lookup_intent_open(int dfd, const char *name,
1176 unsigned int lookup_flags, struct nameidata *nd, 1207 unsigned int lookup_flags, struct nameidata *nd,
1177 int open_flags, int create_mode) 1208 int open_flags, int create_mode)
@@ -2774,6 +2805,7 @@ EXPORT_SYMBOL(__page_symlink);
2774EXPORT_SYMBOL(page_symlink); 2805EXPORT_SYMBOL(page_symlink);
2775EXPORT_SYMBOL(page_symlink_inode_operations); 2806EXPORT_SYMBOL(page_symlink_inode_operations);
2776EXPORT_SYMBOL(path_lookup); 2807EXPORT_SYMBOL(path_lookup);
2808EXPORT_SYMBOL(vfs_path_lookup);
2777EXPORT_SYMBOL(path_release); 2809EXPORT_SYMBOL(path_release);
2778EXPORT_SYMBOL(path_walk); 2810EXPORT_SYMBOL(path_walk);
2779EXPORT_SYMBOL(permission); 2811EXPORT_SYMBOL(permission);