summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/volumes.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2017-06-03 03:38:06 -0400
committerJens Axboe <axboe@fb.com>2017-06-09 11:27:32 -0400
commit4e4cbee93d56137ebff722be022cae5f70ef84fb (patch)
tree4fa7345155599fc6bdd653fca8c5224ddf90a5be /fs/btrfs/volumes.c
parentfc17b6534eb8395f0b3133eb31d87deec32c642b (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/volumes.c')
-rw-r--r--fs/btrfs/volumes.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 017b67daa3bb..84a495967e0a 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -6042,9 +6042,10 @@ static void btrfs_end_bio(struct bio *bio)
6042 struct btrfs_bio *bbio = bio->bi_private; 6042 struct btrfs_bio *bbio = bio->bi_private;
6043 int is_orig_bio = 0; 6043 int is_orig_bio = 0;
6044 6044
6045 if (bio->bi_error) { 6045 if (bio->bi_status) {
6046 atomic_inc(&bbio->error); 6046 atomic_inc(&bbio->error);
6047 if (bio->bi_error == -EIO || bio->bi_error == -EREMOTEIO) { 6047 if (bio->bi_status == BLK_STS_IOERR ||
6048 bio->bi_status == BLK_STS_TARGET) {
6048 unsigned int stripe_index = 6049 unsigned int stripe_index =
6049 btrfs_io_bio(bio)->stripe_index; 6050 btrfs_io_bio(bio)->stripe_index;
6050 struct btrfs_device *dev; 6051 struct btrfs_device *dev;
@@ -6082,13 +6083,13 @@ static void btrfs_end_bio(struct bio *bio)
6082 * beyond the tolerance of the btrfs bio 6083 * beyond the tolerance of the btrfs bio
6083 */ 6084 */
6084 if (atomic_read(&bbio->error) > bbio->max_errors) { 6085 if (atomic_read(&bbio->error) > bbio->max_errors) {
6085 bio->bi_error = -EIO; 6086 bio->bi_status = BLK_STS_IOERR;
6086 } else { 6087 } else {
6087 /* 6088 /*
6088 * this bio is actually up to date, we didn't 6089 * this bio is actually up to date, we didn't
6089 * go over the max number of errors 6090 * go over the max number of errors
6090 */ 6091 */
6091 bio->bi_error = 0; 6092 bio->bi_status = 0;
6092 } 6093 }
6093 6094
6094 btrfs_end_bbio(bbio, bio); 6095 btrfs_end_bbio(bbio, bio);
@@ -6199,7 +6200,7 @@ static void bbio_error(struct btrfs_bio *bbio, struct bio *bio, u64 logical)
6199 6200
6200 btrfs_io_bio(bio)->mirror_num = bbio->mirror_num; 6201 btrfs_io_bio(bio)->mirror_num = bbio->mirror_num;
6201 bio->bi_iter.bi_sector = logical >> 9; 6202 bio->bi_iter.bi_sector = logical >> 9;
6202 bio->bi_error = -EIO; 6203 bio->bi_status = BLK_STS_IOERR;
6203 btrfs_end_bbio(bbio, bio); 6204 btrfs_end_bbio(bbio, bio);
6204 } 6205 }
6205} 6206}