mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
taskq style, convert spaces to soft tabs
Update the taskq implementation to conform with the style used throughout the rest of the code. There are no functional changes in this commit. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
This commit is contained in:
+61
-59
@@ -33,71 +33,71 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/thread.h>
|
||||
|
||||
#define TASKQ_NAMELEN 31
|
||||
#define TASKQ_NAMELEN 31
|
||||
|
||||
#define TASKQ_PREPOPULATE 0x00000001
|
||||
#define TASKQ_CPR_SAFE 0x00000002
|
||||
#define TASKQ_DYNAMIC 0x00000004
|
||||
#define TASKQ_THREADS_CPU_PCT 0x00000008
|
||||
#define TASKQ_DC_BATCH 0x00000010
|
||||
#define TASKQ_PREPOPULATE 0x00000001
|
||||
#define TASKQ_CPR_SAFE 0x00000002
|
||||
#define TASKQ_DYNAMIC 0x00000004
|
||||
#define TASKQ_THREADS_CPU_PCT 0x00000008
|
||||
#define TASKQ_DC_BATCH 0x00000010
|
||||
|
||||
typedef unsigned long taskqid_t;
|
||||
typedef void (task_func_t)(void *);
|
||||
|
||||
typedef struct taskq_ent {
|
||||
spinlock_t tqent_lock;
|
||||
struct list_head tqent_list;
|
||||
taskqid_t tqent_id;
|
||||
task_func_t *tqent_func;
|
||||
void *tqent_arg;
|
||||
uintptr_t tqent_flags;
|
||||
spinlock_t tqent_lock;
|
||||
struct list_head tqent_list;
|
||||
taskqid_t tqent_id;
|
||||
task_func_t *tqent_func;
|
||||
void *tqent_arg;
|
||||
uintptr_t tqent_flags;
|
||||
} taskq_ent_t;
|
||||
|
||||
#define TQENT_FLAG_PREALLOC 0x1
|
||||
#define TQENT_FLAG_PREALLOC 0x1
|
||||
|
||||
/*
|
||||
* Flags for taskq_dispatch. TQ_SLEEP/TQ_NOSLEEP should be same as
|
||||
* KM_SLEEP/KM_NOSLEEP. TQ_NOQUEUE/TQ_NOALLOC are set particularly
|
||||
* large so as not to conflict with already used GFP_* defines.
|
||||
*/
|
||||
#define TQ_SLEEP 0x00000000
|
||||
#define TQ_NOSLEEP 0x00000001
|
||||
#define TQ_PUSHPAGE 0x00000002
|
||||
#define TQ_NOQUEUE 0x01000000
|
||||
#define TQ_NOALLOC 0x02000000
|
||||
#define TQ_NEW 0x04000000
|
||||
#define TQ_FRONT 0x08000000
|
||||
#define TQ_ACTIVE 0x80000000
|
||||
#define TQ_SLEEP 0x00000000
|
||||
#define TQ_NOSLEEP 0x00000001
|
||||
#define TQ_PUSHPAGE 0x00000002
|
||||
#define TQ_NOQUEUE 0x01000000
|
||||
#define TQ_NOALLOC 0x02000000
|
||||
#define TQ_NEW 0x04000000
|
||||
#define TQ_FRONT 0x08000000
|
||||
#define TQ_ACTIVE 0x80000000
|
||||
|
||||
typedef struct taskq {
|
||||
spinlock_t tq_lock; /* protects taskq_t */
|
||||
unsigned long tq_lock_flags; /* interrupt state */
|
||||
const char *tq_name; /* taskq name */
|
||||
struct list_head tq_thread_list;/* list of all threads */
|
||||
struct list_head tq_active_list;/* list of active threads */
|
||||
int tq_nactive; /* # of active threads */
|
||||
int tq_nthreads; /* # of total threads */
|
||||
int tq_pri; /* priority */
|
||||
int tq_minalloc; /* min task_t pool size */
|
||||
int tq_maxalloc; /* max task_t pool size */
|
||||
int tq_nalloc; /* cur task_t pool size */
|
||||
uint_t tq_flags; /* flags */
|
||||
taskqid_t tq_next_id; /* next pend/work id */
|
||||
taskqid_t tq_lowest_id; /* lowest pend/work id */
|
||||
struct list_head tq_free_list; /* free task_t's */
|
||||
struct list_head tq_pend_list; /* pending task_t's */
|
||||
struct list_head tq_prio_list; /* priority pending task_t's */
|
||||
wait_queue_head_t tq_work_waitq; /* new work waitq */
|
||||
wait_queue_head_t tq_wait_waitq; /* wait waitq */
|
||||
spinlock_t tq_lock; /* protects taskq_t */
|
||||
unsigned long tq_lock_flags; /* interrupt state */
|
||||
const char *tq_name; /* taskq name */
|
||||
struct list_head tq_thread_list;/* list of all threads */
|
||||
struct list_head tq_active_list;/* list of active threads */
|
||||
int tq_nactive; /* # of active threads */
|
||||
int tq_nthreads; /* # of total threads */
|
||||
int tq_pri; /* priority */
|
||||
int tq_minalloc; /* min task_t pool size */
|
||||
int tq_maxalloc; /* max task_t pool size */
|
||||
int tq_nalloc; /* cur task_t pool size */
|
||||
uint_t tq_flags; /* flags */
|
||||
taskqid_t tq_next_id; /* next pend/work id */
|
||||
taskqid_t tq_lowest_id; /* lowest pend/work id */
|
||||
struct list_head tq_free_list; /* free task_t's */
|
||||
struct list_head tq_pend_list; /* pending task_t's */
|
||||
struct list_head tq_prio_list; /* priority pending task_t's */
|
||||
wait_queue_head_t tq_work_waitq; /* new work waitq */
|
||||
wait_queue_head_t tq_wait_waitq; /* wait waitq */
|
||||
} taskq_t;
|
||||
|
||||
typedef struct taskq_thread {
|
||||
struct list_head tqt_thread_list;
|
||||
struct list_head tqt_active_list;
|
||||
struct task_struct *tqt_thread;
|
||||
taskq_t *tqt_tq;
|
||||
taskqid_t tqt_id;
|
||||
uintptr_t tqt_flags;
|
||||
struct list_head tqt_thread_list;
|
||||
struct list_head tqt_active_list;
|
||||
struct task_struct *tqt_thread;
|
||||
taskq_t *tqt_tq;
|
||||
taskqid_t tqt_id;
|
||||
uintptr_t tqt_flags;
|
||||
} taskq_thread_t;
|
||||
|
||||
/* Global system-wide dynamic task queue available for all consumers */
|
||||
@@ -116,18 +116,20 @@ extern int __taskq_member(taskq_t *, void *);
|
||||
int spl_taskq_init(void);
|
||||
void spl_taskq_fini(void);
|
||||
|
||||
#define taskq_member(tq, t) __taskq_member(tq, t)
|
||||
#define taskq_wait_id(tq, id) __taskq_wait_id(tq, id)
|
||||
#define taskq_wait(tq) __taskq_wait(tq)
|
||||
#define taskq_dispatch(tq, f, p, fl) __taskq_dispatch(tq, f, p, fl)
|
||||
#define taskq_dispatch_ent(tq, f, p, fl, t) __taskq_dispatch_ent(tq, f, p, fl, t)
|
||||
#define taskq_empty_ent(t) __taskq_empty_ent(t)
|
||||
#define taskq_init_ent(t) __taskq_init_ent(t)
|
||||
#define taskq_create(n, th, p, mi, ma, fl) __taskq_create(n, th, p, mi, ma, fl)
|
||||
#define taskq_create_proc(n, th, p, mi, ma, pr, fl) \
|
||||
__taskq_create(n, th, p, mi, ma, fl)
|
||||
#define taskq_create_sysdc(n, th, mi, ma, pr, dc, fl) \
|
||||
__taskq_create(n, th, maxclsyspri, mi, ma, fl)
|
||||
#define taskq_destroy(tq) __taskq_destroy(tq)
|
||||
#define taskq_member(tq, t) __taskq_member(tq, t)
|
||||
#define taskq_wait_id(tq, id) __taskq_wait_id(tq, id)
|
||||
#define taskq_wait(tq) __taskq_wait(tq)
|
||||
#define taskq_dispatch(tq, f, p, fl) __taskq_dispatch(tq, f, p, fl)
|
||||
#define taskq_dispatch_ent(tq, f, p, fl, t) \
|
||||
__taskq_dispatch_ent(tq, f, p, fl, t)
|
||||
#define taskq_empty_ent(t) __taskq_empty_ent(t)
|
||||
#define taskq_init_ent(t) __taskq_init_ent(t)
|
||||
#define taskq_create(n, th, p, mi, ma, fl) \
|
||||
__taskq_create(n, th, p, mi, ma, fl)
|
||||
#define taskq_create_proc(n, th, p, mi, ma, pr, fl) \
|
||||
__taskq_create(n, th, p, mi, ma, fl)
|
||||
#define taskq_create_sysdc(n, th, mi, ma, pr, dc, fl) \
|
||||
__taskq_create(n, th, maxclsyspri, mi, ma, fl)
|
||||
#define taskq_destroy(tq) __taskq_destroy(tq)
|
||||
|
||||
#endif /* _SPL_TASKQ_H */
|
||||
|
||||
Reference in New Issue
Block a user