Linux 4.4 compat: make_request_fn returns blk_qc_t

As part of block polling support in Linux 4.4, make_request_fn should
return a cookie value of type blk_qc_t. For now, we make zvol_request
always return BLK_QC_T_NONE until we assess whether and how we want
to support block polling.

Signed-off-by: Chunwei Chen <david.chen@osnexus.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #4021
This commit is contained in:
Chunwei Chen 2015-11-23 14:47:29 -08:00 committed by Brian Behlendorf
parent 43518d92fd
commit 1a09371678
2 changed files with 26 additions and 2 deletions

View File

@ -2,6 +2,9 @@ dnl #
dnl # Linux 3.2 API Change dnl # Linux 3.2 API Change
dnl # make_request_fn returns void instead of int. dnl # make_request_fn returns void instead of int.
dnl # dnl #
dnl # Linux 4.4 API Change
dnl # make_request_fn returns blk_qc_t.
dnl #
AC_DEFUN([ZFS_AC_KERNEL_MAKE_REQUEST_FN], [ AC_DEFUN([ZFS_AC_KERNEL_MAKE_REQUEST_FN], [
AC_MSG_CHECKING([whether make_request_fn() returns int]) AC_MSG_CHECKING([whether make_request_fn() returns int])
ZFS_LINUX_TRY_COMPILE([ ZFS_LINUX_TRY_COMPILE([
@ -35,9 +38,28 @@ AC_DEFUN([ZFS_AC_KERNEL_MAKE_REQUEST_FN], [
AC_MSG_RESULT(yes) AC_MSG_RESULT(yes)
AC_DEFINE(MAKE_REQUEST_FN_RET, void, AC_DEFINE(MAKE_REQUEST_FN_RET, void,
[make_request_fn() returns void]) [make_request_fn() returns void])
],[
AC_MSG_RESULT(no)
AC_MSG_CHECKING([whether make_request_fn() returns blk_qc_t])
ZFS_LINUX_TRY_COMPILE([
#include <linux/blkdev.h>
blk_qc_t make_request(struct request_queue *q, struct bio *bio)
{
return (BLK_QC_T_NONE);
}
],[
blk_queue_make_request(NULL, &make_request);
],[
AC_MSG_RESULT(yes)
AC_DEFINE(MAKE_REQUEST_FN_RET, blk_qc_t,
[make_request_fn() returns blk_qc_t])
AC_DEFINE(HAVE_MAKE_REQUEST_FN_RET_QC, 1,
[Noting that make_request_fn() returns blk_qc_t])
],[ ],[
AC_MSG_ERROR(no - Please file a bug report at AC_MSG_ERROR(no - Please file a bug report at
https://github.com/zfsonlinux/zfs/issues/new) https://github.com/zfsonlinux/zfs/issues/new)
]) ])
]) ])
])
]) ])

View File

@ -755,6 +755,8 @@ out1:
spl_fstrans_unmark(cookie); spl_fstrans_unmark(cookie);
#ifdef HAVE_MAKE_REQUEST_FN_RET_INT #ifdef HAVE_MAKE_REQUEST_FN_RET_INT
return (0); return (0);
#elif defined(HAVE_MAKE_REQUEST_FN_RET_QC)
return (BLK_QC_T_NONE);
#endif #endif
} }