diff options
author | Mikulas Patocka <mpatocka@redhat.com> | 2009-06-22 05:12:17 -0400 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2009-06-22 05:12:17 -0400 |
commit | 531fe96364f30879753d46c1f52ab839e12d2e5d (patch) | |
tree | 61a625f68c3105c1525e2eebba0f046a3678eb37 /drivers | |
parent | 32a926da5a16c01a8213331e5764472ce2f14a8d (diff) |
dm: make dm_flush return void
Make dm_flush return void.
The first error during flush is stored in md->barrier_error instead.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/md/dm.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 5e06f1e6234f..e34d694ddd04 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c | |||
@@ -1439,34 +1439,25 @@ static int dm_wait_for_completion(struct mapped_device *md, int interruptible) | |||
1439 | return r; | 1439 | return r; |
1440 | } | 1440 | } |
1441 | 1441 | ||
1442 | static int dm_flush(struct mapped_device *md) | 1442 | static void dm_flush(struct mapped_device *md) |
1443 | { | 1443 | { |
1444 | dm_wait_for_completion(md, TASK_UNINTERRUPTIBLE); | 1444 | dm_wait_for_completion(md, TASK_UNINTERRUPTIBLE); |
1445 | return 0; | ||
1446 | } | 1445 | } |
1447 | 1446 | ||
1448 | static void process_barrier(struct mapped_device *md, struct bio *bio) | 1447 | static void process_barrier(struct mapped_device *md, struct bio *bio) |
1449 | { | 1448 | { |
1450 | int error = dm_flush(md); | 1449 | dm_flush(md); |
1451 | 1450 | ||
1452 | if (unlikely(error)) { | ||
1453 | bio_endio(bio, error); | ||
1454 | return; | ||
1455 | } | ||
1456 | if (bio_empty_barrier(bio)) { | 1451 | if (bio_empty_barrier(bio)) { |
1457 | bio_endio(bio, 0); | 1452 | bio_endio(bio, 0); |
1458 | return; | 1453 | return; |
1459 | } | 1454 | } |
1460 | 1455 | ||
1461 | __split_and_process_bio(md, bio); | 1456 | __split_and_process_bio(md, bio); |
1462 | 1457 | dm_flush(md); | |
1463 | error = dm_flush(md); | ||
1464 | |||
1465 | if (!error && md->barrier_error) | ||
1466 | error = md->barrier_error; | ||
1467 | 1458 | ||
1468 | if (md->barrier_error != DM_ENDIO_REQUEUE) | 1459 | if (md->barrier_error != DM_ENDIO_REQUEUE) |
1469 | bio_endio(bio, error); | 1460 | bio_endio(bio, md->barrier_error); |
1470 | } | 1461 | } |
1471 | 1462 | ||
1472 | /* | 1463 | /* |