mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-04-01 12:04:08 +00:00
fs: push the getname from do_rmdir into the callers
This mirrors do_unlinkat and will make life a little easier for the init code to reuse the whole function with a kernel filename. Signed-off-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
parent
41525f56e2
commit
e24ab0ef68
3 changed files with 7 additions and 9 deletions
|
@ -65,7 +65,7 @@ extern int vfs_path_lookup(struct dentry *, struct vfsmount *,
|
||||||
long do_mknodat(int dfd, const char __user *filename, umode_t mode,
|
long do_mknodat(int dfd, const char __user *filename, umode_t mode,
|
||||||
unsigned int dev);
|
unsigned int dev);
|
||||||
long do_mkdirat(int dfd, const char __user *pathname, umode_t mode);
|
long do_mkdirat(int dfd, const char __user *pathname, umode_t mode);
|
||||||
long do_rmdir(int dfd, const char __user *pathname);
|
long do_rmdir(int dfd, struct filename *name);
|
||||||
long do_unlinkat(int dfd, struct filename *name);
|
long do_unlinkat(int dfd, struct filename *name);
|
||||||
long do_symlinkat(const char __user *oldname, int newdfd,
|
long do_symlinkat(const char __user *oldname, int newdfd,
|
||||||
const char __user *newname);
|
const char __user *newname);
|
||||||
|
|
10
fs/namei.c
10
fs/namei.c
|
@ -3720,17 +3720,16 @@ out:
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(vfs_rmdir);
|
EXPORT_SYMBOL(vfs_rmdir);
|
||||||
|
|
||||||
long do_rmdir(int dfd, const char __user *pathname)
|
long do_rmdir(int dfd, struct filename *name)
|
||||||
{
|
{
|
||||||
int error = 0;
|
int error = 0;
|
||||||
struct filename *name;
|
|
||||||
struct dentry *dentry;
|
struct dentry *dentry;
|
||||||
struct path path;
|
struct path path;
|
||||||
struct qstr last;
|
struct qstr last;
|
||||||
int type;
|
int type;
|
||||||
unsigned int lookup_flags = 0;
|
unsigned int lookup_flags = 0;
|
||||||
retry:
|
retry:
|
||||||
name = filename_parentat(dfd, getname(pathname), lookup_flags,
|
name = filename_parentat(dfd, name, lookup_flags,
|
||||||
&path, &last, &type);
|
&path, &last, &type);
|
||||||
if (IS_ERR(name))
|
if (IS_ERR(name))
|
||||||
return PTR_ERR(name);
|
return PTR_ERR(name);
|
||||||
|
@ -3781,7 +3780,7 @@ exit1:
|
||||||
|
|
||||||
SYSCALL_DEFINE1(rmdir, const char __user *, pathname)
|
SYSCALL_DEFINE1(rmdir, const char __user *, pathname)
|
||||||
{
|
{
|
||||||
return do_rmdir(AT_FDCWD, pathname);
|
return do_rmdir(AT_FDCWD, getname(pathname));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -3926,8 +3925,7 @@ SYSCALL_DEFINE3(unlinkat, int, dfd, const char __user *, pathname, int, flag)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
if (flag & AT_REMOVEDIR)
|
if (flag & AT_REMOVEDIR)
|
||||||
return do_rmdir(dfd, pathname);
|
return do_rmdir(dfd, getname(pathname));
|
||||||
|
|
||||||
return do_unlinkat(dfd, getname(pathname));
|
return do_unlinkat(dfd, getname(pathname));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1281,11 +1281,11 @@ static inline long ksys_unlink(const char __user *pathname)
|
||||||
return do_unlinkat(AT_FDCWD, getname(pathname));
|
return do_unlinkat(AT_FDCWD, getname(pathname));
|
||||||
}
|
}
|
||||||
|
|
||||||
extern long do_rmdir(int dfd, const char __user *pathname);
|
long do_rmdir(int dfd, struct filename *name);
|
||||||
|
|
||||||
static inline long ksys_rmdir(const char __user *pathname)
|
static inline long ksys_rmdir(const char __user *pathname)
|
||||||
{
|
{
|
||||||
return do_rmdir(AT_FDCWD, pathname);
|
return do_rmdir(AT_FDCWD, getname(pathname));
|
||||||
}
|
}
|
||||||
|
|
||||||
extern long do_mkdirat(int dfd, const char __user *pathname, umode_t mode);
|
extern long do_mkdirat(int dfd, const char __user *pathname, umode_t mode);
|
||||||
|
|
Loading…
Add table
Reference in a new issue