if: adapt to upstream bi_status

This commit is contained in:
Thomas Schoebel-Theuer 2019-02-21 07:20:11 +01:00 committed by Thomas Schoebel-Theuer
parent 2176f6ee13
commit d5f07017e1
1 changed files with 36 additions and 10 deletions

View File

@ -214,14 +214,19 @@ void if_endio(struct generic_callback *cb)
}
MARS_IO("calling end_io() rw = %d error = %d\n", rw, error);
// remove_this
#ifdef MARS_HAS_BI_ERROR
#ifdef MARS_HAS_BI_STATUS
// end_remove_this
bio->bi_error = error;
bio->bi_status = errno_to_blk_status(error);
bio_endio(bio);
// remove_this
#else
#ifdef MARS_HAS_BI_ERROR
bio->bi_error = error;
bio_endio(bio);
#else
bio_endio(bio, error);
#endif
#endif
// end_remove_this
brick_mem_free(biow);
}
@ -474,15 +479,21 @@ void if_make_request(struct request_queue *q, struct bio *bio)
* something here. For now, we do just nothing.
*/
// remove_this
#ifdef MARS_HAS_BI_ERROR
#ifdef MARS_HAS_BI_STATUS
// end_remove_this
error = 0;
bio->bi_error = error;
bio->bi_status = errno_to_blk_status(error);
bio_endio(bio);
// remove_this
#else
#ifdef MARS_HAS_BI_ERROR
error = 0;
bio->bi_error = error;
bio_endio(bio);
#else
bio_endio(bio, error);
#endif
#endif
// end_remove_this
goto done;
}
@ -498,14 +509,19 @@ void if_make_request(struct request_queue *q, struct bio *bio)
if (ahead) {
atomic_inc(&input->total_reada_count);
// remove_this
#ifdef MARS_HAS_BI_ERROR
#ifdef MARS_HAS_BI_STATUS
// end_remove_this
bio->bi_error = -EWOULDBLOCK;
bio->bi_status = errno_to_blk_status(-EWOULDBLOCK);
bio_endio(bio);
// remove_this
#else
#ifdef MARS_HAS_BI_ERROR
bio->bi_error = -EWOULDBLOCK;
bio_endio(bio);
#else
bio_endio(bio, -EWOULDBLOCK);
#endif
#endif
// end_remove_this
error = 0;
goto done;
@ -516,14 +532,19 @@ void if_make_request(struct request_queue *q, struct bio *bio)
if (unlikely(discard)) { // NYI
error = 0;
// remove_this
#ifdef MARS_HAS_BI_ERROR
#ifdef MARS_HAS_BI_STATUS
// end_remove_this
bio->bi_error = error;
bio->bi_status = errno_to_blk_status(error);
bio_endio(bio);
// remove_this
#else
#ifdef MARS_HAS_BI_ERROR
bio->bi_error = error;
bio_endio(bio);
#else
bio_endio(bio, error);
#endif
#endif
// end_remove_this
goto done;
}
@ -768,14 +789,19 @@ err:
MARS_ERR("cannot submit request from bio, status=%d\n", error);
if (!assigned) {
// remove_this
#ifdef MARS_HAS_BI_ERROR
#ifdef MARS_HAS_BI_STATUS
// end_remove_this
bio->bi_error = error;
bio->bi_status = errno_to_blk_status(error);
bio_endio(bio);
// remove_this
#else
#ifdef MARS_HAS_BI_ERROR
bio->bi_error = error;
bio_endio(bio);
#else
bio_endio(bio, error);
#endif
#endif
// end_remove_this
}
}