diff options
author | Andreas Gruenbacher <agruen@suse.de> | 2009-12-17 21:24:29 -0500 |
---|---|---|
committer | Eric Paris <eparis@redhat.com> | 2010-07-28 09:58:59 -0400 |
commit | 88380fe66e0ac22529f5426ab27d67da00ed2628 (patch) | |
tree | 2585cd0b8407263628696476be7aa4f5b7d24a1b /fs/notify/fanotify/fanotify_user.c | |
parent | f3640192c0a177506ec08ab07ed3178b912574da (diff) |
fanotify: remove fanotify.h declarations
fanotify_mark_validate functions are all needlessly declared in headers as
static inlines. Instead just do the checks where they are needed for code
readability.
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
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.c | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c index 00628d3ce5a..618867e4d30 100644 --- a/fs/notify/fanotify/fanotify_user.c +++ b/fs/notify/fanotify/fanotify_user.c @@ -430,20 +430,6 @@ static int fanotify_add_inode_mark(struct fsnotify_group *group, return 0; } -static bool fanotify_mark_validate_input(int flags, - __u32 mask) -{ - pr_debug("%s: flags=%x mask=%x\n", __func__, flags, mask); - - /* are flags valid of this operation? */ - if (!fanotify_mark_flags_valid(flags)) - return false; - /* is the mask valid? */ - if (!fanotify_mask_valid(mask)) - return false; - return true; -} - /* fanotify syscalls */ SYSCALL_DEFINE3(fanotify_init, unsigned int, flags, unsigned int, event_f_flags, unsigned int, priority) @@ -505,7 +491,16 @@ SYSCALL_DEFINE(fanotify_mark)(int fanotify_fd, unsigned int flags, if (mask & ((__u64)0xffffffff << 32)) return -EINVAL; - if (!fanotify_mark_validate_input(flags, mask)) + if (flags & ~FAN_ALL_MARK_FLAGS) + return -EINVAL; + switch (flags & (FAN_MARK_ADD | FAN_MARK_REMOVE)) { + case FAN_MARK_ADD: + case FAN_MARK_REMOVE: + break; + default: + return -EINVAL; + } + if (mask & ~(FAN_ALL_EVENTS | FAN_EVENT_ON_CHILD)) return -EINVAL; filp = fget_light(fanotify_fd, &fput_needed); |