]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Btrfs: do some plugging in the submit_bio threads
authorChris Mason <chris.mason@oracle.com>
Wed, 20 Apr 2011 00:12:40 +0000 (20:12 -0400)
committerChris Mason <chris.mason@oracle.com>
Wed, 20 Apr 2011 00:12:40 +0000 (20:12 -0400)
The Btrfs submit bio threads have a small number of
threads responsible for pushing down bios we've collected
for a large number of devices.

Since we do all the bios for a single device at once,
we want to make sure we unplug and send down the bios
for each device as we're done processing them.

The new plugging API removed the btrfs code to
unplug while processing bios, this adds it back with
the new API.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/volumes.c

index 309a57b9fc85e3a6f09809da14d0cd9e1df55fb5..c7367ae5a3e6d9427add05ebf8a594ae92e81d5b 100644 (file)
@@ -155,6 +155,15 @@ static noinline int run_scheduled_bios(struct btrfs_device *device)
        unsigned long limit;
        unsigned long last_waited = 0;
        int force_reg = 0;
+       struct blk_plug plug;
+
+       /*
+        * this function runs all the bios we've collected for
+        * a particular device.  We don't want to wander off to
+        * another device without first sending all of these down.
+        * So, setup a plug here and finish it off before we return
+        */
+       blk_start_plug(&plug);
 
        bdi = blk_get_backing_dev_info(device->bdev);
        fs_info = device->dev_root->fs_info;
@@ -294,6 +303,7 @@ loop_lock:
        spin_unlock(&device->io_lock);
 
 done:
+       blk_finish_plug(&plug);
        return 0;
 }