aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/disk-io.c8
-rw-r--r--fs/btrfs/volumes.c6
2 files changed, 7 insertions, 7 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index bbba14b629d2..6a218f792e59 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -487,9 +487,15 @@ int btrfs_wq_submit_bio(struct btrfs_fs_info *fs_info, struct inode *inode,
487 atomic_inc(&fs_info->nr_async_submits); 487 atomic_inc(&fs_info->nr_async_submits);
488 btrfs_queue_worker(&fs_info->workers, &async->work); 488 btrfs_queue_worker(&fs_info->workers, &async->work);
489 489
490 wait_event_timeout(fs_info->async_submit_wait, 490 if (atomic_read(&fs_info->nr_async_submits) > limit) {
491 wait_event_timeout(fs_info->async_submit_wait,
491 (atomic_read(&fs_info->nr_async_submits) < limit), 492 (atomic_read(&fs_info->nr_async_submits) < limit),
492 HZ/10); 493 HZ/10);
494
495 wait_event_timeout(fs_info->async_submit_wait,
496 (atomic_read(&fs_info->nr_async_bios) < limit),
497 HZ/10);
498 }
493 return 0; 499 return 0;
494} 500}
495 501
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 2652660e6079..5b1b60839d21 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -2145,7 +2145,6 @@ int schedule_bio(struct btrfs_root *root, struct btrfs_device *device,
2145 int rw, struct bio *bio) 2145 int rw, struct bio *bio)
2146{ 2146{
2147 int should_queue = 1; 2147 int should_queue = 1;
2148 unsigned long limit;
2149 2148
2150 /* don't bother with additional async steps for reads, right now */ 2149 /* don't bother with additional async steps for reads, right now */
2151 if (!(rw & (1 << BIO_RW))) { 2150 if (!(rw & (1 << BIO_RW))) {
@@ -2182,11 +2181,6 @@ int schedule_bio(struct btrfs_root *root, struct btrfs_device *device,
2182 if (should_queue) 2181 if (should_queue)
2183 btrfs_queue_worker(&root->fs_info->submit_workers, 2182 btrfs_queue_worker(&root->fs_info->submit_workers,
2184 &device->work); 2183 &device->work);
2185
2186 limit = btrfs_async_submit_limit(root->fs_info);
2187 wait_event_timeout(root->fs_info->async_submit_wait,
2188 (atomic_read(&root->fs_info->nr_async_bios) < limit),
2189 HZ/10);
2190 return 0; 2184 return 0;
2191} 2185}
2192 2186