]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging/lustre/llite: ll_revalidate_dentry update
authorOleg Drokin <oleg.drokin@intel.com>
Mon, 20 Jun 2016 20:55:46 +0000 (16:55 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 20 Jun 2016 21:28:39 +0000 (14:28 -0700)
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>
drivers/staging/lustre/lustre/llite/dcache.c

index d964f4f30baae211ef82d1900acfc7e8bfb6f3cf..581a63a0a63e57cf86d1b48cc61a31632b535a42 100644 (file)
@@ -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