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 /fs/btrfs/raid56.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 'fs/btrfs/raid56.c')
-rw-r--r-- | fs/btrfs/raid56.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/btrfs/raid56.c b/fs/btrfs/raid56.c index d8ea0eb76325..f3d30d9ea8f9 100644 --- a/fs/btrfs/raid56.c +++ b/fs/btrfs/raid56.c | |||
@@ -871,7 +871,7 @@ static void free_raid_bio(struct btrfs_raid_bio *rbio) | |||
871 | * this frees the rbio and runs through all the bios in the | 871 | * this frees the rbio and runs through all the bios in the |
872 | * bio_list and calls end_io on them | 872 | * bio_list and calls end_io on them |
873 | */ | 873 | */ |
874 | static void rbio_orig_end_io(struct btrfs_raid_bio *rbio, int err) | 874 | static void rbio_orig_end_io(struct btrfs_raid_bio *rbio, blk_status_t err) |
875 | { | 875 | { |
876 | struct bio *cur = bio_list_get(&rbio->bio_list); | 876 | struct bio *cur = bio_list_get(&rbio->bio_list); |
877 | struct bio *next; | 877 | struct bio *next; |
@@ -884,7 +884,7 @@ static void rbio_orig_end_io(struct btrfs_raid_bio *rbio, int err) | |||
884 | while (cur) { | 884 | while (cur) { |
885 | next = cur->bi_next; | 885 | next = cur->bi_next; |
886 | cur->bi_next = NULL; | 886 | cur->bi_next = NULL; |
887 | cur->bi_error = err; | 887 | cur->bi_status = err; |
888 | bio_endio(cur); | 888 | bio_endio(cur); |
889 | cur = next; | 889 | cur = next; |
890 | } | 890 | } |
@@ -897,7 +897,7 @@ static void rbio_orig_end_io(struct btrfs_raid_bio *rbio, int err) | |||
897 | static void raid_write_end_io(struct bio *bio) | 897 | static void raid_write_end_io(struct bio *bio) |
898 | { | 898 | { |
899 | struct btrfs_raid_bio *rbio = bio->bi_private; | 899 | struct btrfs_raid_bio *rbio = bio->bi_private; |
900 | int err = bio->bi_error; | 900 | blk_status_t err = bio->bi_status; |
901 | int max_errors; | 901 | int max_errors; |
902 | 902 | ||
903 | if (err) | 903 | if (err) |
@@ -914,7 +914,7 @@ static void raid_write_end_io(struct bio *bio) | |||
914 | max_errors = (rbio->operation == BTRFS_RBIO_PARITY_SCRUB) ? | 914 | max_errors = (rbio->operation == BTRFS_RBIO_PARITY_SCRUB) ? |
915 | 0 : rbio->bbio->max_errors; | 915 | 0 : rbio->bbio->max_errors; |
916 | if (atomic_read(&rbio->error) > max_errors) | 916 | if (atomic_read(&rbio->error) > max_errors) |
917 | err = -EIO; | 917 | err = BLK_STS_IOERR; |
918 | 918 | ||
919 | rbio_orig_end_io(rbio, err); | 919 | rbio_orig_end_io(rbio, err); |
920 | } | 920 | } |
@@ -1092,7 +1092,7 @@ static int rbio_add_io_page(struct btrfs_raid_bio *rbio, | |||
1092 | * devices or if they are not contiguous | 1092 | * devices or if they are not contiguous |
1093 | */ | 1093 | */ |
1094 | if (last_end == disk_start && stripe->dev->bdev && | 1094 | if (last_end == disk_start && stripe->dev->bdev && |
1095 | !last->bi_error && | 1095 | !last->bi_status && |
1096 | last->bi_bdev == stripe->dev->bdev) { | 1096 | last->bi_bdev == stripe->dev->bdev) { |
1097 | ret = bio_add_page(last, page, PAGE_SIZE, 0); | 1097 | ret = bio_add_page(last, page, PAGE_SIZE, 0); |
1098 | if (ret == PAGE_SIZE) | 1098 | if (ret == PAGE_SIZE) |
@@ -1448,7 +1448,7 @@ static void raid_rmw_end_io(struct bio *bio) | |||
1448 | { | 1448 | { |
1449 | struct btrfs_raid_bio *rbio = bio->bi_private; | 1449 | struct btrfs_raid_bio *rbio = bio->bi_private; |
1450 | 1450 | ||
1451 | if (bio->bi_error) | 1451 | if (bio->bi_status) |
1452 | fail_bio_stripe(rbio, bio); | 1452 | fail_bio_stripe(rbio, bio); |
1453 | else | 1453 | else |
1454 | set_bio_pages_uptodate(bio); | 1454 | set_bio_pages_uptodate(bio); |
@@ -1991,7 +1991,7 @@ static void raid_recover_end_io(struct bio *bio) | |||
1991 | * we only read stripe pages off the disk, set them | 1991 | * we only read stripe pages off the disk, set them |
1992 | * up to date if there were no errors | 1992 | * up to date if there were no errors |
1993 | */ | 1993 | */ |
1994 | if (bio->bi_error) | 1994 | if (bio->bi_status) |
1995 | fail_bio_stripe(rbio, bio); | 1995 | fail_bio_stripe(rbio, bio); |
1996 | else | 1996 | else |
1997 | set_bio_pages_uptodate(bio); | 1997 | set_bio_pages_uptodate(bio); |
@@ -2530,7 +2530,7 @@ static void raid56_parity_scrub_end_io(struct bio *bio) | |||
2530 | { | 2530 | { |
2531 | struct btrfs_raid_bio *rbio = bio->bi_private; | 2531 | struct btrfs_raid_bio *rbio = bio->bi_private; |
2532 | 2532 | ||
2533 | if (bio->bi_error) | 2533 | if (bio->bi_status) |
2534 | fail_bio_stripe(rbio, bio); | 2534 | fail_bio_stripe(rbio, bio); |
2535 | else | 2535 | else |
2536 | set_bio_pages_uptodate(bio); | 2536 | set_bio_pages_uptodate(bio); |