From ef1b78ba49fdb1055c8d999e5efee8b6ce660d6c Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Tue, 2 Apr 2019 04:09:54 +0000 Subject: [PATCH] scst/include/backport.h: Add an alloc_workqueue() backport git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8130 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/include/backport.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/scst/include/backport.h b/scst/include/backport.h index 9c636c5a5..576d7d65b 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -37,6 +37,7 @@ #include /* sizeof_field() */ #include #include +#include #include /* sync_page_range() */ #include #include /* struct scsi_cmnd */ @@ -1456,6 +1457,22 @@ static inline void *vzalloc(unsigned long size) } #endif +/* */ + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 36) +/* + * See also commit d320c03830b1 ("workqueue: s/__create_workqueue()/ + * alloc_workqueue()/, and add system workqueues") # v2.6.36. + */ +static inline struct workqueue_struct *alloc_workqueue(const char *fmt, + unsigned int flags, + int max_active, ...) +{ + WARN_ON_ONCE(flags | max_active); + return create_workqueue(fmt); +} +#endif + /* */ #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24) || \