From: Li Dongyang Date: Tue, 1 Mar 2016 05:53:49 +0000 (+1100) Subject: LU-6215 llite: make_request_fn returns blk_qc_t in kernel 4.4 X-Git-Tag: 2.8.51~17 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=9806eb0efdba6d815808f53ada4423850f4493f7;ds=sidebyside LU-6215 llite: make_request_fn returns blk_qc_t in kernel 4.4 For the 4.4 kernel request_queue.make_request_fn is defined as a function returns blk_qc_t. loop_make_request() should return BLK_QC_T_NONE in this case. Linux-commit: dece16353ef47d8d33f5302bc158072a9d65e26f Signed-off-by: Li Dongyang Change-Id: I20a796caf6d8e6411f084db2392683c12307a0bf Reviewed-on: http://review.whamcloud.com/18730 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: James Simmons Reviewed-by: Dmitry Eremin Reviewed-by: Lai Siyao Reviewed-by: Oleg Drokin --- diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index 06a56fa..d9294bf 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -2009,6 +2009,26 @@ locks_lock_file_wait, [ ]) # LC_HAVE_LOCKS_LOCK_FILE_WAIT # +# LC_HAVE_QC_MAKE_REQUEST_FN +# +# 4.4 request_queue.make_request_fn defined as function returns with blk_qc_t +# see kernel commit dece16353ef47d8d33f5302bc158072a9d65e26f +# +AC_DEFUN([LC_HAVE_QC_MAKE_REQUEST_FN], [ +LB_CHECK_COMPILE([if 'request_queue.make_request_fn' returns blk_qc_t], +make_request_fn_blk_qc_t, [ + #include +],[ + blk_qc_t ret; + make_request_fn *mrf; + ret = mrf(NULL, NULL); +],[ + AC_DEFINE(HAVE_QC_MAKE_REQUEST_FN, 1, + [request_queue.make_request_fn returns blk_qc_t]) +]) +]) # LC_HAVE_QC_MAKE_REQUEST_FN + +# # LC_PROG_LINUX # # Lustre linux kernel checks @@ -2175,6 +2195,7 @@ AC_DEFUN([LC_PROG_LINUX], [ # 4.4 LC_HAVE_LOCKS_LOCK_FILE_WAIT + LC_HAVE_QC_MAKE_REQUEST_FN # AS_IF([test "x$enable_server" != xno], [ diff --git a/lustre/include/lustre_compat.h b/lustre/include/lustre_compat.h index c038aa1..4e9f3ac 100644 --- a/lustre/include/lustre_compat.h +++ b/lustre/include/lustre_compat.h @@ -298,12 +298,17 @@ static inline int ll_namei_to_lookup_intent_flag(int flag) return flag; } -#ifdef HAVE_VOID_MAKE_REQUEST_FN -# define ll_mrf_ret void -# define LL_MRF_RETURN(rc) +#ifdef HAVE_QC_MAKE_REQUEST_FN +# define ll_mrf_ret blk_qc_t +# define LL_MRF_RETURN(rc) RETURN(BLK_QC_T_NONE) #else -# define ll_mrf_ret int -# define LL_MRF_RETURN(rc) RETURN(rc) +# ifdef HAVE_VOID_MAKE_REQUEST_FN +# define ll_mrf_ret void +# define LL_MRF_RETURN(rc) +# else +# define ll_mrf_ret int +# define LL_MRF_RETURN(rc) RETURN(rc) +# endif #endif #include