X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=include%2Fsys%2Fzfs_context.h;h=98b216fd7f78ccdf4a81da5b4a3c6715ece0b9d0;hb=395350c85d9903beba43bac7ae79092ae25f1526;hp=2ac41e007e6481b3002705391e091935d5c8f6a9;hpb=e88b041ed6a7ce358df25a7af057ea5c76dd1c2a;p=zfs.git diff --git a/include/sys/zfs_context.h b/include/sys/zfs_context.h index 2ac41e0..98b216f 100644 --- a/include/sys/zfs_context.h +++ b/include/sys/zfs_context.h @@ -22,6 +22,9 @@ * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ +/* + * Copyright 2011 Nexenta Systems, Inc. All rights reserved. + */ #ifndef _SYS_ZFS_CONTEXT_H #define _SYS_ZFS_CONTEXT_H @@ -57,6 +60,8 @@ #include #include #include +#include +#include #include #else /* _KERNEL */ @@ -89,6 +94,7 @@ #include #include #include +#include #include #include #include @@ -131,10 +137,9 @@ extern int aok; * ZFS debugging */ -#ifdef ZFS_DEBUG extern void dprintf_setup(int *argc, char **argv); -#endif /* ZFS_DEBUG */ - +extern void __dprintf(const char *file, const char *func, + int line, const char *fmt, ...); extern void cmn_err(int, const char *, ...); extern void vcmn_err(int, const char *, __va_list); extern void panic(const char *, ...); @@ -224,6 +229,9 @@ extern kthread_t *zk_thread_create(caddr_t stk, size_t stksize, proc_t *pp, int state, pri_t pri); extern void zk_thread_join(kt_did_t tid); +#define kpreempt_disable() ((void)0) +#define kpreempt_enable() ((void)0) + #define PS_NONE -1 #define issig(why) (FALSE) @@ -329,6 +337,8 @@ extern void kstat_delete(kstat_t *); #define KM_NOSLEEP UMEM_DEFAULT #define KM_NODEBUG 0x0 #define KMC_NODEBUG UMC_NODEBUG +#define KMC_KMEM 0x0 +#define KMC_VMEM 0x0 #define kmem_alloc(_s, _f) umem_alloc(_s, _f) #define kmem_zalloc(_s, _f) umem_zalloc(_s, _f) #define kmem_free(_b, _s) umem_free(_b, _s) @@ -363,6 +373,16 @@ typedef struct taskq taskq_t; typedef uintptr_t taskqid_t; typedef void (task_func_t)(void *); +typedef struct taskq_ent { + struct taskq_ent *tqent_next; + struct taskq_ent *tqent_prev; + task_func_t *tqent_func; + void *tqent_arg; + uintptr_t tqent_flags; +} taskq_ent_t; + +#define TQENT_FLAG_PREALLOC 0x1 /* taskq_dispatch_ent used */ + #define TASKQ_PREPOPULATE 0x0001 #define TASKQ_CPR_SAFE 0x0002 /* Use CPR safe protocol */ #define TASKQ_DYNAMIC 0x0004 /* Use dynamic thread scheduling */ @@ -382,6 +402,10 @@ extern taskq_t *taskq_create(const char *, int, pri_t, int, int, uint_t); #define taskq_create_sysdc(a, b, d, e, p, dc, f) \ (taskq_create(a, b, maxclsyspri, d, e, f)) extern taskqid_t taskq_dispatch(taskq_t *, task_func_t, void *, uint_t); +extern void taskq_dispatch_ent(taskq_t *, task_func_t, void *, uint_t, + taskq_ent_t *); +extern int taskq_empty_ent(taskq_ent_t *); +extern void taskq_init_ent(taskq_ent_t *); extern void taskq_destroy(taskq_t *); extern void taskq_wait(taskq_t *); extern int taskq_member(taskq_t *, kthread_t *);