4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #ifndef _SYS_ZFS_CONTEXT_H
28 #define _SYS_ZFS_CONTEXT_H
30 #pragma ident "%Z%%M% %I% %E% SMI"
36 #include <sys/param.h>
37 #include <sys/stdint.h>
39 #include <sys/kernel.h>
40 #include <sys/debug.h>
41 #include <sys/systm.h>
43 #include <sys/sysmacros.h>
44 #include <sys/bitmap.h>
45 #include <sys/cmn_err.h>
47 #include <sys/taskq.h>
48 #include <sys/systm.h>
50 #include <sys/mutex.h>
51 #include <sys/rwlock.h>
52 #include <sys/random.h>
53 #include <sys/byteorder.h>
54 #include <sys/systm.h>
57 #include <sys/dirent.h>
60 #include <sys/fcntl.h>
61 #include <sys/limits.h>
62 #include <sys/string.h>
69 #include <sys/sysctl.h>
74 #include <sys/stack.h>
75 #include <sys/lockf.h>
76 #include <sys/policy.h>
78 #include <sys/eventhandler.h>
80 #include <sys/zfs_debug.h>
82 #include <machine/stdarg.h>
85 #include <vm/vm_page.h>
86 #include <vm/vm_object.h>
87 #include <vm/vm_pager.h>
88 #include <vm/vm_kern.h>
89 #include <vm/vm_map.h>
90 /* There is clash. vm_map.h defines the two below and vdev_cache.c use them. */
97 #include <vm/vm_extern.h>
98 #include <vm/vnode_pager.h>
100 #define CPU_SEQID (curcpu)
106 extern int zfs_debug_level;
107 extern struct mtx zfs_debug_mtx;
108 #define ZFS_LOG(lvl, ...) do { \
109 if (((lvl) & 0xff) <= zfs_debug_level) { \
110 mtx_lock(&zfs_debug_mtx); \
111 printf("%s:%u[%d]: ", __func__, __LINE__, (lvl)); \
112 printf(__VA_ARGS__); \
116 mtx_unlock(&zfs_debug_mtx); \
120 #endif /* _SYS_ZFS_CONTEXT_H */