Commit 52fb6db0 authored by Dominik Brodowski's avatar Dominik Brodowski

fs: add do_signalfd4() helper; remove internal calls to sys_signalfd4()

Using this helper removes in-kernel calls to the sys_signalfd4() syscall
function.

This patch is part of a series which removes in-kernel calls to syscalls.
On this basis, the syscall entry path can be streamlined. For details, see
http://lkml.kernel.org/r/20180325162527.GA17492@light.dominikbrodowski.net

Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarDominik Brodowski <linux@dominikbrodowski.net>
parent 791eb22e
...@@ -256,8 +256,8 @@ static const struct file_operations signalfd_fops = { ...@@ -256,8 +256,8 @@ static const struct file_operations signalfd_fops = {
.llseek = noop_llseek, .llseek = noop_llseek,
}; };
SYSCALL_DEFINE4(signalfd4, int, ufd, sigset_t __user *, user_mask, static int do_signalfd4(int ufd, sigset_t __user *user_mask, size_t sizemask,
size_t, sizemask, int, flags) int flags)
{ {
sigset_t sigmask; sigset_t sigmask;
struct signalfd_ctx *ctx; struct signalfd_ctx *ctx;
...@@ -310,10 +310,16 @@ SYSCALL_DEFINE4(signalfd4, int, ufd, sigset_t __user *, user_mask, ...@@ -310,10 +310,16 @@ SYSCALL_DEFINE4(signalfd4, int, ufd, sigset_t __user *, user_mask,
return ufd; return ufd;
} }
SYSCALL_DEFINE4(signalfd4, int, ufd, sigset_t __user *, user_mask,
size_t, sizemask, int, flags)
{
return do_signalfd4(ufd, user_mask, sizemask, flags);
}
SYSCALL_DEFINE3(signalfd, int, ufd, sigset_t __user *, user_mask, SYSCALL_DEFINE3(signalfd, int, ufd, sigset_t __user *, user_mask,
size_t, sizemask) size_t, sizemask)
{ {
return sys_signalfd4(ufd, user_mask, sizemask, 0); return do_signalfd4(ufd, user_mask, sizemask, 0);
} }
#ifdef CONFIG_COMPAT #ifdef CONFIG_COMPAT
...@@ -333,7 +339,7 @@ COMPAT_SYSCALL_DEFINE4(signalfd4, int, ufd, ...@@ -333,7 +339,7 @@ COMPAT_SYSCALL_DEFINE4(signalfd4, int, ufd,
if (copy_to_user(ksigmask, &tmp, sizeof(sigset_t))) if (copy_to_user(ksigmask, &tmp, sizeof(sigset_t)))
return -EFAULT; return -EFAULT;
return sys_signalfd4(ufd, ksigmask, sizeof(sigset_t), flags); return do_signalfd4(ufd, ksigmask, sizeof(sigset_t), flags);
} }
COMPAT_SYSCALL_DEFINE3(signalfd, int, ufd, COMPAT_SYSCALL_DEFINE3(signalfd, int, ufd,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment