diff options
author | Eric Paris <eparis@redhat.com> | 2010-11-09 11:48:30 -0500 |
---|---|---|
committer | Eric Paris <eparis@redhat.com> | 2010-11-29 14:51:25 -0500 |
commit | 9cb68f37a7754ddcb282d1c2ca3451f6dc4a56f7 (patch) | |
tree | 2345cdcb3792eec3c2d8efc1241a8824d42269c5 /fs | |
parent | 67e1a98b2251ed9de8f332524cb020f7ad257cc2 (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; |