Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f2c77f4e62a2290ae46b5b0449eb72d72afe691e
Commit:     f2c77f4e62a2290ae46b5b0449eb72d72afe691e
Parent:     6d2b2966869142660f46d1e06cf9d15c3debcf77
Author:     Trond Myklebust <[EMAIL PROTECTED]>
AuthorDate: Tue Oct 2 12:54:39 2007 -0400
Committer:  Trond Myklebust <[EMAIL PROTECTED]>
CommitDate: Tue Oct 9 17:19:58 2007 -0400

    NFS: Optimise nfs_lookup_revalidate()
    
    We don't need to call nfs_revalidate_inode() on the directory if we already
    know that the verifiers don't match.
    
    Signed-off-by: Trond Myklebust <[EMAIL PROTECTED]>
---
 fs/nfs/dir.c |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index 34da485..cf80cf2 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -646,9 +646,14 @@ static int nfs_check_verifier(struct inode *dir, struct 
dentry *dentry)
 {
        if (IS_ROOT(dentry))
                return 1;
-       if (nfs_verify_change_attribute(dir, dentry->d_time))
-               return 1;
-       return 0;
+       if (!nfs_verify_change_attribute(dir, dentry->d_time))
+               return 0;
+       /* Revalidate nfsi->cache_change_attribute before we declare a match */
+       if (nfs_revalidate_inode(NFS_SERVER(dir), dir) < 0)
+               return 0;
+       if (!nfs_verify_change_attribute(dir, dentry->d_time))
+               return 0;
+       return 1;
 }
 
 static inline void nfs_set_verifier(struct dentry * dentry, unsigned long verf)
@@ -742,10 +747,6 @@ static int nfs_lookup_revalidate(struct dentry * dentry, 
struct nameidata *nd)
        nfs_inc_stats(dir, NFSIOS_DENTRYREVALIDATE);
        inode = dentry->d_inode;
 
-       /* Revalidate parent directory attribute cache */
-       if (nfs_revalidate_inode(NFS_SERVER(dir), dir) < 0)
-               goto out_zap_parent;
-
        if (!inode) {
                if (nfs_neg_need_reval(dir, dentry, nd))
                        goto out_bad;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to