mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 22:02:02 +00:00
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>
This commit is contained in:
parent
34b2a88fb4
commit
1401a0fc2d
2 changed files with 2 additions and 13 deletions
|
@ -866,8 +866,6 @@ static struct dentry *afs_lookup(struct inode *dir, struct dentry *dentry,
|
||||||
key_put(key);
|
key_put(key);
|
||||||
if (inode == ERR_PTR(-ENOENT)) {
|
if (inode == ERR_PTR(-ENOENT)) {
|
||||||
inode = afs_try_auto_mntpt(dentry, dir);
|
inode = afs_try_auto_mntpt(dentry, dir);
|
||||||
if (inode == ERR_PTR(-ENOENT))
|
|
||||||
inode = NULL;
|
|
||||||
} else {
|
} else {
|
||||||
dentry->d_fsdata =
|
dentry->d_fsdata =
|
||||||
(void *)(unsigned long)dvnode->status.data_version;
|
(void *)(unsigned long)dvnode->status.data_version;
|
||||||
|
|
|
@ -83,7 +83,7 @@ struct inode *afs_try_auto_mntpt(struct dentry *dentry, struct inode *dir)
|
||||||
|
|
||||||
out:
|
out:
|
||||||
_leave("= %d", ret);
|
_leave("= %d", ret);
|
||||||
return ERR_PTR(ret);
|
return ret == -ENOENT ? NULL : ERR_PTR(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -141,11 +141,6 @@ static struct dentry *afs_lookup_atcell(struct dentry *dentry)
|
||||||
static struct dentry *afs_dynroot_lookup(struct inode *dir, struct dentry *dentry,
|
static struct dentry *afs_dynroot_lookup(struct inode *dir, struct dentry *dentry,
|
||||||
unsigned int flags)
|
unsigned int flags)
|
||||||
{
|
{
|
||||||
struct afs_vnode *vnode;
|
|
||||||
struct inode *inode;
|
|
||||||
|
|
||||||
vnode = AFS_FS_I(dir);
|
|
||||||
|
|
||||||
_enter("%pd", dentry);
|
_enter("%pd", dentry);
|
||||||
|
|
||||||
ASSERTCMP(d_inode(dentry), ==, NULL);
|
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)
|
memcmp(dentry->d_name.name, "@cell", 5) == 0)
|
||||||
return afs_lookup_atcell(dentry);
|
return afs_lookup_atcell(dentry);
|
||||||
|
|
||||||
inode = afs_try_auto_mntpt(dentry, dir);
|
return d_splice_alias(afs_try_auto_mntpt(dentry, dir), dentry);
|
||||||
if (inode == ERR_PTR(-ENOENT))
|
|
||||||
inode = NULL;
|
|
||||||
|
|
||||||
return d_splice_alias(inode, dentry);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const struct inode_operations afs_dynroot_inode_operations = {
|
const struct inode_operations afs_dynroot_inode_operations = {
|
||||||
|
|
Loading…
Reference in a new issue