diff options
Diffstat (limited to 'config')
-rw-r--r-- | config/kernel-bio-rw-barrier.m4 | 25 | ||||
-rw-r--r-- | config/kernel-bio-rw-discard.m4 | 25 | ||||
-rw-r--r-- | config/kernel-current_bio_tail.m4 | 33 | ||||
-rw-r--r-- | config/kernel-mk-request-fn.m4 | 43 | ||||
-rw-r--r-- | config/kernel.m4 | 4 |
5 files changed, 130 insertions, 0 deletions
diff --git a/config/kernel-bio-rw-barrier.m4 b/config/kernel-bio-rw-barrier.m4 new file mode 100644 index 000000000..bcf0f7ea0 --- /dev/null +++ b/config/kernel-bio-rw-barrier.m4 @@ -0,0 +1,25 @@ +dnl # +dnl # Interface for issuing a discard bio: +dnl # 2.6.28-2.6.35: BIO_RW_BARRIER +dnl # 2.6.36-3.x: REQ_BARRIER +dnl # + +dnl # Since REQ_BARRIER is a preprocessor definition, there is no need for an +dnl # autotools check for it. Also, REQ_BARRIER existed in the request layer +dnl # until torvalds/linux@7b6d91daee5cac6402186ff224c3af39d79f4a0e unified the +dnl # request layer and bio layer flags, so it would be wrong to assume that +dnl # the APIs are mutually exclusive contrary to the typical case. +AC_DEFUN([ZFS_AC_KERNEL_BIO_RW_BARRIER], [ + AC_MSG_CHECKING([whether BIO_RW_BARRIER is defined]) + ZFS_LINUX_TRY_COMPILE([ + #include <linux/bio.h> + ],[ + int flags __attribute__ ((unused)); + flags = BIO_RW_BARRIER; + ],[ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_BIO_RW_BARRIER, 1, [BIO_RW_BARRIER is defined]) + ],[ + AC_MSG_RESULT(no) + ]) +]) diff --git a/config/kernel-bio-rw-discard.m4 b/config/kernel-bio-rw-discard.m4 new file mode 100644 index 000000000..0554b9a9d --- /dev/null +++ b/config/kernel-bio-rw-discard.m4 @@ -0,0 +1,25 @@ +dnl # +dnl # Interface for issuing a discard bio: +dnl # 2.6.28-2.6.35: BIO_RW_DISCARD +dnl # 2.6.36-3.x: REQ_DISCARD +dnl # + +dnl # Since REQ_DISCARD is a preprocessor definition, there is no need for an +dnl # autotools check for it. Also, REQ_DISCARD existed in the request layer +dnl # until torvalds/linux@7b6d91daee5cac6402186ff224c3af39d79f4a0e unified the +dnl # request layer and bio layer flags, so it would be wrong to assume that +dnl # the APIs are mutually exclusive contrary to the typical case. +AC_DEFUN([ZFS_AC_KERNEL_BIO_RW_DISCARD], [ + AC_MSG_CHECKING([whether BIO_RW_DISCARD is defined]) + ZFS_LINUX_TRY_COMPILE([ + #include <linux/bio.h> + ],[ + int flags __attribute__ ((unused)); + flags = BIO_RW_DISCARD; + ],[ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_BIO_RW_DISCARD, 1, [BIO_RW_DISCARD is defined]) + ],[ + AC_MSG_RESULT(no) + ]) +]) diff --git a/config/kernel-current_bio_tail.m4 b/config/kernel-current_bio_tail.m4 new file mode 100644 index 000000000..b72f21e8a --- /dev/null +++ b/config/kernel-current_bio_tail.m4 @@ -0,0 +1,33 @@ +dnl # +dnl # 2.6.34 API change +dnl # current->bio_tail and current->bio_list were struct bio pointers prior to +dnl # Linux 2.6.34. They were refactored into a struct bio_list pointer called +dnl # current->bio_list in Linux 2.6.34. +dnl # +AC_DEFUN([ZFS_AC_KERNEL_CURRENT_BIO_TAIL], [ + AC_MSG_CHECKING([whether current->bio_tail exists]) + ZFS_LINUX_TRY_COMPILE([ + #include <linux/sched.h> + ],[ + current->bio_tail = (struct bio **) NULL; + ],[ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_CURRENT_BIO_TAIL, 1, + [current->bio_tail exists]) + ],[ + AC_MSG_RESULT(no) + AC_MSG_CHECKING([whether current->bio_list exists]) + ZFS_LINUX_TRY_COMPILE([ + #include <linux/sched.h> + ],[ + current->bio_list = (struct bio_list *) NULL; + ],[ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_CURRENT_BIO_LIST, 1, + [current->bio_list exists]) + ],[ + AC_MSG_ERROR(no - Please file a bug report at + https://github.com/zfsonlinux/zfs/issues/new) + ]) + ]) +]) diff --git a/config/kernel-mk-request-fn.m4 b/config/kernel-mk-request-fn.m4 new file mode 100644 index 000000000..88ee2ebb3 --- /dev/null +++ b/config/kernel-mk-request-fn.m4 @@ -0,0 +1,43 @@ +dnl # +dnl # Linux 3.2 API Change +dnl # make_request_fn returns void instead of int. +dnl # +AC_DEFUN([ZFS_AC_KERNEL_MAKE_REQUEST_FN], [ + AC_MSG_CHECKING([whether make_request_fn() returns int]) + ZFS_LINUX_TRY_COMPILE([ + #include <linux/blkdev.h> + + int make_request(struct request_queue *q, struct bio *bio) + { + return (0); + } + ],[ + blk_queue_make_request(NULL, &make_request); + ],[ + AC_MSG_RESULT(yes) + AC_DEFINE(MAKE_REQUEST_FN_RET, int, + [make_request_fn() returns int]) + AC_DEFINE(HAVE_MAKE_REQUEST_FN_RET_INT, 1, + [Noting that make_request_fn() returns int]) + ],[ + AC_MSG_RESULT(no) + AC_MSG_CHECKING([whether make_request_fn() returns void]) + ZFS_LINUX_TRY_COMPILE([ + #include <linux/blkdev.h> + + void make_request(struct request_queue *q, struct bio *bio) + { + return; + } + ],[ + blk_queue_make_request(NULL, &make_request); + ],[ + AC_MSG_RESULT(yes) + AC_DEFINE(MAKE_REQUEST_FN_RET, void, + [make_request_fn() returns void]) + ],[ + AC_MSG_ERROR(no - Please file a bug report at + https://github.com/zfsonlinux/zfs/issues/new) + ]) + ]) +]) diff --git a/config/kernel.m4 b/config/kernel.m4 index 09d8003f1..b3dd7232c 100644 --- a/config/kernel.m4 +++ b/config/kernel.m4 @@ -7,6 +7,7 @@ AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [ ZFS_AC_TEST_MODULE ZFS_AC_KERNEL_CONFIG ZFS_AC_KERNEL_DECLARE_EVENT_CLASS + ZFS_AC_KERNEL_CURRENT_BIO_TAIL ZFS_AC_KERNEL_BDEV_BLOCK_DEVICE_OPERATIONS ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS_RELEASE_VOID ZFS_AC_KERNEL_TYPE_FMODE_T @@ -22,6 +23,8 @@ AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [ ZFS_AC_KERNEL_BIO_FAILFAST_DTD ZFS_AC_KERNEL_REQ_FAILFAST_MASK ZFS_AC_KERNEL_BIO_END_IO_T_ARGS + ZFS_AC_KERNEL_BIO_RW_BARRIER + ZFS_AC_KERNEL_BIO_RW_DISCARD ZFS_AC_KERNEL_BIO_RW_SYNC ZFS_AC_KERNEL_BIO_RW_SYNCIO ZFS_AC_KERNEL_REQ_SYNC @@ -100,6 +103,7 @@ AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [ ZFS_AC_KERNEL_VFS_RW_ITERATE ZFS_AC_KERNEL_KMAP_ATOMIC_ARGS ZFS_AC_KERNEL_FOLLOW_DOWN_ONE + ZFS_AC_KERNEL_MAKE_REQUEST_FN AS_IF([test "$LINUX_OBJ" != "$LINUX"], [ KERNELMAKE_PARAMS="$KERNELMAKE_PARAMS O=$LINUX_OBJ" |