Linux 4.13 compat: wait queues

Commit torvalds/linux@ac6424b9
- Renamed struct wait_queue -> struct wait_queue_entry.

Commit torvalds/linux@2055da97
- Renamed wait_queue_head::task_list -> wait_queue_head::head
- Renamed wait_queue_entry::task_list -> wait_queue_entry::entry

Reviewed-by: Chunwei Chen <david.chen@osnexus.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #629
This commit is contained in:
Brian Behlendorf
2017-07-23 19:32:14 -07:00
committed by GitHub
parent ae42190b79
commit 944117514d
10 changed files with 91 additions and 14 deletions
+55
View File
@@ -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)
])
])