summaryrefslogtreecommitdiffstats
path: root/fs/afs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2018-06-24 10:45:44 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2018-08-05 15:50:59 -0400
commit1401a0fc2d47988677dc1dbfd56ff89daa323717 (patch)
tree8d8875d124057a28eabe0b2118013164de1d2b57 /fs/afs
parent34b2a88fb4aa4de34e1d5f9fc2761b746980f9b1 (diff)
downloadlinux-1401a0fc2d47988677dc1dbfd56ff89daa323717.tar.bz2
afs_try_auto_mntpt(): return NULL instead of ERR_PTR(-ENOENT)
simpler logics in callers that way Acked-by: David Howells <dhowells@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/afs')
-rw-r--r--fs/afs/dir.c2
-rw-r--r--fs/afs/dynroot.c13
2 files changed, 2 insertions, 13 deletions
diff --git a/fs/afs/dir.c b/fs/afs/dir.c
index 52f44255f65d..855bf2b79fed 100644
--- a/fs/afs/dir.c
+++ b/fs/afs/dir.c
@@ -866,8 +866,6 @@ static struct dentry *afs_lookup(struct inode *dir, struct dentry *dentry,
key_put(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..1cde710a8013 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);
}
/*
@@ -141,11 +141,6 @@ out_p:
static struct dentry *afs_dynroot_lookup(struct inode *dir, struct dentry *dentry,
unsigned int flags)
{
- struct afs_vnode *vnode;
- struct inode *inode;
-
- vnode = AFS_FS_I(dir);
-
_enter("%pd", dentry);
ASSERTCMP(d_inode(dentry), ==, NULL);
@@ -159,11 +154,7 @@ static struct dentry *afs_dynroot_lookup(struct inode *dir, struct dentry *dentr
memcmp(dentry->d_name.name, "@cell", 5) == 0)
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);
+ return d_splice_alias(afs_try_auto_mntpt(dentry, dir), dentry);
}
const struct inode_operations afs_dynroot_inode_operations = {