X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=include%2Fsys%2Fzfs_context.h;h=6b00a5d5db8051ad2bba436f1705280ead7822bb;hb=bf01b5e6161b4aa94c69792e50de4102a033be09;hp=7bcdc9e98cd55dd0d5d3e896d417bee1b79e09b4;hpb=d96eb2b1538db13ee7a716ec0e1162f5735edc12;p=zfs.git diff --git a/include/sys/zfs_context.h b/include/sys/zfs_context.h index 7bcdc9e..6b00a5d 100644 --- a/include/sys/zfs_context.h +++ b/include/sys/zfs_context.h @@ -24,6 +24,7 @@ */ /* * Copyright 2011 Nexenta Systems, Inc. All rights reserved. + * Copyright (c) 2012, Joyent, Inc. All rights reserved. */ #ifndef _SYS_ZFS_CONTEXT_H @@ -61,6 +62,7 @@ #include #include #include +#include #include #else /* _KERNEL */ @@ -200,6 +202,7 @@ typedef struct proc { } proc_t; extern struct proc p0; +#define curproc (&p0) typedef void (*thread_func_t)(void *); typedef void (*thread_func_arg_t)(void *); @@ -217,7 +220,7 @@ typedef struct kthread { #define thread_exit zk_thread_exit #define thread_create(stk, stksize, func, arg, len, pp, state, pri) \ zk_thread_create(stk, stksize, (thread_func_t)func, arg, \ - len, NULL, state, pri) + len, NULL, state, pri, PTHREAD_CREATE_DETACHED) #define thread_join(t) zk_thread_join(t) #define newproc(f,a,cid,pri,ctp,pid) (ENOSYS) @@ -225,9 +228,12 @@ extern kthread_t *zk_thread_current(void); extern void zk_thread_exit(void); extern kthread_t *zk_thread_create(caddr_t stk, size_t stksize, thread_func_t func, void *arg, size_t len, - proc_t *pp, int state, pri_t pri); + proc_t *pp, int state, pri_t pri, int detachstate); 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) @@ -316,6 +322,7 @@ extern void cv_signal(kcondvar_t *cv); extern void cv_broadcast(kcondvar_t *cv); #define cv_timedwait_interruptible(cv, mp, at) cv_timedwait(cv, mp, at) #define cv_wait_interruptible(cv, mp) cv_wait(cv, mp) +#define cv_wait_io(cv, mp) cv_wait(cv, mp) /* * kstat creation, installation and deletion @@ -384,10 +391,10 @@ typedef struct taskq_ent { #define TASKQ_DYNAMIC 0x0004 /* Use dynamic thread scheduling */ #define TASKQ_THREADS_CPU_PCT 0x0008 /* Scale # threads by # cpus */ #define TASKQ_DC_BATCH 0x0010 /* Mark threads as batch */ -#define TASKQ_NORECLAIM 0x0020 /* Disable direct memory reclaim */ #define TQ_SLEEP KM_SLEEP /* Can block for memory */ #define TQ_NOSLEEP KM_NOSLEEP /* cannot block for memory; may fail */ +#define TQ_PUSHPAGE KM_PUSHPAGE /* Cannot perform I/O */ #define TQ_NOQUEUE 0x02 /* Do not enqueue if can't dispatch */ #define TQ_FRONT 0x08 /* Queue in front */ @@ -489,7 +496,7 @@ typedef struct vsecattr { extern int fop_getattr(vnode_t *vp, vattr_t *vap); -#define VOP_CLOSE(vp, f, c, o, cr, ct) 0 +#define VOP_CLOSE(vp, f, c, o, cr, ct) vn_close(vp) #define VOP_PUTPAGE(vp, of, sz, fl, cr, ct) 0 #define VOP_GETATTR(vp, vap, fl, cr, ct) fop_getattr((vp), (vap));