Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

fanotify: add do_fanotify_mark() helper; remove in-kernel call to syscall

Using the fs-internal do_fanotify_mark() helper allows us to get rid of
the fs-internal call to the sys_fanotify_mark() 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>

+10 -4
+10 -4
fs/notify/fanotify/fanotify_user.c
··· 820 820 return fd; 821 821 } 822 822 823 - SYSCALL_DEFINE5(fanotify_mark, int, fanotify_fd, unsigned int, flags, 824 - __u64, mask, int, dfd, 825 - const char __user *, pathname) 823 + static int do_fanotify_mark(int fanotify_fd, unsigned int flags, __u64 mask, 824 + int dfd, const char __user *pathname) 826 825 { 827 826 struct inode *inode = NULL; 828 827 struct vfsmount *mnt = NULL; ··· 927 928 return ret; 928 929 } 929 930 931 + SYSCALL_DEFINE5(fanotify_mark, int, fanotify_fd, unsigned int, flags, 932 + __u64, mask, int, dfd, 933 + const char __user *, pathname) 934 + { 935 + return do_fanotify_mark(fanotify_fd, flags, mask, dfd, pathname); 936 + } 937 + 930 938 #ifdef CONFIG_COMPAT 931 939 COMPAT_SYSCALL_DEFINE6(fanotify_mark, 932 940 int, fanotify_fd, unsigned int, flags, 933 941 __u32, mask0, __u32, mask1, int, dfd, 934 942 const char __user *, pathname) 935 943 { 936 - return sys_fanotify_mark(fanotify_fd, flags, 944 + return do_fanotify_mark(fanotify_fd, flags, 937 945 #ifdef __BIG_ENDIAN 938 946 ((__u64)mask0 << 32) | mask1, 939 947 #else