diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2015-02-22 19:46:04 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2015-03-24 17:19:16 -0400 |
commit | 6e8a1f8741d6f1179cb3b03991caeac9e4bfd9e2 (patch) | |
tree | e3d91c170805b63be28a2cef9692d10e3042be84 | |
parent | 668696dcbb1b184f8758ba9903c373c4960174a9 (diff) |
switch path_init() to struct filename
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | fs/namei.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/namei.c b/fs/namei.c index e1d18522db31..2c4b68c12550 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -1848,7 +1848,7 @@ static int link_path_walk(const char *name, struct nameidata *nd) | |||
1848 | return err; | 1848 | return err; |
1849 | } | 1849 | } |
1850 | 1850 | ||
1851 | static int path_init(int dfd, const char *name, unsigned int flags, | 1851 | static int path_init(int dfd, const struct filename *name, unsigned int flags, |
1852 | struct nameidata *nd) | 1852 | struct nameidata *nd) |
1853 | { | 1853 | { |
1854 | int retval = 0; | 1854 | int retval = 0; |
@@ -1860,7 +1860,7 @@ static int path_init(int dfd, const char *name, unsigned int flags, | |||
1860 | if (flags & LOOKUP_ROOT) { | 1860 | if (flags & LOOKUP_ROOT) { |
1861 | struct dentry *root = nd->root.dentry; | 1861 | struct dentry *root = nd->root.dentry; |
1862 | struct inode *inode = root->d_inode; | 1862 | struct inode *inode = root->d_inode; |
1863 | if (*name) { | 1863 | if (name->name[0]) { |
1864 | if (!d_can_lookup(root)) | 1864 | if (!d_can_lookup(root)) |
1865 | return -ENOTDIR; | 1865 | return -ENOTDIR; |
1866 | retval = inode_permission(inode, MAY_EXEC); | 1866 | retval = inode_permission(inode, MAY_EXEC); |
@@ -1882,7 +1882,7 @@ static int path_init(int dfd, const char *name, unsigned int flags, | |||
1882 | nd->root.mnt = NULL; | 1882 | nd->root.mnt = NULL; |
1883 | 1883 | ||
1884 | nd->m_seq = read_seqbegin(&mount_lock); | 1884 | nd->m_seq = read_seqbegin(&mount_lock); |
1885 | if (*name=='/') { | 1885 | if (name->name[0] == '/') { |
1886 | if (flags & LOOKUP_RCU) { | 1886 | if (flags & LOOKUP_RCU) { |
1887 | rcu_read_lock(); | 1887 | rcu_read_lock(); |
1888 | nd->seq = set_root_rcu(nd); | 1888 | nd->seq = set_root_rcu(nd); |
@@ -1916,7 +1916,7 @@ static int path_init(int dfd, const char *name, unsigned int flags, | |||
1916 | 1916 | ||
1917 | dentry = f.file->f_path.dentry; | 1917 | dentry = f.file->f_path.dentry; |
1918 | 1918 | ||
1919 | if (*name) { | 1919 | if (name->name[0]) { |
1920 | if (!d_can_lookup(dentry)) { | 1920 | if (!d_can_lookup(dentry)) { |
1921 | fdput(f); | 1921 | fdput(f); |
1922 | return -ENOTDIR; | 1922 | return -ENOTDIR; |
@@ -1946,7 +1946,7 @@ static int path_init(int dfd, const char *name, unsigned int flags, | |||
1946 | return -ECHILD; | 1946 | return -ECHILD; |
1947 | done: | 1947 | done: |
1948 | current->total_link_count = 0; | 1948 | current->total_link_count = 0; |
1949 | return link_path_walk(name, nd); | 1949 | return link_path_walk(name->name, nd); |
1950 | } | 1950 | } |
1951 | 1951 | ||
1952 | static void path_cleanup(struct nameidata *nd) | 1952 | static void path_cleanup(struct nameidata *nd) |
@@ -1989,7 +1989,7 @@ static int path_lookupat(int dfd, const struct filename *name, | |||
1989 | * be handled by restarting a traditional ref-walk (which will always | 1989 | * be handled by restarting a traditional ref-walk (which will always |
1990 | * be able to complete). | 1990 | * be able to complete). |
1991 | */ | 1991 | */ |
1992 | err = path_init(dfd, name->name, flags, nd); | 1992 | err = path_init(dfd, name, flags, nd); |
1993 | if (!err && !(flags & LOOKUP_PARENT)) { | 1993 | if (!err && !(flags & LOOKUP_PARENT)) { |
1994 | err = lookup_last(nd, &path); | 1994 | err = lookup_last(nd, &path); |
1995 | while (err > 0) { | 1995 | while (err > 0) { |
@@ -2343,7 +2343,7 @@ path_mountpoint(int dfd, const struct filename *name, struct path *path, | |||
2343 | struct nameidata nd; | 2343 | struct nameidata nd; |
2344 | int err; | 2344 | int err; |
2345 | 2345 | ||
2346 | err = path_init(dfd, name->name, flags, &nd); | 2346 | err = path_init(dfd, name, flags, &nd); |
2347 | if (unlikely(err)) | 2347 | if (unlikely(err)) |
2348 | goto out; | 2348 | goto out; |
2349 | 2349 | ||
@@ -3226,7 +3226,7 @@ static struct file *path_openat(int dfd, struct filename *pathname, | |||
3226 | goto out; | 3226 | goto out; |
3227 | } | 3227 | } |
3228 | 3228 | ||
3229 | error = path_init(dfd, pathname->name, flags, nd); | 3229 | error = path_init(dfd, pathname, flags, nd); |
3230 | if (unlikely(error)) | 3230 | if (unlikely(error)) |
3231 | goto out; | 3231 | goto out; |
3232 | 3232 | ||