Skip to content

Commit ce6595a

Browse files
author
Al Viro
committed
kill the last users of user_{path,lpath,path_dir}()
old wrappers with few callers remaining; put them out of their misery... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 6b61aed commit ce6595a

4 files changed

Lines changed: 8 additions & 25 deletions

File tree

‎fs/coda/pioctl.c‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,8 @@ static long coda_pioctl(struct file *filp, unsigned int cmd,
6363
* Look up the pathname. Note that the pathname is in
6464
* user memory, and namei takes care of this
6565
*/
66-
if (data.follow)
67-
error = user_path(data.path, &path);
68-
else
69-
error = user_lpath(data.path, &path);
70-
66+
error = user_path_at(AT_FDCWD, data.path,
67+
data.follow ? LOOKUP_FOLLOW : 0, &path);
7168
if (error)
7269
return error;
7370

‎fs/namespace.c‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3044,7 +3044,7 @@ long do_mount(const char *dev_name, const char __user *dir_name,
30443044
return -EINVAL;
30453045

30463046
/* ... and get the mountpoint */
3047-
retval = user_path(dir_name, &path);
3047+
retval = user_path_at(AT_FDCWD, dir_name, LOOKUP_FOLLOW, &path);
30483048
if (retval)
30493049
return retval;
30503050

@@ -3591,11 +3591,13 @@ SYSCALL_DEFINE2(pivot_root, const char __user *, new_root,
35913591
if (!may_mount())
35923592
return -EPERM;
35933593

3594-
error = user_path_dir(new_root, &new);
3594+
error = user_path_at(AT_FDCWD, new_root,
3595+
LOOKUP_FOLLOW | LOOKUP_DIRECTORY, &new);
35953596
if (error)
35963597
goto out0;
35973598

3598-
error = user_path_dir(put_old, &old);
3599+
error = user_path_at(AT_FDCWD, put_old,
3600+
LOOKUP_FOLLOW | LOOKUP_DIRECTORY, &old);
35993601
if (error)
36003602
goto out1;
36013603

‎fs/xfs/xfs_ioctl.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ xfs_find_handle(
6767
return -EBADF;
6868
inode = file_inode(f.file);
6969
} else {
70-
error = user_lpath((const char __user *)hreq->path, &path);
70+
error = user_path_at(AT_FDCWD, hreq->path, 0, &path);
7171
if (error)
7272
return error;
7373
inode = d_inode(path.dentry);

‎include/linux/namei.h‎

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -48,22 +48,6 @@ static inline int user_path_at(int dfd, const char __user *name, unsigned flags,
4848
return user_path_at_empty(dfd, name, flags, path, NULL);
4949
}
5050

51-
static inline int user_path(const char __user *name, struct path *path)
52-
{
53-
return user_path_at_empty(AT_FDCWD, name, LOOKUP_FOLLOW, path, NULL);
54-
}
55-
56-
static inline int user_lpath(const char __user *name, struct path *path)
57-
{
58-
return user_path_at_empty(AT_FDCWD, name, 0, path, NULL);
59-
}
60-
61-
static inline int user_path_dir(const char __user *name, struct path *path)
62-
{
63-
return user_path_at_empty(AT_FDCWD, name,
64-
LOOKUP_FOLLOW | LOOKUP_DIRECTORY, path, NULL);
65-
}
66-
6751
extern int kern_path(const char *, unsigned, struct path *);
6852

6953
extern struct dentry *kern_path_create(int, const char *, struct path *, unsigned int);

0 commit comments

Comments
 (0)