summaryrefslogtreecommitdiffstats
path: root/fs/namei.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2008-08-02 06:49:18 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2008-10-23 09:34:19 +0200
commitd181146572c4fa9af2a068b967cb53dcac7da944 (patch)
tree35919e1675740059cf9336c7dbff0ef35032351c /fs/namei.c
parentbinfmt_elf_fdpic: Update for cputime changes. (diff)
downloadlinux-d181146572c4fa9af2a068b967cb53dcac7da944.tar.xz
linux-d181146572c4fa9af2a068b967cb53dcac7da944.zip
[PATCH] new helper - kern_path()
Analog of lookup_path(), takes struct path *. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namei.c')
-rw-r--r--fs/namei.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/namei.c b/fs/namei.c
index 4ea63ed5e791..4a56f9b59e8c 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -1106,6 +1106,15 @@ int path_lookup(const char *name, unsigned int flags,
return do_path_lookup(AT_FDCWD, name, flags, nd);
}
+int kern_path(const char *name, unsigned int flags, struct path *path)
+{
+ struct nameidata nd;
+ int res = do_path_lookup(AT_FDCWD, name, flags, &nd);
+ if (!res)
+ *path = nd.path;
+ return res;
+}
+
/**
* vfs_path_lookup - lookup a file path relative to a dentry-vfsmount pair
* @dentry: pointer to dentry of the base directory
@@ -2855,6 +2864,7 @@ EXPORT_SYMBOL(__page_symlink);
EXPORT_SYMBOL(page_symlink);
EXPORT_SYMBOL(page_symlink_inode_operations);
EXPORT_SYMBOL(path_lookup);
+EXPORT_SYMBOL(kern_path);
EXPORT_SYMBOL(vfs_path_lookup);
EXPORT_SYMBOL(inode_permission);
EXPORT_SYMBOL(vfs_permission);