summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2017-07-23 19:32:14 -0700
committerGitHub <[email protected]>2017-07-23 19:32:14 -0700
commit944117514d2aba081b15faad741e7d0c6b1465c8 (patch)
tree242f2062a1aa5654ad4e6f13cea7bda60eb29106 /include
parentae42190b7917d5aaa8ec0c0951ff65e8df6fa601 (diff)
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 <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #629
Diffstat (limited to 'include')
-rw-r--r--include/linux/wait_compat.h9
-rw-r--r--include/sys/condvar.h6
-rw-r--r--include/sys/kmem_cache.h2
-rw-r--r--include/sys/taskq.h7
4 files changed, 17 insertions, 7 deletions
diff --git a/include/linux/wait_compat.h b/include/linux/wait_compat.h
index d8cd09b9e..445a73c68 100644
--- a/include/linux/wait_compat.h
+++ b/include/linux/wait_compat.h
@@ -26,6 +26,7 @@
#define _SPL_WAIT_COMPAT_H
#include <linux/sched.h>
+#include <linux/wait.h>
#ifndef HAVE_WAIT_ON_BIT_ACTION
# define spl_wait_on_bit(word, bit, mode) wait_on_bit(word, bit, mode)
@@ -43,4 +44,12 @@ spl_bit_wait(void *word)
#endif /* HAVE_WAIT_ON_BIT_ACTION */
+#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
+
#endif /* SPL_WAIT_COMPAT_H */
diff --git a/include/sys/condvar.h b/include/sys/condvar.h
index 9b55449ae..5479e75ad 100644
--- a/include/sys/condvar.h
+++ b/include/sys/condvar.h
@@ -26,7 +26,7 @@
#define _SPL_CONDVAR_H
#include <linux/module.h>
-#include <linux/wait.h>
+#include <linux/wait_compat.h>
#include <linux/delay_compat.h>
#include <sys/kmem.h>
#include <sys/mutex.h>
@@ -41,8 +41,8 @@
typedef struct {
int cv_magic;
- wait_queue_head_t cv_event;
- wait_queue_head_t cv_destroy;
+ spl_wait_queue_head_t cv_event;
+ spl_wait_queue_head_t cv_destroy;
atomic_t cv_refs;
atomic_t cv_waiters;
kmutex_t *cv_mutex;
diff --git a/include/sys/kmem_cache.h b/include/sys/kmem_cache.h
index e971c2b0d..8fa14f67e 100644
--- a/include/sys/kmem_cache.h
+++ b/include/sys/kmem_cache.h
@@ -193,7 +193,7 @@ typedef struct spl_kmem_cache {
struct list_head skc_partial_list; /* Partially alloc'ed */
struct rb_root skc_emergency_tree; /* Min sized objects */
spinlock_t skc_lock; /* Cache lock */
- wait_queue_head_t skc_waitq; /* Allocation waiters */
+ spl_wait_queue_head_t skc_waitq; /* Allocation waiters */
uint64_t skc_slab_fail; /* Slab alloc failures */
uint64_t skc_slab_create; /* Slab creates */
uint64_t skc_slab_destroy; /* Slab destroys */
diff --git a/include/sys/taskq.h b/include/sys/taskq.h
index 5adda8827..c5ccec715 100644
--- a/include/sys/taskq.h
+++ b/include/sys/taskq.h
@@ -30,6 +30,7 @@
#include <linux/slab.h>
#include <linux/interrupt.h>
#include <linux/kthread.h>
+#include <linux/wait_compat.h>
#include <sys/types.h>
#include <sys/thread.h>
#include <sys/rwlock.h>
@@ -96,14 +97,14 @@ typedef struct taskq {
struct list_head tq_prio_list; /* priority pending taskq_ent_t's */
struct list_head tq_delay_list; /* delayed taskq_ent_t's */
struct list_head tq_taskqs; /* all taskq_t's */
- wait_queue_head_t tq_work_waitq; /* new work waitq */
- wait_queue_head_t tq_wait_waitq; /* wait waitq */
+ spl_wait_queue_head_t tq_work_waitq; /* new work waitq */
+ spl_wait_queue_head_t tq_wait_waitq; /* wait waitq */
tq_lock_role_t tq_lock_class; /* class when taking tq_lock */
} taskq_t;
typedef struct taskq_ent {
spinlock_t tqent_lock;
- wait_queue_head_t tqent_waitq;
+ spl_wait_queue_head_t tqent_waitq;
struct timer_list tqent_timer;
struct list_head tqent_list;
taskqid_t tqent_id;