diff options
author | Mikulas Patocka <mpatocka@redhat.com> | 2009-06-22 10:12:21 +0100 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2009-06-22 10:12:21 +0100 |
commit | 52b1fd5a27c625c78373e024bf570af3c9d44a79 (patch) | |
tree | a802b917b45685255220efaeb7b2b8ee2d04a2d4 /drivers/md | |
parent | 9015df24a8008d7bea2bd3df881783ebe0dcb9af (diff) | |
download | blackbird-op-linux-52b1fd5a27c625c78373e024bf570af3c9d44a79.tar.gz blackbird-op-linux-52b1fd5a27c625c78373e024bf570af3c9d44a79.zip |
dm: send empty barriers to targets in dm_flush
Pass empty barrier flushes to the targets in dm_flush().
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/dm.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c index edf9f2467691..36142e947ffc 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -164,6 +164,9 @@ struct mapped_device { /* sysfs handle */ struct kobject kobj; + + /* zero-length barrier that will be cloned and submitted to targets */ + struct bio barrier_bio; }; #define MIN_IOS 256 @@ -1477,6 +1480,13 @@ static int dm_wait_for_completion(struct mapped_device *md, int interruptible) static void dm_flush(struct mapped_device *md) { dm_wait_for_completion(md, TASK_UNINTERRUPTIBLE); + + bio_init(&md->barrier_bio); + md->barrier_bio.bi_bdev = md->bdev; + md->barrier_bio.bi_rw = WRITE_BARRIER; + __split_and_process_bio(md, &md->barrier_bio); + + dm_wait_for_completion(md, TASK_UNINTERRUPTIBLE); } static void process_barrier(struct mapped_device *md, struct bio *bio) |