ceph: avoid unnecessary fscache invalidation/revlidation
authorYan, Zheng <zyan@redhat.com>
Fri, 20 May 2016 07:41:20 +0000 (15:41 +0800)
committerIlya Dryomov <idryomov@gmail.com>
Wed, 1 Jun 2016 08:30:41 +0000 (10:30 +0200)
ceph_fill_file_size() has already called ceph_fscache_invalidate()
if it return true.

Signed-off-by: Yan, Zheng <zyan@redhat.com>
fs/ceph/caps.c

index c17b5d76d75ee96515717ce29cc62971f80acca4..7bdf7d59a36da2b4814ee97b6e751c1b057352b3 100644 (file)
@@ -2993,10 +2993,9 @@ static void handle_cap_grant(struct ceph_mds_client *mdsc,
        if (fill_inline)
                ceph_fill_inline_data(inode, NULL, inline_data, inline_len);
 
-       if (queue_trunc) {
+       if (queue_trunc)
                ceph_queue_vmtruncate(inode);
-               ceph_queue_revalidate(inode);
-       } else if (queue_revalidate)
+       else if (queue_revalidate)
                ceph_queue_revalidate(inode);
 
        if (writeback)
@@ -3199,10 +3198,8 @@ static void handle_cap_trunc(struct inode *inode,
                                          truncate_seq, truncate_size, size);
        spin_unlock(&ci->i_ceph_lock);
 
-       if (queue_trunc) {
+       if (queue_trunc)
                ceph_queue_vmtruncate(inode);
-               ceph_fscache_invalidate(inode);
-       }
 }
 
 /*