lkml.org 
[lkml]   [2018]   [Aug]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 4/5] afs_try_auto_mntpt(): return NULL instead of ERR_PTR(-ENOENT)
Date
From: Al Viro <viro@zeniv.linux.org.uk>

simpler logics in callers that way

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
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
\
 
 \ /
  Last update: 2018-08-03 18:52    [W:0.038 / U:0.168 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site