From: James Simmons Date: Tue, 29 Sep 2015 14:10:29 +0000 (-0400) Subject: LU-6215 llite: bio_endio only takes one argument for 4.2 X-Git-Tag: 2.7.62~45 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;ds=sidebyside;h=d410aeef76f79e0fc7b09227f850a4ebd462ad3f;p=fs%2Flustre-release.git LU-6215 llite: bio_endio only takes one argument for 4.2 For the 4.2 kernel bio_endio() is down to taking only one argument. This patch handles this API change. Change-Id: I22edc64e76d22241c8c809acf58cf64dd67bbb61 Signed-off-by: James Simmons Reviewed-on: http://review.whamcloud.com/16278 Reviewed-by: Dmitry Eremin Tested-by: Jenkins Reviewed-by: Frank Zago Reviewed-by: Bob Glossman Tested-by: Maloo Reviewed-by: John L. Hammond Reviewed-by: Oleg Drokin --- diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index 97f1a2d..ac3c74b 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -1912,6 +1912,23 @@ symlink_use_nameidata, [ ]) # LC_SYMLINK_OPS_USE_NAMEIDATA # +# LC_BIO_ENDIO_USES_ONE_ARG +# +# 4.2 kernel bio_endio now only takes one argument +# +AC_DEFUN([LC_BIO_ENDIO_USES_ONE_ARG], [ +LB_CHECK_COMPILE([if 'bio_endio' with one argument exist], +bio_endio, [ + #include +],[ + bio_endio(NULL); +],[ + AC_DEFINE(HAVE_BIO_ENDIO_USES_ONE_ARG, 1, + [bio_endio takes only one argument]) +]) +]) # LC_BIO_ENDIO_USES_ONE_ARG + +# # LC_PROG_LINUX # # Lustre linux kernel checks @@ -2068,6 +2085,7 @@ AC_DEFUN([LC_PROG_LINUX], [ # 4.2 LC_NEW_CANCEL_DIRTY_PAGE + LC_BIO_ENDIO_USES_ONE_ARG LC_SYMLINK_OPS_USE_NAMEIDATA # diff --git a/lustre/llite/lloop.c b/lustre/llite/lloop.c index 0e68b51..db65eac 100644 --- a/lustre/llite/lloop.c +++ b/lustre/llite/lloop.c @@ -414,14 +414,21 @@ static void loop_unplug(struct request_queue *q) static inline void loop_handle_bio(struct lloop_device *lo, struct bio *bio) { - int ret; - ret = do_bio_lustrebacked(lo, bio); - while (bio) { - struct bio *tmp = bio->bi_next; - bio->bi_next = NULL; + int ret; + + ret = do_bio_lustrebacked(lo, bio); + while (bio) { + struct bio *tmp = bio->bi_next; + + bio->bi_next = NULL; +#ifdef HAVE_BIO_ENDIO_USES_ONE_ARG + bio->bi_error = ret; + bio_endio(bio); +#else bio_endio(bio, ret); - bio = tmp; - } +#endif + bio = tmp; + } } static inline int loop_active(struct lloop_device *lo)