[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
[dm-devel] [PATCH 7/11] bottom-layer barrier support
- From: Mikulas Patocka <mpatocka redhat com>
- To: dm-devel redhat com
- Cc: Alasdair G Kergon <agk redhat com>
- Subject: [dm-devel] [PATCH 7/11] bottom-layer barrier support
- Date: Fri, 10 Apr 2009 01:13:49 -0400 (EDT)
Modify dm_flush so that is passes empty barrier flushes to the targets.
Signed-off-by: Mikulas Patocka <mpatocka redhat com>
---
drivers/md/dm.c | 10 ++++++++++
1 file changed, 10 insertions(+)
Index: linux-2.6.30-rc1-devel/drivers/md/dm.c
===================================================================
--- linux-2.6.30-rc1-devel.orig/drivers/md/dm.c 2009-04-10 06:33:31.000000000 +0200
+++ linux-2.6.30-rc1-devel/drivers/md/dm.c 2009-04-10 06:33:34.000000000 +0200
@@ -175,6 +175,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
@@ -1460,6 +1463,13 @@ static int dm_wait_for_completion(struct
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);
}
/*
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]