summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleg Drokin <oleg.drokin@intel.com>2016-06-20 16:55:46 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-06-20 14:28:39 -0700
commitaae5d55a24f74d429f32895cf73b9839d0d5e6e1 (patch)
tree5933f782a31a1ff08df7d614ec8adf4db5e3b111
parent6dad4d8903a43b0e34d9527e54a52737b0f69690 (diff)
downloadlinux-aae5d55a24f74d429f32895cf73b9839d0d5e6e1.tar.bz2
staging/lustre/llite: ll_revalidate_dentry update
There are a couple of cases in ll_revalidate_dentry() where we are pretty sure the dentry is valid, so check for them early and save more expensive checks for later. Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/lustre/lustre/llite/dcache.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/staging/lustre/lustre/llite/dcache.c b/drivers/staging/lustre/lustre/llite/dcache.c
index d964f4f30baa..581a63a0a63e 100644
--- a/drivers/staging/lustre/lustre/llite/dcache.c
+++ b/drivers/staging/lustre/lustre/llite/dcache.c
@@ -302,6 +302,17 @@ static int ll_revalidate_dentry(struct dentry *dentry,
{
struct inode *dir = d_inode(dentry->d_parent);
+ /* If this is intermediate component path lookup and we were able to get
+ * to this dentry, then its lock has not been revoked and the
+ * path component is valid.
+ */
+ if (lookup_flags & LOOKUP_PARENT)
+ return 1;
+
+ /* Symlink - always valid as long as the dentry was found */
+ if (dentry->d_inode && S_ISLNK(dentry->d_inode->i_mode))
+ return 1;
+
/*
* if open&create is set, talk to MDS to make sure file is created if
* necessary, because we can't do this in ->open() later since that's