diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2008-08-02 00:49:18 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2008-10-23 03:34:19 -0400 |
commit | d181146572c4fa9af2a068b967cb53dcac7da944 (patch) | |
tree | 35919e1675740059cf9336c7dbff0ef35032351c | |
parent | 2515ddc6db8eb49a79f0fe5e67ff09ac7c81eab4 (diff) |
[PATCH] new helper - kern_path()
Analog of lookup_path(), takes struct path *.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | fs/namei.c | 10 | ||||
-rw-r--r-- | include/linux/namei.h | 2 |
2 files changed, 12 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, | |||
1106 | return do_path_lookup(AT_FDCWD, name, flags, nd); | 1106 | return do_path_lookup(AT_FDCWD, name, flags, nd); |
1107 | } | 1107 | } |
1108 | 1108 | ||
1109 | int kern_path(const char *name, unsigned int flags, struct path *path) | ||
1110 | { | ||
1111 | struct nameidata nd; | ||
1112 | int res = do_path_lookup(AT_FDCWD, name, flags, &nd); | ||
1113 | if (!res) | ||
1114 | *path = nd.path; | ||
1115 | return res; | ||
1116 | } | ||
1117 | |||
1109 | /** | 1118 | /** |
1110 | * vfs_path_lookup - lookup a file path relative to a dentry-vfsmount pair | 1119 | * vfs_path_lookup - lookup a file path relative to a dentry-vfsmount pair |
1111 | * @dentry: pointer to dentry of the base directory | 1120 | * @dentry: pointer to dentry of the base directory |
@@ -2855,6 +2864,7 @@ EXPORT_SYMBOL(__page_symlink); | |||
2855 | EXPORT_SYMBOL(page_symlink); | 2864 | EXPORT_SYMBOL(page_symlink); |
2856 | EXPORT_SYMBOL(page_symlink_inode_operations); | 2865 | EXPORT_SYMBOL(page_symlink_inode_operations); |
2857 | EXPORT_SYMBOL(path_lookup); | 2866 | EXPORT_SYMBOL(path_lookup); |
2867 | EXPORT_SYMBOL(kern_path); | ||
2858 | EXPORT_SYMBOL(vfs_path_lookup); | 2868 | EXPORT_SYMBOL(vfs_path_lookup); |
2859 | EXPORT_SYMBOL(inode_permission); | 2869 | EXPORT_SYMBOL(inode_permission); |
2860 | EXPORT_SYMBOL(vfs_permission); | 2870 | EXPORT_SYMBOL(vfs_permission); |
diff --git a/include/linux/namei.h b/include/linux/namei.h index 68f8c3203c89..221e8bc894ba 100644 --- a/include/linux/namei.h +++ b/include/linux/namei.h | |||
@@ -61,6 +61,8 @@ extern int user_path_at(int, const char __user *, unsigned, struct path *); | |||
61 | #define user_path_dir(name, path) \ | 61 | #define user_path_dir(name, path) \ |
62 | user_path_at(AT_FDCWD, name, LOOKUP_FOLLOW | LOOKUP_DIRECTORY, path) | 62 | user_path_at(AT_FDCWD, name, LOOKUP_FOLLOW | LOOKUP_DIRECTORY, path) |
63 | 63 | ||
64 | extern int kern_path(const char *, unsigned, struct path *); | ||
65 | |||
64 | extern int path_lookup(const char *, unsigned, struct nameidata *); | 66 | extern int path_lookup(const char *, unsigned, struct nameidata *); |
65 | extern int vfs_path_lookup(struct dentry *, struct vfsmount *, | 67 | extern int vfs_path_lookup(struct dentry *, struct vfsmount *, |
66 | const char *, unsigned int, struct nameidata *); | 68 | const char *, unsigned int, struct nameidata *); |