aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/dm.c')
-rw-r--r--drivers/md/dm.c10
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 {
164 164
165 /* sysfs handle */ 165 /* sysfs handle */
166 struct kobject kobj; 166 struct kobject kobj;
167
168 /* zero-length barrier that will be cloned and submitted to targets */
169 struct bio barrier_bio;
167}; 170};
168 171
169#define MIN_IOS 256 172#define MIN_IOS 256
@@ -1477,6 +1480,13 @@ static int dm_wait_for_completion(struct mapped_device *md, int interruptible)
1477static void dm_flush(struct mapped_device *md) 1480static void dm_flush(struct mapped_device *md)
1478{ 1481{
1479 dm_wait_for_completion(md, TASK_UNINTERRUPTIBLE); 1482 dm_wait_for_completion(md, TASK_UNINTERRUPTIBLE);
1483
1484 bio_init(&md->barrier_bio);
1485 md->barrier_bio.bi_bdev = md->bdev;
1486 md->barrier_bio.bi_rw = WRITE_BARRIER;
1487 __split_and_process_bio(md, &md->barrier_bio);
1488
1489 dm_wait_for_completion(md, TASK_UNINTERRUPTIBLE);
1480} 1490}
1481 1491
1482static void process_barrier(struct mapped_device *md, struct bio *bio) 1492static void process_barrier(struct mapped_device *md, struct bio *bio)