mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-19 19:51:27 +00:00
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
This commit is contained in:
@@ -37,6 +37,7 @@
|
||||
#include <linux/stddef.h> /* sizeof_field() */
|
||||
#include <linux/timer.h>
|
||||
#include <linux/vmalloc.h>
|
||||
#include <linux/workqueue.h>
|
||||
#include <linux/writeback.h> /* sync_page_range() */
|
||||
#include <rdma/ib_verbs.h>
|
||||
#include <scsi/scsi_cmnd.h> /* struct scsi_cmnd */
|
||||
@@ -1456,6 +1457,22 @@ static inline void *vzalloc(unsigned long size)
|
||||
}
|
||||
#endif
|
||||
|
||||
/* <linux/workqueue.h> */
|
||||
|
||||
#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
|
||||
|
||||
/* <scsi/scsi_cmnd.h> */
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24) || \
|
||||
|
||||
Reference in New Issue
Block a user