Skip to content

Commit

Permalink
fanotify: simplify the code of fanotify_merge
Browse files Browse the repository at this point in the history
Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
  • Loading branch information
Kinglong Mee authored and Jan Kara committed Feb 9, 2017
1 parent a074faa commit 6c71100
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions fs/notify/fanotify/fanotify.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ static bool should_merge(struct fsnotify_event *old_fsn,
static int fanotify_merge(struct list_head *list, struct fsnotify_event *event)
{
struct fsnotify_event *test_event;
bool do_merge = false;

pr_debug("%s: list=%p event=%p\n", __func__, list, event);

Expand All @@ -47,16 +46,12 @@ static int fanotify_merge(struct list_head *list, struct fsnotify_event *event)

list_for_each_entry_reverse(test_event, list, list) {
if (should_merge(test_event, event)) {
do_merge = true;
break;
test_event->mask |= event->mask;
return 1;
}
}

if (!do_merge)
return 0;

test_event->mask |= event->mask;
return 1;
return 0;
}

#ifdef CONFIG_FANOTIFY_ACCESS_PERMISSIONS
Expand Down

0 comments on commit 6c71100

Please sign in to comment.