]> CyberLeo.Net >> Repos - FreeBSD/releng/7.2.git/blob - sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_context.h
Create releng/7.2 from stable/7 in preparation for 7.2-RELEASE.
[FreeBSD/releng/7.2.git] / sys / cddl / contrib / opensolaris / uts / common / fs / zfs / 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, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
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.
13  *
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]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26
27 #ifndef _SYS_ZFS_CONTEXT_H
28 #define _SYS_ZFS_CONTEXT_H
29
30 #pragma ident   "%Z%%M% %I%     %E% SMI"
31
32 #ifdef  __cplusplus
33 extern "C" {
34 #endif
35
36 #include <sys/param.h>
37 #include <sys/stdint.h>
38 #include <sys/note.h>
39 #include <sys/kernel.h>
40 #include <sys/debug.h>
41 #include <sys/systm.h>
42 #include <sys/proc.h>
43 #include <sys/sysmacros.h>
44 #include <sys/bitmap.h>
45 #include <sys/cmn_err.h>
46 #include <sys/kmem.h>
47 #include <sys/taskq.h>
48 #include <sys/systm.h>
49 #include <sys/conf.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>
55 #include <sys/list.h>
56 #include <sys/uio.h>
57 #include <sys/dirent.h>
58 #include <sys/time.h>
59 #include <sys/uio.h>
60 #include <sys/fcntl.h>
61 #include <sys/limits.h>
62 #include <sys/string.h>
63 #include <sys/bio.h>
64 #include <sys/buf.h>
65 #include <sys/cred.h>
66 #include <sys/sdt.h>
67 #include <sys/file.h>
68 #include <sys/vfs.h>
69 #include <sys/sysctl.h>
70 #include <sys/sbuf.h>
71 #include <sys/priv.h>
72 #include <sys/kdb.h>
73 #include <sys/ktr.h>
74 #include <sys/stack.h>
75 #include <sys/lockf.h>
76 #include <sys/policy.h>
77 #include <sys/zone.h>
78 #include <sys/eventhandler.h>
79 #include <sys/misc.h>
80 #include <sys/zfs_debug.h>
81
82 #include <machine/stdarg.h>
83
84 #include <vm/vm.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. */
91 #ifdef min_offset
92 #undef min_offset
93 #endif
94 #ifdef max_offset
95 #undef max_offset
96 #endif
97 #include <vm/vm_extern.h>
98 #include <vm/vnode_pager.h>
99
100 #define CPU_SEQID       (curcpu)
101
102 #ifdef  __cplusplus
103 }
104 #endif
105
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__);                                    \
113                 printf("\n");                                           \
114                 if ((lvl) & 0x100)                                      \
115                         kdb_backtrace();                                \
116                 mtx_unlock(&zfs_debug_mtx);                             \
117         }                                                               \
118 } while (0)
119
120 #endif  /* _SYS_ZFS_CONTEXT_H */