]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
inotify: add do_inotify_init() helper; remove in-kernel call to syscall
authorDominik Brodowski <linux@dominikbrodowski.net>
Tue, 13 Mar 2018 20:27:21 +0000 (21:27 +0100)
committerDominik Brodowski <linux@dominikbrodowski.net>
Mon, 2 Apr 2018 18:15:45 +0000 (20:15 +0200)
Using the inotify-internal do_inotify_init() helper allows us to get rid
of the in-kernel call to sys_inotify_init1() 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

Acked-by: Jan Kara <jack@suse.cz>
Cc: Amir Goldstein <amir73il@gmail.com>
Cc: linux-fsdevel@vger.kernel.org
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
fs/notify/inotify/inotify_user.c

index 2c908b31d6c93dcf49dd821ffd6ddfb67ac027f4..43c23653ce2eb186277d09211dcfef46e5c4719c 100644 (file)
@@ -635,7 +635,7 @@ static struct fsnotify_group *inotify_new_group(unsigned int max_events)
 
 
 /* inotify syscalls */
-SYSCALL_DEFINE1(inotify_init1, int, flags)
+static int do_inotify_init(int flags)
 {
        struct fsnotify_group *group;
        int ret;
@@ -660,9 +660,14 @@ SYSCALL_DEFINE1(inotify_init1, int, flags)
        return ret;
 }
 
+SYSCALL_DEFINE1(inotify_init1, int, flags)
+{
+       return do_inotify_init(flags);
+}
+
 SYSCALL_DEFINE0(inotify_init)
 {
-       return sys_inotify_init1(0);
+       return do_inotify_init(0);
 }
 
 SYSCALL_DEFINE3(inotify_add_watch, int, fd, const char __user *, pathname,