diff options
author | Eric Paris <eparis@redhat.com> | 2010-11-09 11:48:30 -0500 |
---|---|---|
committer | Eric Paris <eparis@redhat.com> | 2010-12-07 16:28:31 -0500 |
commit | d6bc7e04764713f5e86973b88e0342df53287c06 (patch) | |
tree | 7cb3c57cc4e77c911887a11373bda11fcd9d8113 /fs | |
parent | b57668d61af9aa688c059ee66131e43cb991a7df (diff) |
fanotify: reorder event on child checking for ease of readability
The check to return false if a parent did not request to receive events
about it's children happens in the middle of a big if statement which is
easier to read if we just do the check later. So move it.
Signed-off-by: Eric Paris <eparis@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/notify/fanotify/fanotify.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/fs/notify/fanotify/fanotify.c b/fs/notify/fanotify/fanotify.c index d53d4f516a65..c2ba86a972e1 100644 --- a/fs/notify/fanotify/fanotify.c +++ b/fs/notify/fanotify/fanotify.c @@ -184,13 +184,6 @@ static bool fanotify_should_send_event(struct fsnotify_group *group, marks_mask = (vfsmnt_mark->mask | inode_mark->mask); marks_ignored_mask = (vfsmnt_mark->ignored_mask | inode_mark->ignored_mask); } else if (inode_mark) { - /* - * if the event is for a child and this inode doesn't care about - * events on the child, don't send it! - */ - if ((event_mask & FS_EVENT_ON_CHILD) && - !(inode_mark->mask & FS_EVENT_ON_CHILD)) - return false; marks_mask = inode_mark->mask; marks_ignored_mask = inode_mark->ignored_mask; } else if (vfsmnt_mark) { @@ -205,6 +198,14 @@ static bool fanotify_should_send_event(struct fsnotify_group *group, return false; /* + * if the event is for a child and this inode doesn't care about + * events on the child, don't send it! + */ + if ((event_mask & FS_EVENT_ON_CHILD) && + !(marks_mask & FS_EVENT_ON_CHILD)) + return false; + + /* * It might seem logical to check: * if (event_mask & marks_mask & ~marks_ignored_mask) * return true; |