From mboxrd@z Thu Jan 1 00:00:00 1970 From: NeilBrown Subject: [PATCH 08/10] VFS: tiny optimisation in open_other handling. Date: Mon, 06 Sep 2010 10:50:29 +1000 Message-ID: <20100906005029.20775.19530.stgit@localhost.localdomain> References: <20100906004829.20775.68828.stgit@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org To: Miklos Szeredi Return-path: In-Reply-To: <20100906004829.20775.68828.stgit@localhost.localdomain> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org If IS_ERR(ret), then ret != NULL, so if we are performing the second test we don't need the first. Signed-off-by: NeilBrown --- fs/open.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/open.c b/fs/open.c index 89e4f34..b986ca1 100644 --- a/fs/open.c +++ b/fs/open.c @@ -687,7 +687,7 @@ static struct file *__dentry_open(struct dentry *dentry, struct vfsmount *mnt, if (!open && f->f_op && f->f_op->open_other) { /* NULL means keep f, non-error non-null means replace */ ret = f->f_op->open_other(f); - if (IS_ERR(ret) || ret != NULL) + if (ret) goto cleanup_all; } else { if (!open && f->f_op)