From e48533383b6ba1737245ac4338c492865a97b0e9 Mon Sep 17 00:00:00 2001 From: Tim Chase Date: Fri, 8 May 2015 15:49:56 -0500 Subject: [PATCH] Linux 2.6.36 compat, use REQ_FAILFAST_MASK and remove pre-2.6.36 support Commit f4af6bb783b0b7f2a6075cb1c74c225db8a157b2 which added support for REQ_FAILFAST_MASK but the new autoconf test didn't use the same preprocessor macro name as the code did. The effect is that FAILFAST mode has not been enabled for ZoL in any post-2.6.35 kernel. Retire the HAVE_BIO_RW_FAILFAST interface used in pre-2.6.28 kernels. Raise an error condition if the FAILFAST interface can't be detected. Signed-off-by: Tim Chase Closes #3386 --- config/kernel-bio-failfast.m4 | 20 ++------------------ config/kernel.m4 | 1 - include/linux/blkdev_compat.h | 15 +++++---------- 3 files changed, 7 insertions(+), 29 deletions(-) diff --git a/config/kernel-bio-failfast.m4 b/config/kernel-bio-failfast.m4 index 6b9a5269ee..cfbec05238 100644 --- a/config/kernel-bio-failfast.m4 +++ b/config/kernel-bio-failfast.m4 @@ -1,24 +1,8 @@ dnl # dnl # Preferred interface for setting FAILFAST on a bio: -dnl # 2.6.12-2.6.27: BIO_RW_FAILFAST dnl # 2.6.28-2.6.35: BIO_RW_FAILFAST_{DEV|TRANSPORT|DRIVER} -dnl # 2.6.36-2.6.xx: REQ_FAILFAST_{DEV|TRANSPORT|DRIVER} +dnl # >= 2.6.36: REQ_FAILFAST_{DEV|TRANSPORT|DRIVER} dnl # -AC_DEFUN([ZFS_AC_KERNEL_BIO_FAILFAST], [ - AC_MSG_CHECKING([whether BIO_RW_FAILFAST is defined]) - ZFS_LINUX_TRY_COMPILE([ - #include - ],[ - int flags __attribute__ ((unused)); - flags = (1 << BIO_RW_FAILFAST); - ],[ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_BIO_RW_FAILFAST, 1, - [BIO_RW_FAILFAST is defined]) - ],[ - AC_MSG_RESULT(no) - ]) -]) AC_DEFUN([ZFS_AC_KERNEL_BIO_FAILFAST_DTD], [ AC_MSG_CHECKING([whether BIO_RW_FAILFAST_* are defined]) @@ -47,7 +31,7 @@ AC_DEFUN([ZFS_AC_KERNEL_REQ_FAILFAST_MASK], [ flags = REQ_FAILFAST_MASK; ],[ AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_BIO_REQ_FAILFAST_MASK, 1, + AC_DEFINE(HAVE_REQ_FAILFAST_MASK, 1, [REQ_FAILFAST_MASK is defined]) ],[ AC_MSG_RESULT(no) diff --git a/config/kernel.m4 b/config/kernel.m4 index ce10707e49..69470e128a 100644 --- a/config/kernel.m4 +++ b/config/kernel.m4 @@ -19,7 +19,6 @@ AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [ ZFS_AC_KERNEL_BDEV_LOGICAL_BLOCK_SIZE ZFS_AC_KERNEL_BDEV_PHYSICAL_BLOCK_SIZE ZFS_AC_KERNEL_BIO_BVEC_ITER - ZFS_AC_KERNEL_BIO_FAILFAST ZFS_AC_KERNEL_BIO_FAILFAST_DTD ZFS_AC_KERNEL_REQ_FAILFAST_MASK ZFS_AC_KERNEL_BIO_END_IO_T_ARGS diff --git a/include/linux/blkdev_compat.h b/include/linux/blkdev_compat.h index 8566033fcf..89e888c300 100644 --- a/include/linux/blkdev_compat.h +++ b/include/linux/blkdev_compat.h @@ -347,26 +347,21 @@ bio_set_flags_failfast(struct block_device *bdev, int *flags) #endif /* BLOCK_EXT_MAJOR */ #endif /* CONFIG_BUG */ -#ifdef HAVE_BIO_RW_FAILFAST_DTD +#if defined(HAVE_BIO_RW_FAILFAST_DTD) /* BIO_RW_FAILFAST_* preferred interface from 2.6.28 - 2.6.35 */ *flags |= ( (1 << BIO_RW_FAILFAST_DEV) | (1 << BIO_RW_FAILFAST_TRANSPORT) | (1 << BIO_RW_FAILFAST_DRIVER)); -#else -#ifdef HAVE_BIO_RW_FAILFAST - /* BIO_RW_FAILFAST preferred interface from 2.6.12 - 2.6.27 */ - *flags |= (1 << BIO_RW_FAILFAST); -#else -#ifdef HAVE_REQ_FAILFAST_MASK +#elif defined(HAVE_REQ_FAILFAST_MASK) /* * REQ_FAILFAST_* preferred interface from 2.6.36 - 2.6.xx, * the BIO_* and REQ_* flags were unified under REQ_* flags. */ *flags |= REQ_FAILFAST_MASK; -#endif /* HAVE_REQ_FAILFAST_MASK */ -#endif /* HAVE_BIO_RW_FAILFAST */ -#endif /* HAVE_BIO_RW_FAILFAST_DTD */ +#else +#error "Undefined block IO FAILFAST interface." +#endif } /*