OSDN Git Service

btrfs: account as waiting for IO, while waiting fot the flush bio completion
authorDavid Sterba <dsterba@suse.com>
Thu, 15 Jun 2017 14:04:26 +0000 (16:04 +0200)
committerDavid Sterba <dsterba@suse.com>
Wed, 21 Jun 2017 17:03:39 +0000 (19:03 +0200)
Similar to what submit_bio_wait does, we should account for IO while
waiting for a bio completion. This has marginal visible effects, flush
bio is short-lived.

Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/disk-io.c

index bfcbab3..917e291 100644 (file)
@@ -3519,7 +3519,7 @@ static int wait_dev_flush(struct btrfs_device *device)
                return 0;
 
        device->flush_bio_sent = 0;
-       wait_for_completion(&device->flush_wait);
+       wait_for_completion_io(&device->flush_wait);
 
        if (bio->bi_error) {
                ret = bio->bi_error;