From a027818b4d9383c54a0b3761840f7f0d2aeab699 Mon Sep 17 00:00:00 2001 From: Chris Mason Date: Fri, 3 Apr 2009 10:32:58 -0400 Subject: [PATCH] --- yaml --- r: 140324 b: refs/heads/master c: bedf762ba3a4b70295661fa70c29c1f18fe0f351 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/btrfs/volumes.c | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 52fd1809a405..9c9af1c8a5fe 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: b765ead57da62cccf7fa21e00e6eed65e9df62b0 +refs/heads/master: bedf762ba3a4b70295661fa70c29c1f18fe0f351 diff --git a/trunk/fs/btrfs/volumes.c b/trunk/fs/btrfs/volumes.c index cc01abff03d9..e0913e469728 100644 --- a/trunk/fs/btrfs/volumes.c +++ b/trunk/fs/btrfs/volumes.c @@ -148,7 +148,7 @@ static noinline int run_scheduled_bios(struct btrfs_device *device) unsigned long limit; unsigned long last_waited = 0; - bdi = device->bdev->bd_inode->i_mapping->backing_dev_info; + bdi = blk_get_backing_dev_info(device->bdev); fs_info = device->dev_root->fs_info; limit = btrfs_async_submit_limit(fs_info); limit = limit * 2 / 3; @@ -258,6 +258,18 @@ static noinline int run_scheduled_bios(struct btrfs_device *device) if (device->pending_bios) goto loop_lock; spin_unlock(&device->io_lock); + + /* + * IO has already been through a long path to get here. Checksumming, + * async helper threads, perhaps compression. We've done a pretty + * good job of collecting a batch of IO and should just unplug + * the device right away. + * + * This will help anyone who is waiting on the IO, they might have + * already unplugged, but managed to do so before the bio they + * cared about found its way down here. + */ + blk_run_backing_dev(bdi, NULL); done: return 0; }