Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 176557
b: refs/heads/master
c: 12fc0f4
h: refs/heads/master
i:
  176555: 04c3d14
v: v3
  • Loading branch information
Mikulas Patocka authored and Alasdair G Kergon committed Dec 10, 2009
1 parent b5cb256 commit fb80eeb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 67a46dad25ccc8910995d8671f7ec17a6bc823cb
refs/heads/master: 12fc0f49dc994d8d90dcf3df13f5b1ee5441288d
10 changes: 7 additions & 3 deletions trunk/drivers/md/dm-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,11 @@ static void do_region(int rw, unsigned region, struct dm_io_region *where,
unsigned num_bvecs;
sector_t remaining = where->count;

while (remaining) {
/*
* where->count may be zero if rw holds a write barrier and we
* need to send a zero-sized barrier.
*/
do {
/*
* Allocate a suitably sized-bio.
*/
Expand Down Expand Up @@ -339,7 +343,7 @@ static void do_region(int rw, unsigned region, struct dm_io_region *where,

atomic_inc(&io->count);
submit_bio(rw, bio);
}
} while (remaining);
}

static void dispatch_io(int rw, unsigned int num_regions,
Expand All @@ -360,7 +364,7 @@ static void dispatch_io(int rw, unsigned int num_regions,
*/
for (i = 0; i < num_regions; i++) {
*dp = old_pages;
if (where[i].count)
if (where[i].count || (rw & (1 << BIO_RW_BARRIER)))
do_region(rw, i, where + i, dp, io);
}

Expand Down

0 comments on commit fb80eeb

Please sign in to comment.