aboutsummaryrefslogtreecommitdiffstats
path: root/fs/notify/fanotify/fanotify_user.c
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2009-12-17 21:24:26 -0500
committerEric Paris <eparis@redhat.com>2010-07-28 09:58:56 -0400
commit9bbfc964b89009d0cadcec7027afc92ee742e95e (patch)
tree9dceb71cd3d744ec2c295edbb2542adf9b8d803f /fs/notify/fanotify/fanotify_user.c
parentef601a9cfd21fe9ce57e0ee3f4a31552ffb96366 (diff)
fanotify: CONFIG_HAVE_SYSCALL_WRAPPERS for sys_fanotify_mark
Please note that you need the patch below in addition, otherwise the syscall wrapper stuff won't work on those 32 bit architectures which enable the wrappers. When enabled the syscall wrapper defines always take long parameters and then cast them to whatever is needed. This approach doesn't work for the 32 bit case where the original syscall takes a long long parameter, since we would lose the upper 32 bits. So syscalls with 64 bit arguments are special cases wrt to syscall wrappers and enp up in the ugliness below (see also sys_fallocate). In addition these special cased syscall wrappers have the drawback that ftrace syscall tracing doesn't work on them, since they don't get defined by using the usual macros. Signed-off-by: Eric Paris <eparis@redhat.com>
Diffstat (limited to 'fs/notify/fanotify/fanotify_user.c')
-rw-r--r--fs/notify/fanotify/fanotify_user.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c
index a99550f83f8a..a9ced3feb0bb 100644
--- a/fs/notify/fanotify/fanotify_user.c
+++ b/fs/notify/fanotify/fanotify_user.c
@@ -468,8 +468,9 @@ out_put_group:
468 return fd; 468 return fd;
469} 469}
470 470
471SYSCALL_DEFINE5(fanotify_mark, int, fanotify_fd, unsigned int, flags, 471SYSCALL_DEFINE(fanotify_mark)(int fanotify_fd, unsigned int flags,
472 __u64, mask, int, dfd, const char __user *, pathname) 472 __u64 mask, int dfd,
473 const char __user * pathname)
473{ 474{
474 struct inode *inode; 475 struct inode *inode;
475 struct fsnotify_group *group; 476 struct fsnotify_group *group;
@@ -513,6 +514,17 @@ fput_and_out:
513 return ret; 514 return ret;
514} 515}
515 516
517#ifdef CONFIG_HAVE_SYSCALL_WRAPPERS
518asmlinkage long SyS_fanotify_mark(long fanotify_fd, long flags, __u64 mask,
519 long dfd, long pathname)
520{
521 return SYSC_fanotify_mark((int) fanotify_fd, (unsigned int) flags,
522 mask, (int) dfd,
523 (const char __user *) pathname);
524}
525SYSCALL_ALIAS(sys_fanotify_mark, SyS_fanotify_mark);
526#endif
527
516/* 528/*
517 * fanotify_user_setup - Our initialization function. Note that we cannnot return 529 * fanotify_user_setup - Our initialization function. Note that we cannnot return
518 * error because we have compiled-in VFS hooks. So an (unlikely) failure here 530 * error because we have compiled-in VFS hooks. So an (unlikely) failure here