2025-01-04 11:04:27 +11:00
|
|
|
// SPDX-License-Identifier: CDDL-1.0
|
2008-12-11 11:14:49 -08:00
|
|
|
/*
|
|
|
|
|
* CDDL HEADER START
|
|
|
|
|
*
|
|
|
|
|
* The contents of this file are subject to the terms of the
|
|
|
|
|
* Common Development and Distribution License (the "License").
|
|
|
|
|
* You may not use this file except in compliance with the License.
|
|
|
|
|
*
|
|
|
|
|
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
2022-07-11 23:16:13 +02:00
|
|
|
* or https://opensource.org/licenses/CDDL-1.0.
|
2008-12-11 11:14:49 -08:00
|
|
|
* See the License for the specific language governing permissions
|
|
|
|
|
* and limitations under the License.
|
|
|
|
|
*
|
|
|
|
|
* When distributing Covered Code, include this CDDL HEADER in each
|
|
|
|
|
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
|
|
|
|
* If applicable, add the following below this CDDL HEADER, with the
|
|
|
|
|
* fields enclosed by brackets "[]" replaced with your own identifying
|
|
|
|
|
* information: Portions Copyright [yyyy] [name of copyright owner]
|
|
|
|
|
*
|
|
|
|
|
* CDDL HEADER END
|
|
|
|
|
*/
|
|
|
|
|
/*
|
2017-01-31 21:13:10 +03:00
|
|
|
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
|
|
|
|
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
|
2019-06-19 09:48:13 -07:00
|
|
|
* Copyright (c) 2012, 2018 by Delphix. All rights reserved.
|
2012-05-09 15:05:14 -07:00
|
|
|
* Copyright (c) 2012, Joyent, Inc. All rights reserved.
|
2011-11-07 16:26:52 -08:00
|
|
|
*/
|
2008-12-11 11:14:49 -08:00
|
|
|
|
|
|
|
|
#ifndef _SYS_ZFS_CONTEXT_H
|
|
|
|
|
#define _SYS_ZFS_CONTEXT_H
|
|
|
|
|
|
2020-06-06 15:54:04 -04:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
2020-10-13 22:05:49 -06:00
|
|
|
/*
|
|
|
|
|
* This code compiles in three different contexts. When __KERNEL__ is defined,
|
|
|
|
|
* the code uses "unix-like" kernel interfaces. When _STANDALONE is defined, the
|
|
|
|
|
* code is running in a reduced capacity environment of the boot loader which is
|
|
|
|
|
* generally a subset of both POSIX and kernel interfaces (with a few unique
|
|
|
|
|
* interfaces too). When neither are defined, it's in a userland POSIX or
|
|
|
|
|
* similar environment.
|
|
|
|
|
*/
|
|
|
|
|
#if defined(__KERNEL__) || defined(_STANDALONE)
|
2010-09-04 13:26:23 -07:00
|
|
|
#include <sys/types.h>
|
|
|
|
|
#include <sys/atomic.h>
|
|
|
|
|
#include <sys/sysmacros.h>
|
2018-02-15 17:53:18 -08:00
|
|
|
#include <sys/vmsystm.h>
|
|
|
|
|
#include <sys/condvar.h>
|
2010-09-04 13:26:23 -07:00
|
|
|
#include <sys/cmn_err.h>
|
|
|
|
|
#include <sys/kmem.h>
|
2014-12-08 19:03:50 -05:00
|
|
|
#include <sys/kmem_cache.h>
|
2014-12-03 14:56:32 -05:00
|
|
|
#include <sys/vmem.h>
|
2022-09-28 21:48:46 +05:00
|
|
|
#include <sys/misc.h>
|
2010-09-04 13:26:23 -07:00
|
|
|
#include <sys/taskq.h>
|
|
|
|
|
#include <sys/param.h>
|
|
|
|
|
#include <sys/disp.h>
|
|
|
|
|
#include <sys/debug.h>
|
|
|
|
|
#include <sys/random.h>
|
2022-01-22 01:56:46 +01:00
|
|
|
#include <sys/string.h>
|
2010-09-04 13:26:23 -07:00
|
|
|
#include <sys/byteorder.h>
|
|
|
|
|
#include <sys/list.h>
|
|
|
|
|
#include <sys/time.h>
|
|
|
|
|
#include <sys/zone.h>
|
2016-05-12 10:51:24 -04:00
|
|
|
#include <sys/kstat.h>
|
2010-09-04 13:26:23 -07:00
|
|
|
#include <sys/zfs_debug.h>
|
2016-07-27 15:29:15 -07:00
|
|
|
#include <sys/sysevent.h>
|
|
|
|
|
#include <sys/sysevent/eventdefs.h>
|
2013-08-28 20:01:20 -07:00
|
|
|
#include <sys/zfs_delay.h>
|
2010-09-04 13:26:23 -07:00
|
|
|
#include <sys/sunddi.h>
|
2011-11-15 14:01:27 -05:00
|
|
|
#include <sys/ctype.h>
|
2012-08-23 17:45:31 -07:00
|
|
|
#include <sys/disp.h>
|
2014-06-13 10:54:48 -07:00
|
|
|
#include <sys/trace.h>
|
2018-09-26 11:08:12 -07:00
|
|
|
#include <sys/procfs_list.h>
|
2019-11-01 10:41:03 -07:00
|
|
|
#include <sys/mod.h>
|
2021-02-20 21:16:50 -07:00
|
|
|
#include <sys/uio_impl.h>
|
2019-12-04 13:12:57 -08:00
|
|
|
#include <sys/zfs_context_os.h>
|
2020-10-13 22:05:49 -06:00
|
|
|
#else /* _KERNEL || _STANDALONE */
|
2008-12-11 11:14:49 -08:00
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include <stddef.h>
|
|
|
|
|
#include <stdarg.h>
|
|
|
|
|
#include <fcntl.h>
|
|
|
|
|
#include <unistd.h>
|
|
|
|
|
#include <errno.h>
|
|
|
|
|
#include <string.h>
|
2018-02-08 09:16:23 -07:00
|
|
|
#include <setjmp.h>
|
2008-12-11 11:14:49 -08:00
|
|
|
#include <assert.h>
|
|
|
|
|
#include <limits.h>
|
|
|
|
|
#include <atomic.h>
|
|
|
|
|
#include <dirent.h>
|
|
|
|
|
#include <time.h>
|
2011-11-15 14:01:27 -05:00
|
|
|
#include <ctype.h>
|
2013-05-16 14:18:06 -07:00
|
|
|
#include <signal.h>
|
|
|
|
|
#include <sys/mman.h>
|
2008-12-11 11:14:49 -08:00
|
|
|
#include <sys/types.h>
|
|
|
|
|
#include <sys/cred.h>
|
|
|
|
|
#include <sys/sysmacros.h>
|
|
|
|
|
#include <sys/resource.h>
|
|
|
|
|
#include <sys/byteorder.h>
|
|
|
|
|
#include <sys/list.h>
|
2019-11-01 10:41:03 -07:00
|
|
|
#include <sys/mod.h>
|
2008-12-11 11:14:49 -08:00
|
|
|
#include <sys/uio.h>
|
|
|
|
|
#include <sys/zfs_debug.h>
|
|
|
|
|
#include <sys/kstat.h>
|
|
|
|
|
#include <sys/u8_textprep.h>
|
2016-07-27 15:29:15 -07:00
|
|
|
#include <sys/sysevent.h>
|
|
|
|
|
#include <sys/sysevent/eventdefs.h>
|
2010-05-28 13:45:14 -07:00
|
|
|
#include <sys/sunddi.h>
|
2013-05-10 14:17:03 -07:00
|
|
|
#include <sys/debug.h>
|
2025-10-19 13:09:34 +11:00
|
|
|
#include <sys/zone.h>
|
2008-12-11 11:14:49 -08:00
|
|
|
|
2025-08-09 09:51:43 +10:00
|
|
|
#include <sys/mutex.h>
|
2025-08-09 09:51:43 +10:00
|
|
|
#include <sys/rwlock.h>
|
2025-08-09 09:51:43 +10:00
|
|
|
#include <sys/condvar.h>
|
2025-08-09 10:44:05 +10:00
|
|
|
#include <sys/cmn_err.h>
|
2025-08-25 21:45:35 +10:00
|
|
|
#include <sys/thread.h>
|
2025-08-16 20:23:25 +10:00
|
|
|
#include <sys/taskq.h>
|
2025-10-15 17:31:31 +11:00
|
|
|
#include <sys/tsd.h>
|
2025-10-16 13:12:30 +11:00
|
|
|
#include <sys/procfs_list.h>
|
2025-10-16 13:27:43 +11:00
|
|
|
#include <sys/kmem.h>
|
2025-10-16 13:52:57 +11:00
|
|
|
#include <sys/zfs_delay.h>
|
2025-10-17 22:25:23 +11:00
|
|
|
#include <sys/vnode.h>
|
2025-10-24 23:19:53 +11:00
|
|
|
#include <sys/callb.h>
|
|
|
|
|
#include <sys/trace.h>
|
|
|
|
|
#include <sys/systm.h>
|
2025-10-24 23:39:20 +11:00
|
|
|
#include <sys/misc.h>
|
2025-10-18 23:39:19 +11:00
|
|
|
#include <sys/random.h>
|
2025-10-16 13:52:57 +11:00
|
|
|
|
2019-12-04 13:12:57 -08:00
|
|
|
#include <sys/zfs_context_os.h>
|
|
|
|
|
|
2020-10-13 22:05:49 -06:00
|
|
|
#endif /* _KERNEL || _STANDALONE */
|
2020-06-06 15:54:04 -04:00
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
};
|
|
|
|
|
#endif
|
|
|
|
|
|
2008-12-11 11:14:49 -08:00
|
|
|
#endif /* _SYS_ZFS_CONTEXT_H */
|