Commit 183caa3c authored by Dominik Brodowski's avatar Dominik Brodowski

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.netAcked-by: default avatarJan Kara <jack@suse.cz>
Cc: Amir Goldstein <amir73il@gmail.com>
Cc: linux-fsdevel@vger.kernel.org
Signed-off-by: default avatarDominik Brodowski <linux@dominikbrodowski.net>
parent d0d89d1e
...@@ -820,9 +820,8 @@ SYSCALL_DEFINE2(fanotify_init, unsigned int, flags, unsigned int, event_f_flags) ...@@ -820,9 +820,8 @@ SYSCALL_DEFINE2(fanotify_init, unsigned int, flags, unsigned int, event_f_flags)
return fd; return fd;
} }
SYSCALL_DEFINE5(fanotify_mark, int, fanotify_fd, unsigned int, flags, static int do_fanotify_mark(int fanotify_fd, unsigned int flags, __u64 mask,
__u64, mask, int, dfd, int dfd, const char __user *pathname)
const char __user *, pathname)
{ {
struct inode *inode = NULL; struct inode *inode = NULL;
struct vfsmount *mnt = NULL; struct vfsmount *mnt = NULL;
...@@ -928,13 +927,20 @@ SYSCALL_DEFINE5(fanotify_mark, int, fanotify_fd, unsigned int, flags, ...@@ -928,13 +927,20 @@ SYSCALL_DEFINE5(fanotify_mark, int, fanotify_fd, unsigned int, flags,
return ret; return ret;
} }
SYSCALL_DEFINE5(fanotify_mark, int, fanotify_fd, unsigned int, flags,
__u64, mask, int, dfd,
const char __user *, pathname)
{
return do_fanotify_mark(fanotify_fd, flags, mask, dfd, pathname);
}
#ifdef CONFIG_COMPAT #ifdef CONFIG_COMPAT
COMPAT_SYSCALL_DEFINE6(fanotify_mark, COMPAT_SYSCALL_DEFINE6(fanotify_mark,
int, fanotify_fd, unsigned int, flags, int, fanotify_fd, unsigned int, flags,
__u32, mask0, __u32, mask1, int, dfd, __u32, mask0, __u32, mask1, int, dfd,
const char __user *, pathname) const char __user *, pathname)
{ {
return sys_fanotify_mark(fanotify_fd, flags, return do_fanotify_mark(fanotify_fd, flags,
#ifdef __BIG_ENDIAN #ifdef __BIG_ENDIAN
((__u64)mask0 << 32) | mask1, ((__u64)mask0 << 32) | mask1,
#else #else
......
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