summaryrefslogtreecommitdiffstats
path: root/fs/fsopen.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2022-03-01 06:05:29 +0100
committerAl Viro <viro@zeniv.linux.org.uk>2022-05-20 05:25:10 +0200
commita5f85d7834f7e1456e799c79a2a83fc11b90cfe2 (patch)
treebe51d3f60e7b1b8697e6c825a58914f11c3ca838 /fs/fsopen.c
parentLinux 5.18-rc1 (diff)
downloadlinux-a5f85d7834f7e1456e799c79a2a83fc11b90cfe2.tar.xz
linux-a5f85d7834f7e1456e799c79a2a83fc11b90cfe2.zip
uninline may_mount() and don't opencode it in fspick(2)/fsopen(2)
It's done once per (mount-related) syscall and there's no point whatsoever making it inline. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/fsopen.c')
-rw-r--r--fs/fsopen.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/fsopen.c b/fs/fsopen.c
index 27a890aa493a..fc9d2d9fd234 100644
--- a/fs/fsopen.c
+++ b/fs/fsopen.c
@@ -119,7 +119,7 @@ SYSCALL_DEFINE2(fsopen, const char __user *, _fs_name, unsigned int, flags)
const char *fs_name;
int ret;
- if (!ns_capable(current->nsproxy->mnt_ns->user_ns, CAP_SYS_ADMIN))
+ if (!may_mount())
return -EPERM;
if (flags & ~FSOPEN_CLOEXEC)
@@ -162,7 +162,7 @@ SYSCALL_DEFINE3(fspick, int, dfd, const char __user *, path, unsigned int, flags
unsigned int lookup_flags;
int ret;
- if (!ns_capable(current->nsproxy->mnt_ns->user_ns, CAP_SYS_ADMIN))
+ if (!may_mount())
return -EPERM;
if ((flags & ~(FSPICK_CLOEXEC |