diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2007-10-02 12:54:39 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2007-10-09 17:19:58 -0400 |
commit | f2c77f4e62a2290ae46b5b0449eb72d72afe691e (patch) | |
tree | f0b68a5be10fdebf477c3b5af1dbdce3a6150301 /fs/nfs/dir.c | |
parent | 6d2b2966869142660f46d1e06cf9d15c3debcf77 (diff) |
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 <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/dir.c')
-rw-r--r-- | 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 34da48586829..cf80cf234e27 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) | |||
646 | { | 646 | { |
647 | if (IS_ROOT(dentry)) | 647 | if (IS_ROOT(dentry)) |
648 | return 1; | 648 | return 1; |
649 | if (nfs_verify_change_attribute(dir, dentry->d_time)) | 649 | if (!nfs_verify_change_attribute(dir, dentry->d_time)) |
650 | return 1; | 650 | return 0; |
651 | return 0; | 651 | /* Revalidate nfsi->cache_change_attribute before we declare a match */ |
652 | if (nfs_revalidate_inode(NFS_SERVER(dir), dir) < 0) | ||
653 | return 0; | ||
654 | if (!nfs_verify_change_attribute(dir, dentry->d_time)) | ||
655 | return 0; | ||
656 | return 1; | ||
652 | } | 657 | } |
653 | 658 | ||
654 | static inline void nfs_set_verifier(struct dentry * dentry, unsigned long verf) | 659 | 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) | |||
742 | nfs_inc_stats(dir, NFSIOS_DENTRYREVALIDATE); | 747 | nfs_inc_stats(dir, NFSIOS_DENTRYREVALIDATE); |
743 | inode = dentry->d_inode; | 748 | inode = dentry->d_inode; |
744 | 749 | ||
745 | /* Revalidate parent directory attribute cache */ | ||
746 | if (nfs_revalidate_inode(NFS_SERVER(dir), dir) < 0) | ||
747 | goto out_zap_parent; | ||
748 | |||
749 | if (!inode) { | 750 | if (!inode) { |
750 | if (nfs_neg_need_reval(dir, dentry, nd)) | 751 | if (nfs_neg_need_reval(dir, dentry, nd)) |
751 | goto out_bad; | 752 | goto out_bad; |