diff options
author | Christoph Hellwig <hch@lst.de> | 2017-06-03 03:38:06 -0400 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2017-06-09 11:27:32 -0400 |
commit | 4e4cbee93d56137ebff722be022cae5f70ef84fb (patch) | |
tree | 4fa7345155599fc6bdd653fca8c5224ddf90a5be /drivers/md/raid5.c | |
parent | fc17b6534eb8395f0b3133eb31d87deec32c642b (diff) |
block: switch bios to blk_status_t
Replace bi_error with a new bi_status to allow for a clear conversion.
Note that device mapper overloaded bi_error with a private value, which
we'll have to keep arround at least for now and thus propagate to a
proper blk_status_t value.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/md/raid5.c')
-rw-r--r-- | drivers/md/raid5.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 9c4f7659f8b1..e1bdc320f664 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c | |||
@@ -2476,7 +2476,7 @@ static void raid5_end_read_request(struct bio * bi) | |||
2476 | 2476 | ||
2477 | pr_debug("end_read_request %llu/%d, count: %d, error %d.\n", | 2477 | pr_debug("end_read_request %llu/%d, count: %d, error %d.\n", |
2478 | (unsigned long long)sh->sector, i, atomic_read(&sh->count), | 2478 | (unsigned long long)sh->sector, i, atomic_read(&sh->count), |
2479 | bi->bi_error); | 2479 | bi->bi_status); |
2480 | if (i == disks) { | 2480 | if (i == disks) { |
2481 | bio_reset(bi); | 2481 | bio_reset(bi); |
2482 | BUG(); | 2482 | BUG(); |
@@ -2496,7 +2496,7 @@ static void raid5_end_read_request(struct bio * bi) | |||
2496 | s = sh->sector + rdev->new_data_offset; | 2496 | s = sh->sector + rdev->new_data_offset; |
2497 | else | 2497 | else |
2498 | s = sh->sector + rdev->data_offset; | 2498 | s = sh->sector + rdev->data_offset; |
2499 | if (!bi->bi_error) { | 2499 | if (!bi->bi_status) { |
2500 | set_bit(R5_UPTODATE, &sh->dev[i].flags); | 2500 | set_bit(R5_UPTODATE, &sh->dev[i].flags); |
2501 | if (test_bit(R5_ReadError, &sh->dev[i].flags)) { | 2501 | if (test_bit(R5_ReadError, &sh->dev[i].flags)) { |
2502 | /* Note that this cannot happen on a | 2502 | /* Note that this cannot happen on a |
@@ -2613,7 +2613,7 @@ static void raid5_end_write_request(struct bio *bi) | |||
2613 | } | 2613 | } |
2614 | pr_debug("end_write_request %llu/%d, count %d, error: %d.\n", | 2614 | pr_debug("end_write_request %llu/%d, count %d, error: %d.\n", |
2615 | (unsigned long long)sh->sector, i, atomic_read(&sh->count), | 2615 | (unsigned long long)sh->sector, i, atomic_read(&sh->count), |
2616 | bi->bi_error); | 2616 | bi->bi_status); |
2617 | if (i == disks) { | 2617 | if (i == disks) { |
2618 | bio_reset(bi); | 2618 | bio_reset(bi); |
2619 | BUG(); | 2619 | BUG(); |
@@ -2621,14 +2621,14 @@ static void raid5_end_write_request(struct bio *bi) | |||
2621 | } | 2621 | } |
2622 | 2622 | ||
2623 | if (replacement) { | 2623 | if (replacement) { |
2624 | if (bi->bi_error) | 2624 | if (bi->bi_status) |
2625 | md_error(conf->mddev, rdev); | 2625 | md_error(conf->mddev, rdev); |
2626 | else if (is_badblock(rdev, sh->sector, | 2626 | else if (is_badblock(rdev, sh->sector, |
2627 | STRIPE_SECTORS, | 2627 | STRIPE_SECTORS, |
2628 | &first_bad, &bad_sectors)) | 2628 | &first_bad, &bad_sectors)) |
2629 | set_bit(R5_MadeGoodRepl, &sh->dev[i].flags); | 2629 | set_bit(R5_MadeGoodRepl, &sh->dev[i].flags); |
2630 | } else { | 2630 | } else { |
2631 | if (bi->bi_error) { | 2631 | if (bi->bi_status) { |
2632 | set_bit(STRIPE_DEGRADED, &sh->state); | 2632 | set_bit(STRIPE_DEGRADED, &sh->state); |
2633 | set_bit(WriteErrorSeen, &rdev->flags); | 2633 | set_bit(WriteErrorSeen, &rdev->flags); |
2634 | set_bit(R5_WriteError, &sh->dev[i].flags); | 2634 | set_bit(R5_WriteError, &sh->dev[i].flags); |
@@ -2649,7 +2649,7 @@ static void raid5_end_write_request(struct bio *bi) | |||
2649 | } | 2649 | } |
2650 | rdev_dec_pending(rdev, conf->mddev); | 2650 | rdev_dec_pending(rdev, conf->mddev); |
2651 | 2651 | ||
2652 | if (sh->batch_head && bi->bi_error && !replacement) | 2652 | if (sh->batch_head && bi->bi_status && !replacement) |
2653 | set_bit(STRIPE_BATCH_ERR, &sh->batch_head->state); | 2653 | set_bit(STRIPE_BATCH_ERR, &sh->batch_head->state); |
2654 | 2654 | ||
2655 | bio_reset(bi); | 2655 | bio_reset(bi); |
@@ -3381,7 +3381,7 @@ handle_failed_stripe(struct r5conf *conf, struct stripe_head *sh, | |||
3381 | sh->dev[i].sector + STRIPE_SECTORS) { | 3381 | sh->dev[i].sector + STRIPE_SECTORS) { |
3382 | struct bio *nextbi = r5_next_bio(bi, sh->dev[i].sector); | 3382 | struct bio *nextbi = r5_next_bio(bi, sh->dev[i].sector); |
3383 | 3383 | ||
3384 | bi->bi_error = -EIO; | 3384 | bi->bi_status = BLK_STS_IOERR; |
3385 | md_write_end(conf->mddev); | 3385 | md_write_end(conf->mddev); |
3386 | bio_endio(bi); | 3386 | bio_endio(bi); |
3387 | bi = nextbi; | 3387 | bi = nextbi; |
@@ -3403,7 +3403,7 @@ handle_failed_stripe(struct r5conf *conf, struct stripe_head *sh, | |||
3403 | sh->dev[i].sector + STRIPE_SECTORS) { | 3403 | sh->dev[i].sector + STRIPE_SECTORS) { |
3404 | struct bio *bi2 = r5_next_bio(bi, sh->dev[i].sector); | 3404 | struct bio *bi2 = r5_next_bio(bi, sh->dev[i].sector); |
3405 | 3405 | ||
3406 | bi->bi_error = -EIO; | 3406 | bi->bi_status = BLK_STS_IOERR; |
3407 | md_write_end(conf->mddev); | 3407 | md_write_end(conf->mddev); |
3408 | bio_endio(bi); | 3408 | bio_endio(bi); |
3409 | bi = bi2; | 3409 | bi = bi2; |
@@ -3429,7 +3429,7 @@ handle_failed_stripe(struct r5conf *conf, struct stripe_head *sh, | |||
3429 | struct bio *nextbi = | 3429 | struct bio *nextbi = |
3430 | r5_next_bio(bi, sh->dev[i].sector); | 3430 | r5_next_bio(bi, sh->dev[i].sector); |
3431 | 3431 | ||
3432 | bi->bi_error = -EIO; | 3432 | bi->bi_status = BLK_STS_IOERR; |
3433 | bio_endio(bi); | 3433 | bio_endio(bi); |
3434 | bi = nextbi; | 3434 | bi = nextbi; |
3435 | } | 3435 | } |
@@ -5144,7 +5144,7 @@ static void raid5_align_endio(struct bio *bi) | |||
5144 | struct mddev *mddev; | 5144 | struct mddev *mddev; |
5145 | struct r5conf *conf; | 5145 | struct r5conf *conf; |
5146 | struct md_rdev *rdev; | 5146 | struct md_rdev *rdev; |
5147 | int error = bi->bi_error; | 5147 | blk_status_t error = bi->bi_status; |
5148 | 5148 | ||
5149 | bio_put(bi); | 5149 | bio_put(bi); |
5150 | 5150 | ||
@@ -5721,7 +5721,7 @@ static void raid5_make_request(struct mddev *mddev, struct bio * bi) | |||
5721 | release_stripe_plug(mddev, sh); | 5721 | release_stripe_plug(mddev, sh); |
5722 | } else { | 5722 | } else { |
5723 | /* cannot get stripe for read-ahead, just give-up */ | 5723 | /* cannot get stripe for read-ahead, just give-up */ |
5724 | bi->bi_error = -EIO; | 5724 | bi->bi_status = BLK_STS_IOERR; |
5725 | break; | 5725 | break; |
5726 | } | 5726 | } |
5727 | } | 5727 | } |