From patchwork Fri Jan 6 10:43:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kara X-Patchwork-Id: 9500547 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 93C17606B4 for ; Fri, 6 Jan 2017 10:47:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9382428473 for ; Fri, 6 Jan 2017 10:47:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 881D92847C; Fri, 6 Jan 2017 10:47:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1D2BA28473 for ; Fri, 6 Jan 2017 10:47:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754800AbdAFKoP (ORCPT ); Fri, 6 Jan 2017 05:44:15 -0500 Received: from mx2.suse.de ([195.135.220.15]:39660 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936745AbdAFKoJ (ORCPT ); Fri, 6 Jan 2017 05:44:09 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id D4EB8AC0D; Fri, 6 Jan 2017 10:44:07 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 4C7F41E0542; Fri, 6 Jan 2017 11:44:06 +0100 (CET) From: Jan Kara To: linux-fsdevel@vger.kernel.org Cc: Amir Goldstein , Paul Moore , Miklos Szeredi , Jan Kara Subject: [PATCH 01/22] fsnotify: Remove unnecessary tests when showing fdinfo Date: Fri, 6 Jan 2017 11:43:40 +0100 Message-Id: <20170106104401.5894-2-jack@suse.cz> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20170106104401.5894-1-jack@suse.cz> References: <20170106104401.5894-1-jack@suse.cz> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP show_fdinfo() iterates group's list of marks. All marks found there are guaranteed to be alive and they stay so until we release group->mark_mutex. So remove uncecessary tests whether mark is alive. Reviewed-by: Amir Goldstein Signed-off-by: Jan Kara --- fs/notify/fdinfo.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/fs/notify/fdinfo.c b/fs/notify/fdinfo.c index fd98e5100cab..601a59c8d87e 100644 --- a/fs/notify/fdinfo.c +++ b/fs/notify/fdinfo.c @@ -76,8 +76,7 @@ static void inotify_fdinfo(struct seq_file *m, struct fsnotify_mark *mark) struct inotify_inode_mark *inode_mark; struct inode *inode; - if (!(mark->flags & FSNOTIFY_MARK_FLAG_ALIVE) || - !(mark->flags & FSNOTIFY_MARK_FLAG_INODE)) + if (!(mark->flags & FSNOTIFY_MARK_FLAG_INODE)) return; inode_mark = container_of(mark, struct inotify_inode_mark, fsn_mark); @@ -113,9 +112,6 @@ static void fanotify_fdinfo(struct seq_file *m, struct fsnotify_mark *mark) unsigned int mflags = 0; struct inode *inode; - if (!(mark->flags & FSNOTIFY_MARK_FLAG_ALIVE)) - return; - if (mark->flags & FSNOTIFY_MARK_FLAG_IGNORED_SURV_MODIFY) mflags |= FAN_MARK_IGNORED_SURV_MODIFY;