]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h
MFV: tcpdump 4.3.0.
[FreeBSD/FreeBSD.git] / cddl / contrib / opensolaris / lib / libzpool / common / sys / zfs_context.h
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
23  * Copyright (c) 2012, Joyent, Inc. All rights reserved.
24  */
25
26 #ifndef _SYS_ZFS_CONTEXT_H
27 #define _SYS_ZFS_CONTEXT_H
28
29 #ifdef  __cplusplus
30 extern "C" {
31 #endif
32
33 #define _SYS_MUTEX_H
34 #define _SYS_RWLOCK_H
35 #define _SYS_CONDVAR_H
36 #define _SYS_SYSTM_H
37 #define _SYS_T_LOCK_H
38 #define _SYS_VNODE_H
39 #define _SYS_VFS_H
40 #define _SYS_SUNDDI_H
41 #define _SYS_CALLB_H
42 #define _SYS_SCHED_H_
43
44 #include <solaris.h>
45 #include <stdio.h>
46 #include <stdlib.h>
47 #include <stddef.h>
48 #include <stdarg.h>
49 #include <fcntl.h>
50 #include <unistd.h>
51 #include <errno.h>
52 #include <string.h>
53 #include <strings.h>
54 #include <thread.h>
55 #include <assert.h>
56 #include <limits.h>
57 #include <dirent.h>
58 #include <time.h>
59 #include <math.h>
60 #include <umem.h>
61 #include <inttypes.h>
62 #include <fsshare.h>
63 #include <sys/note.h>
64 #include <sys/types.h>
65 #include <sys/cred.h>
66 #include <sys/atomic.h>
67 #include <sys/sysmacros.h>
68 #include <sys/bitmap.h>
69 #include <sys/resource.h>
70 #include <sys/byteorder.h>
71 #include <sys/list.h>
72 #include <sys/time.h>
73 #include <sys/uio.h>
74 #include <sys/mntent.h>
75 #include <sys/mnttab.h>
76 #include <sys/zfs_debug.h>
77 #include <sys/sdt.h>
78 #include <sys/kstat.h>
79 #include <sys/u8_textprep.h>
80 #include <sys/kernel.h>
81 #include <sys/disk.h>
82 #include <sys/sysevent.h>
83 #include <sys/sysevent/eventdefs.h>
84 #include <sys/sysevent/dev.h>
85 #include <machine/atomic.h>
86 #include <sys/debug.h>
87
88 #define ZFS_EXPORTS_PATH        "/etc/zfs/exports"
89
90 /*
91  * Debugging
92  */
93
94 /*
95  * Note that we are not using the debugging levels.
96  */
97
98 #define CE_CONT         0       /* continuation         */
99 #define CE_NOTE         1       /* notice               */
100 #define CE_WARN         2       /* warning              */
101 #define CE_PANIC        3       /* panic                */
102 #define CE_IGNORE       4       /* print nothing        */
103
104 /*
105  * ZFS debugging
106  */
107
108 #define ZFS_LOG(...)    do {  } while (0)
109
110 typedef u_longlong_t      rlim64_t;
111 #define RLIM64_INFINITY ((rlim64_t)-3)
112
113 #ifdef ZFS_DEBUG
114 extern void dprintf_setup(int *argc, char **argv);
115 #endif /* ZFS_DEBUG */
116
117 extern void cmn_err(int, const char *, ...);
118 extern void vcmn_err(int, const char *, __va_list);
119 extern void panic(const char *, ...);
120 extern void vpanic(const char *, __va_list);
121
122 #define fm_panic        panic
123
124 extern int aok;
125
126 /*
127  * DTrace SDT probes have different signatures in userland than they do in
128  * kernel.  If they're being used in kernel code, re-define them out of
129  * existence for their counterparts in libzpool.
130  */
131
132 #ifdef DTRACE_PROBE
133 #undef  DTRACE_PROBE
134 #define DTRACE_PROBE(a) ((void)0)
135 #endif  /* DTRACE_PROBE */
136
137 #ifdef DTRACE_PROBE1
138 #undef  DTRACE_PROBE1
139 #define DTRACE_PROBE1(a, b, c)  ((void)0)
140 #endif  /* DTRACE_PROBE1 */
141
142 #ifdef DTRACE_PROBE2
143 #undef  DTRACE_PROBE2
144 #define DTRACE_PROBE2(a, b, c, d, e)    ((void)0)
145 #endif  /* DTRACE_PROBE2 */
146
147 #ifdef DTRACE_PROBE3
148 #undef  DTRACE_PROBE3
149 #define DTRACE_PROBE3(a, b, c, d, e, f, g)      ((void)0)
150 #endif  /* DTRACE_PROBE3 */
151
152 #ifdef DTRACE_PROBE4
153 #undef  DTRACE_PROBE4
154 #define DTRACE_PROBE4(a, b, c, d, e, f, g, h, i)        ((void)0)
155 #endif  /* DTRACE_PROBE4 */
156
157 /*
158  * Threads
159  */
160 #define curthread       ((void *)(uintptr_t)thr_self())
161
162 typedef struct kthread kthread_t;
163
164 #define thread_create(stk, stksize, func, arg, len, pp, state, pri)     \
165         zk_thread_create(func, arg)
166 #define thread_exit() thr_exit(NULL)
167 #define thread_join(t)  panic("libzpool cannot join threads")
168
169 #define newproc(f, a, cid, pri, ctp, pid)       (ENOSYS)
170
171 /* in libzpool, p0 exists only to have its address taken */
172 struct proc {
173         uintptr_t       this_is_never_used_dont_dereference_it;
174 };
175
176 extern struct proc p0;
177 #define curproc         (&p0)
178
179 #define PS_NONE         -1
180
181 extern kthread_t *zk_thread_create(void (*func)(), void *arg);
182
183 #define issig(why)      (FALSE)
184 #define ISSIG(thr, why) (FALSE)
185
186 /*
187  * Mutexes
188  */
189 typedef struct kmutex {
190         void            *m_owner;
191         boolean_t       initialized;
192         mutex_t         m_lock;
193 } kmutex_t;
194
195 #define MUTEX_DEFAULT   USYNC_THREAD
196 #undef  MUTEX_HELD
197 #undef  MUTEX_NOT_HELD
198 #define MUTEX_HELD(m)   ((m)->m_owner == curthread)
199 #define MUTEX_NOT_HELD(m) (!MUTEX_HELD(m))
200 #define _mutex_held(m)  pthread_mutex_isowned_np(m)
201
202 /*
203  * Argh -- we have to get cheesy here because the kernel and userland
204  * have different signatures for the same routine.
205  */
206 //extern int _mutex_init(mutex_t *mp, int type, void *arg);
207 //extern int _mutex_destroy(mutex_t *mp);
208 //extern int _mutex_owned(mutex_t *mp);
209
210 #define mutex_init(mp, b, c, d)         zmutex_init((kmutex_t *)(mp))
211 #define mutex_destroy(mp)               zmutex_destroy((kmutex_t *)(mp))
212 #define mutex_owned(mp)                 zmutex_owned((kmutex_t *)(mp))
213
214 extern void zmutex_init(kmutex_t *mp);
215 extern void zmutex_destroy(kmutex_t *mp);
216 extern int zmutex_owned(kmutex_t *mp);
217 extern void mutex_enter(kmutex_t *mp);
218 extern void mutex_exit(kmutex_t *mp);
219 extern int mutex_tryenter(kmutex_t *mp);
220 extern void *mutex_owner(kmutex_t *mp);
221
222 /*
223  * RW locks
224  */
225 typedef struct krwlock {
226         int             rw_count;
227         void            *rw_owner;
228         boolean_t       initialized;
229         rwlock_t        rw_lock;
230 } krwlock_t;
231
232 typedef int krw_t;
233
234 #define RW_READER       0
235 #define RW_WRITER       1
236 #define RW_DEFAULT      USYNC_THREAD
237
238 #undef RW_READ_HELD
239 #define RW_READ_HELD(x)         ((x)->rw_owner == NULL && (x)->rw_count > 0)
240
241 #undef RW_WRITE_HELD
242 #define RW_WRITE_HELD(x)        ((x)->rw_owner == curthread)
243 #define RW_LOCK_HELD(x)         rw_lock_held(x)
244
245 extern void rw_init(krwlock_t *rwlp, char *name, int type, void *arg);
246 extern void rw_destroy(krwlock_t *rwlp);
247 extern void rw_enter(krwlock_t *rwlp, krw_t rw);
248 extern int rw_tryenter(krwlock_t *rwlp, krw_t rw);
249 extern int rw_tryupgrade(krwlock_t *rwlp);
250 extern void rw_exit(krwlock_t *rwlp);
251 extern int rw_lock_held(krwlock_t *rwlp);
252 #define rw_downgrade(rwlp) do { } while (0)
253
254 extern uid_t crgetuid(cred_t *cr);
255 extern gid_t crgetgid(cred_t *cr);
256 extern int crgetngroups(cred_t *cr);
257 extern gid_t *crgetgroups(cred_t *cr);
258
259 /*
260  * Condition variables
261  */
262 typedef cond_t kcondvar_t;
263
264 #define CV_DEFAULT      USYNC_THREAD
265
266 extern void cv_init(kcondvar_t *cv, char *name, int type, void *arg);
267 extern void cv_destroy(kcondvar_t *cv);
268 extern void cv_wait(kcondvar_t *cv, kmutex_t *mp);
269 extern clock_t cv_timedwait(kcondvar_t *cv, kmutex_t *mp, clock_t abstime);
270 extern void cv_signal(kcondvar_t *cv);
271 extern void cv_broadcast(kcondvar_t *cv);
272
273 /*
274  * Kernel memory
275  */
276 #define KM_SLEEP                UMEM_NOFAIL
277 #define KM_PUSHPAGE             KM_SLEEP
278 #define KM_NOSLEEP              UMEM_DEFAULT
279 #define KMC_NODEBUG             UMC_NODEBUG
280 #define KMC_NOTOUCH             0       /* not needed for userland caches */
281 #define KM_NODEBUG              0
282 #define kmem_alloc(_s, _f)      umem_alloc(_s, _f)
283 #define kmem_zalloc(_s, _f)     umem_zalloc(_s, _f)
284 #define kmem_free(_b, _s)       umem_free(_b, _s)
285 #define kmem_size()             (physmem * PAGESIZE)
286 #define kmem_cache_create(_a, _b, _c, _d, _e, _f, _g, _h, _i) \
287         umem_cache_create(_a, _b, _c, _d, _e, _f, _g, _h, _i)
288 #define kmem_cache_destroy(_c)  umem_cache_destroy(_c)
289 #define kmem_cache_alloc(_c, _f) umem_cache_alloc(_c, _f)
290 #define kmem_cache_free(_c, _b) umem_cache_free(_c, _b)
291 #define kmem_debugging()        0
292 #define kmem_cache_reap_now(_c)         /* nothing */
293 #define kmem_cache_set_move(_c, _cb)    /* nothing */
294 #define POINTER_INVALIDATE(_pp)         /* nothing */
295 #define POINTER_IS_VALID(_p)    0
296
297 typedef umem_cache_t kmem_cache_t;
298
299 typedef enum kmem_cbrc {
300         KMEM_CBRC_YES,
301         KMEM_CBRC_NO,
302         KMEM_CBRC_LATER,
303         KMEM_CBRC_DONT_NEED,
304         KMEM_CBRC_DONT_KNOW
305 } kmem_cbrc_t;
306
307 /*
308  * Task queues
309  */
310 typedef struct taskq taskq_t;
311 typedef uintptr_t taskqid_t;
312 typedef void (task_func_t)(void *);
313
314 #define TASKQ_PREPOPULATE       0x0001
315 #define TASKQ_CPR_SAFE          0x0002  /* Use CPR safe protocol */
316 #define TASKQ_DYNAMIC           0x0004  /* Use dynamic thread scheduling */
317 #define TASKQ_THREADS_CPU_PCT   0x0008  /* Scale # threads by # cpus */
318 #define TASKQ_DC_BATCH          0x0010  /* Mark threads as batch */
319
320 #define TQ_SLEEP        KM_SLEEP        /* Can block for memory */
321 #define TQ_NOSLEEP      KM_NOSLEEP      /* cannot block for memory; may fail */
322 #define TQ_NOQUEUE      0x02            /* Do not enqueue if can't dispatch */
323 #define TQ_FRONT        0x08            /* Queue in front */
324
325 extern taskq_t *system_taskq;
326
327 extern taskq_t  *taskq_create(const char *, int, pri_t, int, int, uint_t);
328 #define taskq_create_proc(a, b, c, d, e, p, f) \
329             (taskq_create(a, b, c, d, e, f))
330 #define taskq_create_sysdc(a, b, d, e, p, dc, f) \
331             (taskq_create(a, b, maxclsyspri, d, e, f))
332 extern taskqid_t taskq_dispatch(taskq_t *, task_func_t, void *, uint_t);
333 extern void     taskq_destroy(taskq_t *);
334 extern void     taskq_wait(taskq_t *);
335 extern int      taskq_member(taskq_t *, void *);
336 extern void     system_taskq_init(void);
337 extern void     system_taskq_fini(void);
338
339 #define taskq_dispatch_safe(tq, func, arg, flags, task)                 \
340         taskq_dispatch((tq), (func), (arg), (flags))
341
342 #define XVA_MAPSIZE     3
343 #define XVA_MAGIC       0x78766174
344
345 /*
346  * vnodes
347  */
348 typedef struct vnode {
349         uint64_t        v_size;
350         int             v_fd;
351         char            *v_path;
352 } vnode_t;
353
354 #define AV_SCANSTAMP_SZ 32              /* length of anti-virus scanstamp */
355
356 typedef struct xoptattr {
357         timestruc_t     xoa_createtime; /* Create time of file */
358         uint8_t         xoa_archive;
359         uint8_t         xoa_system;
360         uint8_t         xoa_readonly;
361         uint8_t         xoa_hidden;
362         uint8_t         xoa_nounlink;
363         uint8_t         xoa_immutable;
364         uint8_t         xoa_appendonly;
365         uint8_t         xoa_nodump;
366         uint8_t         xoa_settable;
367         uint8_t         xoa_opaque;
368         uint8_t         xoa_av_quarantined;
369         uint8_t         xoa_av_modified;
370         uint8_t         xoa_av_scanstamp[AV_SCANSTAMP_SZ];
371         uint8_t         xoa_reparse;
372         uint8_t         xoa_offline;
373         uint8_t         xoa_sparse;
374 } xoptattr_t;
375
376 typedef struct vattr {
377         uint_t          va_mask;        /* bit-mask of attributes */
378         u_offset_t      va_size;        /* file size in bytes */
379 } vattr_t;
380
381
382 typedef struct xvattr {
383         vattr_t         xva_vattr;      /* Embedded vattr structure */
384         uint32_t        xva_magic;      /* Magic Number */
385         uint32_t        xva_mapsize;    /* Size of attr bitmap (32-bit words) */
386         uint32_t        *xva_rtnattrmapp;       /* Ptr to xva_rtnattrmap[] */
387         uint32_t        xva_reqattrmap[XVA_MAPSIZE];    /* Requested attrs */
388         uint32_t        xva_rtnattrmap[XVA_MAPSIZE];    /* Returned attrs */
389         xoptattr_t      xva_xoptattrs;  /* Optional attributes */
390 } xvattr_t;
391
392 typedef struct vsecattr {
393         uint_t          vsa_mask;       /* See below */
394         int             vsa_aclcnt;     /* ACL entry count */
395         void            *vsa_aclentp;   /* pointer to ACL entries */
396         int             vsa_dfaclcnt;   /* default ACL entry count */
397         void            *vsa_dfaclentp; /* pointer to default ACL entries */
398         size_t          vsa_aclentsz;   /* ACE size in bytes of vsa_aclentp */
399 } vsecattr_t;
400
401 #define AT_TYPE         0x00001
402 #define AT_MODE         0x00002
403 #define AT_UID          0x00004
404 #define AT_GID          0x00008
405 #define AT_FSID         0x00010
406 #define AT_NODEID       0x00020
407 #define AT_NLINK        0x00040
408 #define AT_SIZE         0x00080
409 #define AT_ATIME        0x00100
410 #define AT_MTIME        0x00200
411 #define AT_CTIME        0x00400
412 #define AT_RDEV         0x00800
413 #define AT_BLKSIZE      0x01000
414 #define AT_NBLOCKS      0x02000
415 #define AT_SEQ          0x08000
416 #define AT_XVATTR       0x10000
417
418 #define CRCREAT         0
419
420 extern int fop_getattr(vnode_t *vp, vattr_t *vap);
421
422 #define VOP_CLOSE(vp, f, c, o, cr, ct)  0
423 #define VOP_PUTPAGE(vp, of, sz, fl, cr, ct)     0
424 #define VOP_GETATTR(vp, vap, cr)  fop_getattr((vp), (vap));
425
426 #define VOP_FSYNC(vp, f, cr, ct)        fsync((vp)->v_fd)
427
428 #define VN_RELE(vp)                     vn_close(vp, 0, NULL, NULL)
429 #define VN_RELE_ASYNC(vp, taskq)        vn_close(vp, 0, NULL, NULL)
430
431 #define vn_lock(vp, type)
432 #define VOP_UNLOCK(vp, type)
433 #ifdef VFS_LOCK_GIANT
434 #undef VFS_LOCK_GIANT
435 #endif
436 #define VFS_LOCK_GIANT(mp)      0
437 #ifdef VFS_UNLOCK_GIANT
438 #undef VFS_UNLOCK_GIANT
439 #endif
440 #define VFS_UNLOCK_GIANT(vfslocked)
441
442 extern int vn_open(char *path, int x1, int oflags, int mode, vnode_t **vpp,
443     int x2, int x3);
444 extern int vn_openat(char *path, int x1, int oflags, int mode, vnode_t **vpp,
445     int x2, int x3, vnode_t *vp, int fd);
446 extern int vn_rdwr(int uio, vnode_t *vp, void *addr, ssize_t len,
447     offset_t offset, int x1, int x2, rlim64_t x3, void *x4, ssize_t *residp);
448 extern void vn_close(vnode_t *vp, int openflag, cred_t *cr, kthread_t *td);
449
450 #define vn_remove(path, x1, x2)         remove(path)
451 #define vn_rename(from, to, seg)        rename((from), (to))
452 #define vn_is_readonly(vp)              B_FALSE
453
454 extern vnode_t *rootdir;
455
456 #include <sys/file.h>           /* for FREAD, FWRITE, etc */
457 #define FTRUNC  O_TRUNC
458
459 /*
460  * Random stuff
461  */
462 #define ddi_get_lbolt()         (gethrtime() >> 23)
463 #define ddi_get_lbolt64()       (gethrtime() >> 23)
464 #define hz      119     /* frequency when using gethrtime() >> 23 for lbolt */
465
466 extern void delay(clock_t ticks);
467
468 #define gethrestime_sec() time(NULL)
469 #define gethrestime(t) \
470         do {\
471                 (t)->tv_sec = gethrestime_sec();\
472                 (t)->tv_nsec = 0;\
473         } while (0);
474
475 #define max_ncpus       64
476
477 #define minclsyspri     60
478 #define maxclsyspri     99
479
480 #define CPU_SEQID       (thr_self() & (max_ncpus - 1))
481
482 #define kcred           NULL
483 #define CRED()          NULL
484
485 #ifndef ptob
486 #define ptob(x)         ((x) * PAGESIZE)
487 #endif
488
489 extern uint64_t physmem;
490
491 extern int highbit(ulong_t i);
492 extern int random_get_bytes(uint8_t *ptr, size_t len);
493 extern int random_get_pseudo_bytes(uint8_t *ptr, size_t len);
494
495 extern void kernel_init(int);
496 extern void kernel_fini(void);
497
498 struct spa;
499 extern void nicenum(uint64_t num, char *buf);
500 extern void show_pool_stats(struct spa *);
501
502 typedef struct callb_cpr {
503         kmutex_t        *cc_lockp;
504 } callb_cpr_t;
505
506 #define CALLB_CPR_INIT(cp, lockp, func, name)   {               \
507         (cp)->cc_lockp = lockp;                                 \
508 }
509
510 #define CALLB_CPR_SAFE_BEGIN(cp) {                              \
511         ASSERT(MUTEX_HELD((cp)->cc_lockp));                     \
512 }
513
514 #define CALLB_CPR_SAFE_END(cp, lockp) {                         \
515         ASSERT(MUTEX_HELD((cp)->cc_lockp));                     \
516 }
517
518 #define CALLB_CPR_EXIT(cp) {                                    \
519         ASSERT(MUTEX_HELD((cp)->cc_lockp));                     \
520         mutex_exit((cp)->cc_lockp);                             \
521 }
522
523 #define zone_dataset_visible(x, y)      (1)
524 #define INGLOBALZONE(z)                 (1)
525
526 extern char *kmem_asprintf(const char *fmt, ...);
527 #define strfree(str) kmem_free((str), strlen(str)+1)
528
529 /*
530  * Hostname information
531  */
532 extern struct utsname utsname;
533 extern char hw_serial[];        /* for userland-emulated hostid access */
534 extern int ddi_strtoul(const char *str, char **nptr, int base,
535     unsigned long *result);
536
537 extern int ddi_strtoull(const char *str, char **nptr, int base,
538     u_longlong_t *result);
539
540 /* ZFS Boot Related stuff. */
541
542 struct _buf {
543         intptr_t        _fd;
544 };
545
546 struct bootstat {
547         uint64_t st_size;
548 };
549
550 typedef struct ace_object {
551         uid_t           a_who;
552         uint32_t        a_access_mask;
553         uint16_t        a_flags;
554         uint16_t        a_type;
555         uint8_t         a_obj_type[16];
556         uint8_t         a_inherit_obj_type[16];
557 } ace_object_t;
558
559
560 #define ACE_ACCESS_ALLOWED_OBJECT_ACE_TYPE      0x05
561 #define ACE_ACCESS_DENIED_OBJECT_ACE_TYPE       0x06
562 #define ACE_SYSTEM_AUDIT_OBJECT_ACE_TYPE        0x07
563 #define ACE_SYSTEM_ALARM_OBJECT_ACE_TYPE        0x08
564
565 extern struct _buf *kobj_open_file(char *name);
566 extern int kobj_read_file(struct _buf *file, char *buf, unsigned size,
567     unsigned off);
568 extern void kobj_close_file(struct _buf *file);
569 extern int kobj_get_filesize(struct _buf *file, uint64_t *size);
570 extern int zfs_secpolicy_snapshot_perms(const char *name, cred_t *cr);
571 extern int zfs_secpolicy_rename_perms(const char *from, const char *to,
572     cred_t *cr);
573 extern int zfs_secpolicy_destroy_perms(const char *name, cred_t *cr);
574 extern zoneid_t getzoneid(void);
575 /* Random compatibility stuff. */
576 #define lbolt   (gethrtime() >> 23)
577 #define lbolt64 (gethrtime() >> 23)
578
579 extern uint64_t physmem;
580
581 #define gethrestime_sec()       time(NULL)
582
583 #define pwrite64(d, p, n, o)    pwrite(d, p, n, o)
584 #define readdir64(d)            readdir(d)
585 #define SIGPENDING(td)          (0)
586 #define root_mount_wait()       do { } while (0)
587 #define root_mounted()          (1)
588
589 struct file {
590         void *dummy;
591 };
592
593 #define FCREAT  O_CREAT
594 #define FOFFMAX 0x0
595
596 /* SID stuff */
597 typedef struct ksiddomain {
598         uint_t  kd_ref;
599         uint_t  kd_len;
600         char    *kd_name;
601 } ksiddomain_t;
602
603 ksiddomain_t *ksid_lookupdomain(const char *);
604 void ksiddomain_rele(ksiddomain_t *);
605
606 typedef uint32_t        idmap_rid_t;
607
608 #define DDI_SLEEP       KM_SLEEP
609 #define ddi_log_sysevent(_a, _b, _c, _d, _e, _f, _g)    (0)
610
611 #define SX_SYSINIT(name, lock, desc)
612
613 #define SYSCTL_DECL(...)
614 #define SYSCTL_NODE(...)
615 #define SYSCTL_INT(...)
616 #define SYSCTL_UINT(...)
617 #define SYSCTL_ULONG(...)
618 #define SYSCTL_QUAD(...)
619 #define SYSCTL_UQUAD(...)
620 #ifdef TUNABLE_INT
621 #undef TUNABLE_INT
622 #undef TUNABLE_ULONG
623 #undef TUNABLE_QUAD
624 #endif
625 #define TUNABLE_INT(...)
626 #define TUNABLE_ULONG(...)
627 #define TUNABLE_QUAD(...)
628
629 /* Errors */
630
631 #ifndef ERESTART
632 #define ERESTART        (-1)
633 #endif
634
635 #ifdef  __cplusplus
636 }
637 #endif
638
639 #endif  /* _SYS_ZFS_CONTEXT_H */