Return-Path: From: Al Viro To: linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH 4/5] afs_try_auto_mntpt(): return NULL instead of ERR_PTR(-ENOENT) Date: Fri, 3 Aug 2018 17:51:14 +0100 Message-Id: <20180803165115.21094-5-viro@ZenIV.linux.org.uk> In-Reply-To: <20180803165115.21094-1-viro@ZenIV.linux.org.uk> References: <20180803165115.21094-1-viro@ZenIV.linux.org.uk> Sender: linux-kernel-owner@vger.kernel.org List-ID: From: Al Viro simpler logics in callers that way Signed-off-by: Al Viro --- fs/afs/dir.c | 2 -- fs/afs/dynroot.c | 5 +---- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/fs/afs/dir.c b/fs/afs/dir.c index 3099349cedfa..ff6738787fcd 100644 --- a/fs/afs/dir.c +++ b/fs/afs/dir.c @@ -865,8 +865,6 @@ static struct dentry *afs_lookup(struct inode *dir, struct dentry *dentry, inode = afs_do_lookup(dir, dentry, key); if (inode == ERR_PTR(-ENOENT)) { inode = afs_try_auto_mntpt(dentry, dir); - if (inode == ERR_PTR(-ENOENT)) - inode = NULL; } else { dentry->d_fsdata = (void *)(unsigned long)dvnode->status.data_version; diff --git a/fs/afs/dynroot.c b/fs/afs/dynroot.c index 40fea59067b3..1e27a0171357 100644 --- a/fs/afs/dynroot.c +++ b/fs/afs/dynroot.c @@ -83,7 +83,7 @@ struct inode *afs_try_auto_mntpt(struct dentry *dentry, struct inode *dir) out: _leave("= %d", ret); - return ERR_PTR(ret); + return ret == -ENOENT ? NULL : ERR_PTR(ret); } /* @@ -160,9 +160,6 @@ static struct dentry *afs_dynroot_lookup(struct inode *dir, struct dentry *dentr return afs_lookup_atcell(dentry); inode = afs_try_auto_mntpt(dentry, dir); - if (inode == ERR_PTR(-ENOENT)) - inode = NULL; - return d_splice_alias(inode, dentry); } -- 2.11.0