Skip to content

Commit cb49f57

Browse files
committed
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable: Btrfs: do some plugging in the submit_bio threads
2 parents f727a93 + 211588a commit cb49f57

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

fs/btrfs/volumes.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,15 @@ static noinline int run_scheduled_bios(struct btrfs_device *device)
155155
unsigned long limit;
156156
unsigned long last_waited = 0;
157157
int force_reg = 0;
158+
struct blk_plug plug;
159+
160+
/*
161+
* this function runs all the bios we've collected for
162+
* a particular device. We don't want to wander off to
163+
* another device without first sending all of these down.
164+
* So, setup a plug here and finish it off before we return
165+
*/
166+
blk_start_plug(&plug);
158167

159168
bdi = blk_get_backing_dev_info(device->bdev);
160169
fs_info = device->dev_root->fs_info;
@@ -294,6 +303,7 @@ static noinline int run_scheduled_bios(struct btrfs_device *device)
294303
spin_unlock(&device->io_lock);
295304

296305
done:
306+
blk_finish_plug(&plug);
297307
return 0;
298308
}
299309

0 commit comments

Comments
 (0)