From 7e297afdfa84947ffd0401e1286631b9b8688fef Mon Sep 17 00:00:00 2001 From: Eric Paris Date: Wed, 28 Jul 2010 10:18:38 -0400 Subject: [PATCH] --- yaml --- r: 207723 b: refs/heads/master c: 7f6b6117e1803777fcf48fe31bd236a7fbf740db h: refs/heads/master i: 207721: f195334ddf16846e2bfe544b26f8ccbaa3626e55 207719: e2055457950046518bdb9393d701a659849d2276 v: v3 --- [refs] | 2 +- trunk/fs/notify/inotify/inotify_fsnotify.c | 29 ++++------------------ 2 files changed, 6 insertions(+), 25 deletions(-) diff --git a/[refs] b/[refs] index a532638f7b4d..1d8a305b24c9 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 3a9b16b407f10b2a771bcae13fb5791e527d6bcf +refs/heads/master: 7f6b6117e1803777fcf48fe31bd236a7fbf740db diff --git a/trunk/fs/notify/inotify/inotify_fsnotify.c b/trunk/fs/notify/inotify/inotify_fsnotify.c index dbd76bbb3e21..aa3f93c03e0f 100644 --- a/trunk/fs/notify/inotify/inotify_fsnotify.c +++ b/trunk/fs/notify/inotify/inotify_fsnotify.c @@ -93,7 +93,6 @@ static int inotify_handle_event(struct fsnotify_group *group, struct fsnotify_mark *mark, struct fsnotify_event *event) { - struct fsnotify_mark *fsn_mark; struct inotify_inode_mark *i_mark; struct inode *to_tell; struct inotify_event_private_data *event_priv; @@ -106,11 +105,7 @@ static int inotify_handle_event(struct fsnotify_group *group, to_tell = event->to_tell; - fsn_mark = fsnotify_find_inode_mark(group, to_tell); - /* race with watch removal? We already passes should_send */ - if (unlikely(!fsn_mark)) - return 0; - i_mark = container_of(fsn_mark, struct inotify_inode_mark, + i_mark = container_of(mark, struct inotify_inode_mark, fsn_mark); wd = i_mark->wd; @@ -132,14 +127,8 @@ static int inotify_handle_event(struct fsnotify_group *group, ret = PTR_ERR(added_event); } - if (fsn_mark->mask & IN_ONESHOT) - fsnotify_destroy_mark(fsn_mark); - - /* - * If we hold the fsn_mark until after the event is on the queue - * IN_IGNORED won't be able to pass this event in the queue - */ - fsnotify_put_mark(fsn_mark); + if (mark->mask & IN_ONESHOT) + fsnotify_destroy_mark(mark); return ret; } @@ -153,20 +142,15 @@ static bool inotify_should_send_event(struct fsnotify_group *group, struct inode struct vfsmount *mnt, struct fsnotify_mark *mark, __u32 mask, void *data, int data_type) { - struct fsnotify_mark *fsn_mark; bool send; pr_debug("%s: group=%p inode=%p mask=%x data=%p data_type=%d\n", __func__, group, inode, mask, data, data_type); - fsn_mark = fsnotify_find_inode_mark(group, inode); - if (!fsn_mark) - return false; - mask = (mask & ~FS_EVENT_ON_CHILD); - send = (fsn_mark->mask & mask); + send = (mark->mask & mask); - if (send && (fsn_mark->mask & FS_EXCL_UNLINK) && + if (send && (mark->mask & FS_EXCL_UNLINK) && (data_type == FSNOTIFY_EVENT_FILE)) { struct file *file = data; @@ -174,9 +158,6 @@ static bool inotify_should_send_event(struct fsnotify_group *group, struct inode send = false; } - /* find took a reference */ - fsnotify_put_mark(fsn_mark); - return send; }