aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/dev-replace.c
diff options
context:
space:
mode:
authorMiao Xie <miaox@cn.fujitsu.com>2013-11-04 10:13:25 -0500
committerChris Mason <chris.mason@fusionio.com>2013-11-11 22:13:44 -0500
commitb02441999efcc6152b87cd58e7970bb7843f76cf (patch)
tree36f8e823f3ee84528f3f030323b472a72a915094 /fs/btrfs/dev-replace.c
parent9f3a074d108810139ad4af49a29d347a4cf41e9a (diff)
Btrfs: don't wait for the completion of all the ordered extents
It is very likely that there are lots of ordered extents in the filesytem, if we wait for the completion of all of them when we want to reclaim some space for the metadata space reservation, we would be blocked for a long time. The performance would drop down suddenly for a long time. 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>
Diffstat (limited to 'fs/btrfs/dev-replace.c')
-rw-r--r--fs/btrfs/dev-replace.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/dev-replace.c b/fs/btrfs/dev-replace.c
index cb94310db072..3d2495e83e62 100644
--- a/fs/btrfs/dev-replace.c
+++ b/fs/btrfs/dev-replace.c
@@ -391,7 +391,7 @@ int btrfs_dev_replace_start(struct btrfs_root *root,
391 args->result = BTRFS_IOCTL_DEV_REPLACE_RESULT_NO_ERROR; 391 args->result = BTRFS_IOCTL_DEV_REPLACE_RESULT_NO_ERROR;
392 btrfs_dev_replace_unlock(dev_replace); 392 btrfs_dev_replace_unlock(dev_replace);
393 393
394 btrfs_wait_all_ordered_extents(root->fs_info); 394 btrfs_wait_ordered_roots(root->fs_info, -1);
395 395
396 /* force writing the updated state information to disk */ 396 /* force writing the updated state information to disk */
397 trans = btrfs_start_transaction(root, 0); 397 trans = btrfs_start_transaction(root, 0);
@@ -466,7 +466,7 @@ static int btrfs_dev_replace_finishing(struct btrfs_fs_info *fs_info,
466 mutex_unlock(&dev_replace->lock_finishing_cancel_unmount); 466 mutex_unlock(&dev_replace->lock_finishing_cancel_unmount);
467 return ret; 467 return ret;
468 } 468 }
469 btrfs_wait_all_ordered_extents(root->fs_info); 469 btrfs_wait_ordered_roots(root->fs_info, -1);
470 470
471 trans = btrfs_start_transaction(root, 0); 471 trans = btrfs_start_transaction(root, 0);
472 if (IS_ERR(trans)) { 472 if (IS_ERR(trans)) {