From 500ddbc97f9c7f5562a0530d2c5f869470050991 Mon Sep 17 00:00:00 2001 From: Thomas Schoebel-Theuer Date: Tue, 29 Sep 2015 08:20:06 +0200 Subject: [PATCH] bio: adapt bio_endio() to kernel 4.3 --- kernel/mars_bio.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/kernel/mars_bio.c b/kernel/mars_bio.c index bee17789..41a69c26 100644 --- a/kernel/mars_bio.c +++ b/kernel/mars_bio.c @@ -45,6 +45,10 @@ #ifdef __bvec_iter_bvec #define HAS_BVEC_ITER #endif +/* adaptation to 4246a0b63bd8f56a1469b12eafeb875b1041a451 */ +#ifndef bio_io_error +#define HAS_BI_ERROR +#endif // end_remove_this static struct timing_stats timings[2] = {}; @@ -82,8 +86,17 @@ EXPORT_SYMBOL_GPL(bio_io_threshold); /* This is called from the kernel bio layer. */ +// remove_this +#ifdef HAS_BI_ERROR +// end_remove_this +static +void bio_callback(struct bio *bio) +// remove_this +#else static void bio_callback(struct bio *bio, int code) +#endif +// end_remove_this { struct bio_mref_aspect *mref_a = bio->bi_private; struct bio_brick *brick; @@ -94,7 +107,15 @@ void bio_callback(struct bio *bio, int code) brick = mref_a->output->brick; CHECK_PTR(brick, err); +// remove_this +#ifdef HAS_BI_ERROR +// end_remove_this + mref_a->status_code = bio->bi_error; +// remove_this +#else mref_a->status_code = code; +#endif +// end_remove_this spin_lock_irqsave(&brick->lock, flags); list_del(&mref_a->io_head);