Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 154250
b: refs/heads/master
c: 52b1fd5
h: refs/heads/master
v: v3
  • Loading branch information
Mikulas Patocka authored and Alasdair G Kergon committed Jun 22, 2009
1 parent 8d101be commit ca588cf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9015df24a8008d7bea2bd3df881783ebe0dcb9af
refs/heads/master: 52b1fd5a27c625c78373e024bf570af3c9d44a79
10 changes: 10 additions & 0 deletions trunk/drivers/md/dm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit ca588cf

Please sign in to comment.