NFS: do_setlk(): don't flush caches when we have a delegation
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Tue, 10 Jun 2008 22:31:02 +0000 (18:31 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Wed, 9 Jul 2008 16:08:50 +0000 (12:08 -0400)
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/file.c

index 7ac89a8..0213c21 100644 (file)
@@ -602,7 +602,8 @@ static int do_setlk(struct file *filp, int cmd, struct file_lock *fl)
         * This makes locking act as a cache coherency point.
         */
        nfs_sync_mapping(filp->f_mapping);
-       nfs_zap_caches(inode);
+       if (!nfs_have_delegation(inode, FMODE_READ))
+               nfs_zap_caches(inode);
 out:
        return status;
 }