From d5f07017e172ac8309459683e970b5f52ea8adc4 Mon Sep 17 00:00:00 2001 From: Thomas Schoebel-Theuer Date: Thu, 21 Feb 2019 07:20:11 +0100 Subject: [PATCH] if: adapt to upstream bi_status --- kernel/mars_if.c | 46 ++++++++++++++++++++++++++++++++++++---------- 1 file changed, 36 insertions(+), 10 deletions(-) diff --git a/kernel/mars_if.c b/kernel/mars_if.c index 162a1412..9d2bbf6b 100644 --- a/kernel/mars_if.c +++ b/kernel/mars_if.c @@ -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 } }