From 5bb43cdb3135beef85654ab56a46c76f3879d641 Mon Sep 17 00:00:00 2001 From: hselasky Date: Mon, 19 Oct 2015 10:49:15 +0000 Subject: [PATCH] Merge LinuxKPI changes from DragonflyBSD: - Some minor whitespace fixes. - Added support for two new Linux functions. Sponsored by: Mellanox Technologies --- sys/ofed/include/linux/workqueue.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sys/ofed/include/linux/workqueue.h b/sys/ofed/include/linux/workqueue.h index 075016ad5a35..3f2c7fe55693 100644 --- a/sys/ofed/include/linux/workqueue.h +++ b/sys/ofed/include/linux/workqueue.h @@ -91,11 +91,11 @@ do { \ #define flush_scheduled_work() flush_taskqueue(taskqueue_thread) -static inline int queue_work (struct workqueue_struct *q, struct work_struct *work) +static inline int queue_work(struct workqueue_struct *q, struct work_struct *work) { (work)->taskqueue = (q)->taskqueue; /* Return opposite val to align with Linux logic */ - return !taskqueue_enqueue((q)->taskqueue, &(work)->work_task); + return !taskqueue_enqueue((q)->taskqueue, &(work)->work_task); } static inline void @@ -151,6 +151,12 @@ _create_workqueue_common(char *name, int cpus) #define create_workqueue(name) \ _create_workqueue_common(name, MAXCPU) +#define alloc_ordered_workqueue(name, flags) \ + _create_workqueue_common(name, 1) + +#define alloc_workqueue(name, flags, max_active) \ + _create_workqueue_common(name, max_active) + static inline void destroy_workqueue(struct workqueue_struct *wq) {