Btrfs: wait for the ordered extent only when we want
authorMiao Xie <miaox@cn.fujitsu.com>
Mon, 4 Nov 2013 15:13:21 +0000 (23:13 +0800)
committerChris Mason <chris.mason@fusionio.com>
Tue, 12 Nov 2013 03:13:15 +0000 (22:13 -0500)
Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
fs/btrfs/extent-tree.c

index 5e0e6bcf67b98b89b9d95b96c7a85baccbf9d42e..2564cbfdf417bf8028baa0f09be33a33678f1d28 100644 (file)
@@ -4047,7 +4047,8 @@ static void shrink_delalloc(struct btrfs_root *root, u64 to_reclaim, u64 orig,
        if (delalloc_bytes == 0) {
                if (trans)
                        return;
-               btrfs_wait_all_ordered_extents(root->fs_info);
+               if (wait_ordered)
+                       btrfs_wait_all_ordered_extents(root->fs_info);
                return;
        }