From: Jan Kara Subject: [PATCH 3/6] fanotify: Remove useless test from event initialization Date: Thu, 30 Jan 2014 15:41:05 +0100 Message-ID: <1391092868-20029-4-git-send-email-jack@suse.cz> References: <1391092868-20029-1-git-send-email-jack@suse.cz> Cc: linux-fsdevel@vger.kernel.org, Eric Paris , Jan Kara To: Andrew Morton Return-path: Received: from cantor2.suse.de ([195.135.220.15]:52612 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752750AbaA3OlW (ORCPT ); Thu, 30 Jan 2014 09:41:22 -0500 In-Reply-To: <1391092868-20029-1-git-send-email-jack@suse.cz> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Fanotify processes only path events (fanotify_should_send_event() refuses any other event) so checking whether event is a path event during initialization makes no sense. Signed-off-by: Jan Kara --- fs/notify/fanotify/fanotify.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/fs/notify/fanotify/fanotify.c b/fs/notify/fanotify/fanotify.c index 6c5369f0f78c..3c40f9685453 100644 --- a/fs/notify/fanotify/fanotify.c +++ b/fs/notify/fanotify/fanotify.c @@ -166,13 +166,8 @@ static struct fanotify_event_info *alloc_event(struct inode *inode, u32 mask, init: __maybe_unused fsnotify_init_event(&event->fse, inode, mask); event->tgid = get_pid(task_tgid(current)); - if (data_type == FSNOTIFY_EVENT_PATH) { - event->path = *path; - path_get(&event->path); - } else { - event->path.mnt = NULL; - event->path.dentry = NULL; - } + event->path = *path; + path_get(&event->path); return event; } -- 1.8.1.4