diff options
author | Mikulas Patocka <mpatocka@redhat.com> | 2009-12-10 18:52:22 -0500 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2009-12-10 18:52:22 -0500 |
commit | 12fc0f49dc994d8d90dcf3df13f5b1ee5441288d (patch) | |
tree | 60959c326d01807f3e9a72bd1799717d0166ac6e /drivers/md/dm-io.c | |
parent | 67a46dad25ccc8910995d8671f7ec17a6bc823cb (diff) |
dm io: handle empty barriers
Accept empty barriers in dm-io.
dm-io will process empty write barrier requests just like the other
read/write requests.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers/md/dm-io.c')
-rw-r--r-- | drivers/md/dm-io.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/md/dm-io.c b/drivers/md/dm-io.c index f6a714c5aab0..10f457ca6af2 100644 --- a/drivers/md/dm-io.c +++ b/drivers/md/dm-io.c | |||
@@ -309,7 +309,11 @@ static void do_region(int rw, unsigned region, struct dm_io_region *where, | |||
309 | unsigned num_bvecs; | 309 | unsigned num_bvecs; |
310 | sector_t remaining = where->count; | 310 | sector_t remaining = where->count; |
311 | 311 | ||
312 | while (remaining) { | 312 | /* |
313 | * where->count may be zero if rw holds a write barrier and we | ||
314 | * need to send a zero-sized barrier. | ||
315 | */ | ||
316 | do { | ||
313 | /* | 317 | /* |
314 | * Allocate a suitably sized-bio. | 318 | * Allocate a suitably sized-bio. |
315 | */ | 319 | */ |
@@ -339,7 +343,7 @@ static void do_region(int rw, unsigned region, struct dm_io_region *where, | |||
339 | 343 | ||
340 | atomic_inc(&io->count); | 344 | atomic_inc(&io->count); |
341 | submit_bio(rw, bio); | 345 | submit_bio(rw, bio); |
342 | } | 346 | } while (remaining); |
343 | } | 347 | } |
344 | 348 | ||
345 | static void dispatch_io(int rw, unsigned int num_regions, | 349 | static void dispatch_io(int rw, unsigned int num_regions, |
@@ -360,7 +364,7 @@ static void dispatch_io(int rw, unsigned int num_regions, | |||
360 | */ | 364 | */ |
361 | for (i = 0; i < num_regions; i++) { | 365 | for (i = 0; i < num_regions; i++) { |
362 | *dp = old_pages; | 366 | *dp = old_pages; |
363 | if (where[i].count) | 367 | if (where[i].count || (rw & (1 << BIO_RW_BARRIER))) |
364 | do_region(rw, i, where + i, dp, io); | 368 | do_region(rw, i, where + i, dp, io); |
365 | } | 369 | } |
366 | 370 | ||