diff options
Diffstat (limited to 'fs/btrfs/volumes.c')
-rw-r--r-- | fs/btrfs/volumes.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index cc01abff03d9..e0913e469728 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c | |||
@@ -148,7 +148,7 @@ static noinline int run_scheduled_bios(struct btrfs_device *device) | |||
148 | unsigned long limit; | 148 | unsigned long limit; |
149 | unsigned long last_waited = 0; | 149 | unsigned long last_waited = 0; |
150 | 150 | ||
151 | bdi = device->bdev->bd_inode->i_mapping->backing_dev_info; | 151 | bdi = blk_get_backing_dev_info(device->bdev); |
152 | fs_info = device->dev_root->fs_info; | 152 | fs_info = device->dev_root->fs_info; |
153 | limit = btrfs_async_submit_limit(fs_info); | 153 | limit = btrfs_async_submit_limit(fs_info); |
154 | limit = limit * 2 / 3; | 154 | limit = limit * 2 / 3; |
@@ -258,6 +258,18 @@ loop_lock: | |||
258 | if (device->pending_bios) | 258 | if (device->pending_bios) |
259 | goto loop_lock; | 259 | goto loop_lock; |
260 | spin_unlock(&device->io_lock); | 260 | spin_unlock(&device->io_lock); |
261 | |||
262 | /* | ||
263 | * IO has already been through a long path to get here. Checksumming, | ||
264 | * async helper threads, perhaps compression. We've done a pretty | ||
265 | * good job of collecting a batch of IO and should just unplug | ||
266 | * the device right away. | ||
267 | * | ||
268 | * This will help anyone who is waiting on the IO, they might have | ||
269 | * already unplugged, but managed to do so before the bio they | ||
270 | * cared about found its way down here. | ||
271 | */ | ||
272 | blk_run_backing_dev(bdi, NULL); | ||
261 | done: | 273 | done: |
262 | return 0; | 274 | return 0; |
263 | } | 275 | } |