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