ceph: avoid meaningless calling ceph_caps_revoking if sync_mode == WB_SYNC_ALL.
authormajianpeng <majianpeng@gmail.com>
Wed, 19 Jun 2013 07:12:06 +0000 (15:12 +0800)
committerSage Weil <sage@inktank.com>
Wed, 3 Jul 2013 22:32:52 +0000 (15:32 -0700)
Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
Reviewed-by: Sage Weil <sage@inktank.com>
fs/ceph/addr.c

index 3500b74..afb2fc2 100644 (file)
@@ -666,8 +666,8 @@ static int ceph_writepages_start(struct address_space *mapping,
         * integrity write (e.g., O_SYNC write or fsync()), or if our
         * cap is being revoked.
         */
-       do_sync = wbc->sync_mode == WB_SYNC_ALL;
-       if (ceph_caps_revoking(ci, CEPH_CAP_FILE_BUFFER))
+       if ((wbc->sync_mode == WB_SYNC_ALL) ||
+               ceph_caps_revoking(ci, CEPH_CAP_FILE_BUFFER))
                do_sync = 1;
        dout("writepages_start %p dosync=%d (mode=%s)\n",
             inode, do_sync,