提交 6c71100d 编写于 作者: K Kinglong Mee 提交者: Jan Kara

fanotify: simplify the code of fanotify_merge

Signed-off-by: NKinglong Mee <kinglongmee@gmail.com>
Signed-off-by: NJan Kara <jack@suse.cz>
上级 a074faad
......@@ -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);
......@@ -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;
}
#ifdef CONFIG_FANOTIFY_ACCESS_PERMISSIONS
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册