From 2fc96f8331ba7d08ddc126d154a1504b9a79b79e Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Sun, 11 Mar 2018 11:34:37 +0100 Subject: [PATCH] fs: add do_eventfd() helper; remove internal call to sys_eventfd() Using this helper removes an in-kernel call to the sys_eventfd() syscall. 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 Signed-off-by: Dominik Brodowski --- fs/eventfd.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/fs/eventfd.c b/fs/eventfd.c index 012f5bd46dfa..08d3bd602f73 100644 --- a/fs/eventfd.c +++ b/fs/eventfd.c @@ -380,7 +380,7 @@ struct eventfd_ctx *eventfd_ctx_fileget(struct file *file) } EXPORT_SYMBOL_GPL(eventfd_ctx_fileget); -SYSCALL_DEFINE2(eventfd2, unsigned int, count, int, flags) +static int do_eventfd(unsigned int count, int flags) { struct eventfd_ctx *ctx; int fd; @@ -409,8 +409,13 @@ SYSCALL_DEFINE2(eventfd2, unsigned int, count, int, flags) return fd; } -SYSCALL_DEFINE1(eventfd, unsigned int, count) +SYSCALL_DEFINE2(eventfd2, unsigned int, count, int, flags) { - return sys_eventfd2(count, 0); + return do_eventfd(count, flags); +} + +SYSCALL_DEFINE1(eventfd, unsigned int, count) +{ + return do_eventfd(count, 0); }