diff options
Diffstat (limited to 'config')
-rw-r--r-- | config/spl-build.m4 | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/config/spl-build.m4 b/config/spl-build.m4 index 698d51a87..630d67c2d 100644 --- a/config/spl-build.m4 +++ b/config/spl-build.m4 @@ -53,6 +53,8 @@ AC_DEFUN([SPL_AC_CONFIG_KERNEL], [ SPL_AC_INODE_LOCK SPL_AC_GROUP_INFO_GID SPL_AC_KMEM_CACHE_CREATE_USERCOPY + SPL_AC_WAIT_QUEUE_ENTRY_T + SPL_AC_WAIT_QUEUE_HEAD_ENTRY ]) AC_DEFUN([SPL_AC_MODULE_SYMVERS], [ @@ -1670,3 +1672,56 @@ AC_DEFUN([SPL_AC_KMEM_CACHE_CREATE_USERCOPY], [ ]) EXTRA_KCFLAGS="$tmp_flags" ]) + +dnl # +dnl # 4.13 API change +dnl # Renamed struct wait_queue -> struct wait_queue_entry. +dnl # +AC_DEFUN([SPL_AC_WAIT_QUEUE_ENTRY_T], [ + AC_MSG_CHECKING([whether wait_queue_entry_t exists]) + SPL_LINUX_TRY_COMPILE([ + #include <linux/wait.h> + ],[ + wait_queue_entry_t *entry __attribute__ ((unused)); + ],[ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_WAIT_QUEUE_ENTRY_T, 1, + [wait_queue_entry_t exists]) + ],[ + AC_MSG_RESULT(no) + ]) +]) + +dnl # +dnl # 4.13 API change +dnl # Renamed wait_queue_head::task_list -> wait_queue_head::head +dnl # Renamed wait_queue_entry::task_list -> wait_queue_entry::entry +dnl # +AC_DEFUN([SPL_AC_WAIT_QUEUE_HEAD_ENTRY], [ + AC_MSG_CHECKING([whether wq_head->head and wq_entry->entry exist]) + SPL_LINUX_TRY_COMPILE([ + #include <linux/wait.h> + + #ifdef HAVE_WAIT_QUEUE_ENTRY_T + typedef wait_queue_head_t spl_wait_queue_head_t; + typedef wait_queue_entry_t spl_wait_queue_entry_t; + #else + typedef wait_queue_head_t spl_wait_queue_head_t; + typedef wait_queue_t spl_wait_queue_entry_t; + #endif + ],[ + spl_wait_queue_head_t wq_head; + spl_wait_queue_entry_t wq_entry; + struct list_head *head __attribute__ ((unused)); + struct list_head *entry __attribute__ ((unused)); + + head = &wq_head.head; + entry = &wq_entry.entry; + ],[ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_WAIT_QUEUE_HEAD_ENTRY, 1, + [wq_head->head and wq_entry->entry exist]) + ],[ + AC_MSG_RESULT(no) + ]) +]) |