summaryrefslogtreecommitdiffstats
path: root/fs/namei.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2011-06-20 10:55:26 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2011-07-20 01:43:34 -0400
commitd2d9e9fbc2f8f492dae373482da61d34475c53c1 (patch)
tree5d881318daae1c85d9544d18500eca4d175e76e7 /fs/namei.c
parent4ad5abb3d01a2c10854969b00982fadb130784a6 (diff)
downloadop-kernel-dev-d2d9e9fbc2f8f492dae373482da61d34475c53c1.zip
op-kernel-dev-d2d9e9fbc2f8f492dae373482da61d34475c53c1.tar.gz
merge do_revalidate() into its only caller
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namei.c')
-rw-r--r--fs/namei.c42
1 files changed, 18 insertions, 24 deletions
diff --git a/fs/namei.c b/fs/namei.c
index b3c1a97..42ccb97 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -436,28 +436,6 @@ static inline int d_revalidate(struct dentry *dentry, struct nameidata *nd)
return dentry->d_op->d_revalidate(dentry, nd);
}
-static struct dentry *
-do_revalidate(struct dentry *dentry, struct nameidata *nd)
-{
- int status = d_revalidate(dentry, nd);
- if (unlikely(status <= 0)) {
- /*
- * The dentry failed validation.
- * If d_revalidate returned 0 attempt to invalidate
- * the dentry otherwise d_revalidate is asking us
- * to return a fail status.
- */
- if (status < 0) {
- dput(dentry);
- dentry = ERR_PTR(status);
- } else if (!d_invalidate(dentry)) {
- dput(dentry);
- dentry = NULL;
- }
- }
- return dentry;
-}
-
/**
* complete_walk - successful completion of path walk
* @nd: pointer nameidata
@@ -1642,8 +1620,24 @@ static struct dentry *__lookup_hash(struct qstr *name,
return dentry;
}
- if (dentry && (dentry->d_flags & DCACHE_OP_REVALIDATE))
- dentry = do_revalidate(dentry, nd);
+ if (dentry && (dentry->d_flags & DCACHE_OP_REVALIDATE)) {
+ int status = d_revalidate(dentry, nd);
+ if (unlikely(status <= 0)) {
+ /*
+ * The dentry failed validation.
+ * If d_revalidate returned 0 attempt to invalidate
+ * the dentry otherwise d_revalidate is asking us
+ * to return a fail status.
+ */
+ if (status < 0) {
+ dput(dentry);
+ return ERR_PTR(status);
+ } else if (!d_invalidate(dentry)) {
+ dput(dentry);
+ dentry = NULL;
+ }
+ }
+ }
if (!dentry)
dentry = d_alloc_and_lookup(base, name, nd);
OpenPOWER on IntegriCloud