From a4c1f2860d3b1a1bc22615d8b4b3947341a8aec8 Mon Sep 17 00:00:00 2001 From: Andreas Gruenbacher Date: Thu, 17 Dec 2009 21:24:28 -0500 Subject: [PATCH] --- yaml --- r: 207671 b: refs/heads/master c: c6223f464927cab9f4b10169b78c51d84228faf8 h: refs/heads/master i: 207669: 6a922818ead9a6c0e4775d70f11c93bb438de845 207667: 4b3b20b46b852dd5c15e2bb3098b6ee44635270b 207663: dbe2aaabda3196a1ec547ad6252e711909a363e9 v: v3 --- [refs] | 2 +- trunk/fs/notify/fanotify/fanotify_user.c | 31 ++++++++---------------- 2 files changed, 11 insertions(+), 22 deletions(-) diff --git a/[refs] b/[refs] index d750a75195fb..62c8b27421d4 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 88826276dcaf4cef9cc7c2695ff15c6d20d4a74d +refs/heads/master: c6223f464927cab9f4b10169b78c51d84228faf8 diff --git a/trunk/fs/notify/fanotify/fanotify_user.c b/trunk/fs/notify/fanotify/fanotify_user.c index cb7a0c5ff854..0f25fc20a6a7 100644 --- a/trunk/fs/notify/fanotify/fanotify_user.c +++ b/trunk/fs/notify/fanotify/fanotify_user.c @@ -468,26 +468,6 @@ static int fanotify_add_mark(struct fsnotify_group *group, struct inode *inode, return PTR_ERR(fsn_mark); } -static int fanotify_update_mark(struct fsnotify_group *group, - struct inode *inode, struct vfsmount *mnt, - int flags, __u32 mask) -{ - pr_debug("%s: group=%p inode=%p mnt=%p flags=%x mask=%x\n", - __func__, group, inode, mnt, flags, mask); - - BUG_ON(inode && mnt); - BUG_ON(!inode && !mnt); - - if (flags & FAN_MARK_ADD) - fanotify_add_mark(group, inode, mnt, flags, mask); - else if (flags & FAN_MARK_REMOVE) - fanotify_remove_mark(group, inode, mnt, flags, mask); - else - BUG(); - - return 0; -} - static bool fanotify_mark_validate_input(int flags, __u32 mask) { @@ -583,7 +563,16 @@ SYSCALL_DEFINE(fanotify_mark)(int fanotify_fd, unsigned int flags, group = filp->private_data; /* create/update an inode mark */ - ret = fanotify_update_mark(group, inode, NULL, flags, mask); + switch (flags & (FAN_MARK_ADD | FAN_MARK_REMOVE)) { + case FAN_MARK_ADD: + ret = fanotify_add_mark(group, inode, NULL, flags, mask); + break; + case FAN_MARK_REMOVE: + ret = fanotify_remove_mark(group, inode, NULL, flags, mask); + break; + default: + ret = -EINVAL; + } path_put(&path); fput_and_out: