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>
This commit is contained in:
committed by
Jens Axboe
parent
fc17b6534e
commit
4e4cbee93d
@@ -273,7 +273,7 @@ static blk_qc_t md_make_request(struct request_queue *q, struct bio *bio)
|
||||
}
|
||||
if (mddev->ro == 1 && unlikely(rw == WRITE)) {
|
||||
if (bio_sectors(bio) != 0)
|
||||
bio->bi_error = -EROFS;
|
||||
bio->bi_status = BLK_STS_IOERR;
|
||||
bio_endio(bio);
|
||||
return BLK_QC_T_NONE;
|
||||
}
|
||||
@@ -719,8 +719,8 @@ static void super_written(struct bio *bio)
|
||||
struct md_rdev *rdev = bio->bi_private;
|
||||
struct mddev *mddev = rdev->mddev;
|
||||
|
||||
if (bio->bi_error) {
|
||||
pr_err("md: super_written gets error=%d\n", bio->bi_error);
|
||||
if (bio->bi_status) {
|
||||
pr_err("md: super_written gets error=%d\n", bio->bi_status);
|
||||
md_error(mddev, rdev);
|
||||
if (!test_bit(Faulty, &rdev->flags)
|
||||
&& (bio->bi_opf & MD_FAILFAST)) {
|
||||
@@ -801,7 +801,7 @@ int sync_page_io(struct md_rdev *rdev, sector_t sector, int size,
|
||||
|
||||
submit_bio_wait(bio);
|
||||
|
||||
ret = !bio->bi_error;
|
||||
ret = !bio->bi_status;
|
||||
bio_put(bio);
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user