]> CyberLeo.Net >> Repos - FreeBSD/stable/8.git/blob - cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h
Merge ZFS feature flags support and related bugfixes:
[FreeBSD/stable/8.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 kmem_alloc(_s, _f)      umem_alloc(_s, _f)
282 #define kmem_zalloc(_s, _f)     umem_zalloc(_s, _f)
283 #define kmem_free(_b, _s)       umem_free(_b, _s)
284 #define kmem_size()             (physmem * PAGESIZE)
285 #define kmem_cache_create(_a, _b, _c, _d, _e, _f, _g, _h, _i) \
286         umem_cache_create(_a, _b, _c, _d, _e, _f, _g, _h, _i)
287 #define kmem_cache_destroy(_c)  umem_cache_destroy(_c)
288 #define kmem_cache_alloc(_c, _f) umem_cache_alloc(_c, _f)
289 #define kmem_cache_free(_c, _b) umem_cache_free(_c, _b)
290 #define kmem_debugging()        0
291 #define kmem_cache_reap_now(_c)         /* nothing */
292 #define kmem_cache_set_move(_c, _cb)    /* nothing */
293 #define POINTER_INVALIDATE(_pp)         /* nothing */
294 #define POINTER_IS_VALID(_p)    0
295
296 typedef umem_cache_t kmem_cache_t;
297
298 typedef enum kmem_cbrc {
299         KMEM_CBRC_YES,
300         KMEM_CBRC_NO,
301         KMEM_CBRC_LATER,
302         KMEM_CBRC_DONT_NEED,
303         KMEM_CBRC_DONT_KNOW
304 } kmem_cbrc_t;
305
306 /*
307  * Task queues
308  */
309 typedef struct taskq taskq_t;
310 typedef uintptr_t taskqid_t;
311 typedef void (task_func_t)(void *);
312
313 #define TASKQ_PREPOPULATE       0x0001
314 #define TASKQ_CPR_SAFE          0x0002  /* Use CPR safe protocol */
315 #define TASKQ_DYNAMIC           0x0004  /* Use dynamic thread scheduling */
316 #define TASKQ_THREADS_CPU_PCT   0x0008  /* Scale # threads by # cpus */
317 #define TASKQ_DC_BATCH          0x0010  /* Mark threads as batch */
318
319 #define TQ_SLEEP        KM_SLEEP        /* Can block for memory */
320 #define TQ_NOSLEEP      KM_NOSLEEP      /* cannot block for memory; may fail */
321 #define TQ_NOQUEUE      0x02            /* Do not enqueue if can't dispatch */
322 #define TQ_FRONT        0x08            /* Queue in front */
323
324 extern taskq_t *system_taskq;
325
326 extern taskq_t  *taskq_create(const char *, int, pri_t, int, int, uint_t);
327 #define taskq_create_proc(a, b, c, d, e, p, f) \
328             (taskq_create(a, b, c, d, e, f))
329 #define taskq_create_sysdc(a, b, d, e, p, dc, f) \
330             (taskq_create(a, b, maxclsyspri, d, e, f))
331 extern taskqid_t taskq_dispatch(taskq_t *, task_func_t, void *, uint_t);
332 extern void     taskq_destroy(taskq_t *);
333 extern void     taskq_wait(taskq_t *);
334 extern int      taskq_member(taskq_t *, void *);
335 extern void     system_taskq_init(void);
336 extern void     system_taskq_fini(void);
337
338 #define taskq_dispatch_safe(tq, func, arg, flags, task)                 \
339         taskq_dispatch((tq), (func), (arg), (flags))
340
341 #define XVA_MAPSIZE     3
342 #define XVA_MAGIC       0x78766174
343
344 /*
345  * vnodes
346  */
347 typedef struct vnode {
348         uint64_t        v_size;
349         int             v_fd;
350         char            *v_path;
351 } vnode_t;
352
353 #define AV_SCANSTAMP_SZ 32              /* length of anti-virus scanstamp */
354
355 typedef struct xoptattr {
356         timestruc_t     xoa_createtime; /* Create time of file */
357         uint8_t         xoa_archive;
358         uint8_t         xoa_system;
359         uint8_t         xoa_readonly;
360         uint8_t         xoa_hidden;
361         uint8_t         xoa_nounlink;
362         uint8_t         xoa_immutable;
363         uint8_t         xoa_appendonly;
364         uint8_t         xoa_nodump;
365         uint8_t         xoa_settable;
366         uint8_t         xoa_opaque;
367         uint8_t         xoa_av_quarantined;
368         uint8_t         xoa_av_modified;
369         uint8_t         xoa_av_scanstamp[AV_SCANSTAMP_SZ];
370         uint8_t         xoa_reparse;
371         uint8_t         xoa_offline;
372         uint8_t         xoa_sparse;
373 } xoptattr_t;
374
375 typedef struct vattr {
376         uint_t          va_mask;        /* bit-mask of attributes */
377         u_offset_t      va_size;        /* file size in bytes */
378 } vattr_t;
379
380
381 typedef struct xvattr {
382         vattr_t         xva_vattr;      /* Embedded vattr structure */
383         uint32_t        xva_magic;      /* Magic Number */
384         uint32_t        xva_mapsize;    /* Size of attr bitmap (32-bit words) */
385         uint32_t        *xva_rtnattrmapp;       /* Ptr to xva_rtnattrmap[] */
386         uint32_t        xva_reqattrmap[XVA_MAPSIZE];    /* Requested attrs */
387         uint32_t        xva_rtnattrmap[XVA_MAPSIZE];    /* Returned attrs */
388         xoptattr_t      xva_xoptattrs;  /* Optional attributes */
389 } xvattr_t;
390
391 typedef struct vsecattr {
392         uint_t          vsa_mask;       /* See below */
393         int             vsa_aclcnt;     /* ACL entry count */
394         void            *vsa_aclentp;   /* pointer to ACL entries */
395         int             vsa_dfaclcnt;   /* default ACL entry count */
396         void            *vsa_dfaclentp; /* pointer to default ACL entries */
397         size_t          vsa_aclentsz;   /* ACE size in bytes of vsa_aclentp */
398 } vsecattr_t;
399
400 #define AT_TYPE         0x00001
401 #define AT_MODE         0x00002
402 #define AT_UID          0x00004
403 #define AT_GID          0x00008
404 #define AT_FSID         0x00010
405 #define AT_NODEID       0x00020
406 #define AT_NLINK        0x00040
407 #define AT_SIZE         0x00080
408 #define AT_ATIME        0x00100
409 #define AT_MTIME        0x00200
410 #define AT_CTIME        0x00400
411 #define AT_RDEV         0x00800
412 #define AT_BLKSIZE      0x01000
413 #define AT_NBLOCKS      0x02000
414 #define AT_SEQ          0x08000
415 #define AT_XVATTR       0x10000
416
417 #define CRCREAT         0
418
419 extern int fop_getattr(vnode_t *vp, vattr_t *vap);
420
421 #define VOP_CLOSE(vp, f, c, o, cr, ct)  0
422 #define VOP_PUTPAGE(vp, of, sz, fl, cr, ct)     0
423 #define VOP_GETATTR(vp, vap, cr)  fop_getattr((vp), (vap));
424
425 #define VOP_FSYNC(vp, f, cr, ct)        fsync((vp)->v_fd)
426
427 #define VN_RELE(vp)                     vn_close(vp, 0, NULL, NULL)
428 #define VN_RELE_ASYNC(vp, taskq)        vn_close(vp, 0, NULL, NULL)
429
430 #define vn_lock(vp, type)
431 #define VOP_UNLOCK(vp, type)
432 #ifdef VFS_LOCK_GIANT
433 #undef VFS_LOCK_GIANT
434 #endif
435 #define VFS_LOCK_GIANT(mp)      0
436 #ifdef VFS_UNLOCK_GIANT
437 #undef VFS_UNLOCK_GIANT
438 #endif
439 #define VFS_UNLOCK_GIANT(vfslocked)
440
441 extern int vn_open(char *path, int x1, int oflags, int mode, vnode_t **vpp,
442     int x2, int x3);
443 extern int vn_openat(char *path, int x1, int oflags, int mode, vnode_t **vpp,
444     int x2, int x3, vnode_t *vp, int fd);
445 extern int vn_rdwr(int uio, vnode_t *vp, void *addr, ssize_t len,
446     offset_t offset, int x1, int x2, rlim64_t x3, void *x4, ssize_t *residp);
447 extern void vn_close(vnode_t *vp, int openflag, cred_t *cr, kthread_t *td);
448
449 #define vn_remove(path, x1, x2)         remove(path)
450 #define vn_rename(from, to, seg)        rename((from), (to))
451 #define vn_is_readonly(vp)              B_FALSE
452
453 extern vnode_t *rootdir;
454
455 #include <sys/file.h>           /* for FREAD, FWRITE, etc */
456 #define FTRUNC  O_TRUNC
457
458 /*
459  * Random stuff
460  */
461 #define ddi_get_lbolt()         (gethrtime() >> 23)
462 #define ddi_get_lbolt64()       (gethrtime() >> 23)
463 #define hz      119     /* frequency when using gethrtime() >> 23 for lbolt */
464
465 extern void delay(clock_t ticks);
466
467 #define gethrestime_sec() time(NULL)
468 #define gethrestime(t) \
469         do {\
470                 (t)->tv_sec = gethrestime_sec();\
471                 (t)->tv_nsec = 0;\
472         } while (0);
473
474 #define max_ncpus       64
475
476 #define minclsyspri     60
477 #define maxclsyspri     99
478
479 #define CPU_SEQID       (thr_self() & (max_ncpus - 1))
480
481 #define kcred           NULL
482 #define CRED()          NULL
483
484 #ifndef ptob
485 #define ptob(x)         ((x) * PAGESIZE)
486 #endif
487
488 extern uint64_t physmem;
489
490 extern int highbit(ulong_t i);
491 extern int random_get_bytes(uint8_t *ptr, size_t len);
492 extern int random_get_pseudo_bytes(uint8_t *ptr, size_t len);
493
494 extern void kernel_init(int);
495 extern void kernel_fini(void);
496
497 struct spa;
498 extern void nicenum(uint64_t num, char *buf);
499 extern void show_pool_stats(struct spa *);
500
501 typedef struct callb_cpr {
502         kmutex_t        *cc_lockp;
503 } callb_cpr_t;
504
505 #define CALLB_CPR_INIT(cp, lockp, func, name)   {               \
506         (cp)->cc_lockp = lockp;                                 \
507 }
508
509 #define CALLB_CPR_SAFE_BEGIN(cp) {                              \
510         ASSERT(MUTEX_HELD((cp)->cc_lockp));                     \
511 }
512
513 #define CALLB_CPR_SAFE_END(cp, lockp) {                         \
514         ASSERT(MUTEX_HELD((cp)->cc_lockp));                     \
515 }
516
517 #define CALLB_CPR_EXIT(cp) {                                    \
518         ASSERT(MUTEX_HELD((cp)->cc_lockp));                     \
519         mutex_exit((cp)->cc_lockp);                             \
520 }
521
522 #define zone_dataset_visible(x, y)      (1)
523 #define INGLOBALZONE(z)                 (1)
524
525 extern char *kmem_asprintf(const char *fmt, ...);
526 #define strfree(str) kmem_free((str), strlen(str)+1)
527
528 /*
529  * Hostname information
530  */
531 extern struct utsname utsname;
532 extern char hw_serial[];        /* for userland-emulated hostid access */
533 extern int ddi_strtoul(const char *str, char **nptr, int base,
534     unsigned long *result);
535
536 extern int ddi_strtoull(const char *str, char **nptr, int base,
537     u_longlong_t *result);
538
539 /* ZFS Boot Related stuff. */
540
541 struct _buf {
542         intptr_t        _fd;
543 };
544
545 struct bootstat {
546         uint64_t st_size;
547 };
548
549 typedef struct ace_object {
550         uid_t           a_who;
551         uint32_t        a_access_mask;
552         uint16_t        a_flags;
553         uint16_t        a_type;
554         uint8_t         a_obj_type[16];
555         uint8_t         a_inherit_obj_type[16];
556 } ace_object_t;
557
558
559 #define ACE_ACCESS_ALLOWED_OBJECT_ACE_TYPE      0x05
560 #define ACE_ACCESS_DENIED_OBJECT_ACE_TYPE       0x06
561 #define ACE_SYSTEM_AUDIT_OBJECT_ACE_TYPE        0x07
562 #define ACE_SYSTEM_ALARM_OBJECT_ACE_TYPE        0x08
563
564 extern struct _buf *kobj_open_file(char *name);
565 extern int kobj_read_file(struct _buf *file, char *buf, unsigned size,
566     unsigned off);
567 extern void kobj_close_file(struct _buf *file);
568 extern int kobj_get_filesize(struct _buf *file, uint64_t *size);
569 extern int zfs_secpolicy_snapshot_perms(const char *name, cred_t *cr);
570 extern int zfs_secpolicy_rename_perms(const char *from, const char *to,
571     cred_t *cr);
572 extern int zfs_secpolicy_destroy_perms(const char *name, cred_t *cr);
573 extern zoneid_t getzoneid(void);
574 /* Random compatibility stuff. */
575 #define lbolt   (gethrtime() >> 23)
576 #define lbolt64 (gethrtime() >> 23)
577
578 extern uint64_t physmem;
579
580 #define gethrestime_sec()       time(NULL)
581
582 #define pwrite64(d, p, n, o)    pwrite(d, p, n, o)
583 #define readdir64(d)            readdir(d)
584 #define SIGPENDING(td)          (0)
585 #define root_mount_wait()       do { } while (0)
586 #define root_mounted()          (1)
587
588 struct file {
589         void *dummy;
590 };
591
592 #define FCREAT  O_CREAT
593 #define FOFFMAX 0x0
594
595 /* SID stuff */
596 typedef struct ksiddomain {
597         uint_t  kd_ref;
598         uint_t  kd_len;
599         char    *kd_name;
600 } ksiddomain_t;
601
602 ksiddomain_t *ksid_lookupdomain(const char *);
603 void ksiddomain_rele(ksiddomain_t *);
604
605 typedef uint32_t        idmap_rid_t;
606
607 #define DDI_SLEEP       KM_SLEEP
608 #define ddi_log_sysevent(_a, _b, _c, _d, _e, _f, _g)    (0)
609
610 #define SX_SYSINIT(name, lock, desc)
611
612 #define SYSCTL_DECL(...)
613 #define SYSCTL_NODE(...)
614 #define SYSCTL_INT(...)
615 #define SYSCTL_UINT(...)
616 #define SYSCTL_ULONG(...)
617 #define SYSCTL_QUAD(...)
618 #ifdef TUNABLE_INT
619 #undef TUNABLE_INT
620 #undef TUNABLE_ULONG
621 #undef TUNABLE_QUAD
622 #endif
623 #define TUNABLE_INT(...)
624 #define TUNABLE_ULONG(...)
625 #define TUNABLE_QUAD(...)
626
627 /* Errors */
628
629 #ifndef ERESTART
630 #define ERESTART        (-1)
631 #endif
632
633 #ifdef  __cplusplus
634 }
635 #endif
636
637 #endif  /* _SYS_ZFS_CONTEXT_H */