Print this page
NEX-5665 SMB2 oplock leases
Reviewed by: Matt Barden <matt.barden@nexenta.com>
Reviewed by: Evan Layton <evan.layton@nexenta.com>
Reviewed by: Roman Strashkin <roman.strashkin@nexenta.com>
NEX-5665 SMB2 oplock leases
Reviewed by: Matt Barden <matt.barden@nexenta.com>
Reviewed by: Evan Layton <evan.layton@nexenta.com>
Reviewed by: Roman Strashkin <roman.strashkin@nexenta.com>
NEX-3541 Implement persistent L2ARC
Reviewed by: Alek Pinchuk <alek.pinchuk@nexenta.com>
Reviewed by: Josef Sipek <josef.sipek@nexenta.com>
Conflicts:
usr/src/uts/common/fs/zfs/sys/spa.h
| Split |
Close |
| Expand all |
| Collapse all |
--- old/usr/src/uts/common/sys/debug.h
+++ new/usr/src/uts/common/sys/debug.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
|
↓ open down ↓ |
20 lines elided |
↑ open up ↑ |
21 21 /*
22 22 * Copyright 2014 Garrett D'Amore <garrett@damore.org>
23 23 *
24 24 * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
25 25 * Use is subject to license terms.
26 26 */
27 27
28 28 /*
29 29 * Copyright (c) 2012, 2017 by Delphix. All rights reserved.
30 30 * Copyright 2013 Saso Kiselkov. All rights reserved.
31 + * Copyright 2015 Nexenta Systems, Inc. All rights reserved.
31 32 */
32 33
33 34 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
34 35 /* All Rights Reserved */
35 36
36 37 #ifndef _SYS_DEBUG_H
37 38 #define _SYS_DEBUG_H
38 39
39 40 #include <sys/isa_defs.h>
40 41 #include <sys/types.h>
41 42 #include <sys/note.h>
42 43
43 44 #ifdef __cplusplus
44 45 extern "C" {
45 46 #endif
46 47
47 48 /*
48 49 * ASSERT(ex) causes a panic or debugger entry if expression ex is not
49 50 * true. ASSERT() is included only for debugging, and is a no-op in
50 51 * production kernels. VERIFY(ex), on the other hand, behaves like
51 52 * ASSERT and is evaluated on both debug and non-debug kernels.
52 53 */
53 54
54 55 extern int assfail(const char *, const char *, int);
55 56 #define VERIFY(EX) ((void)((EX) || assfail(#EX, __FILE__, __LINE__)))
56 57 #if DEBUG
57 58 #define ASSERT(EX) ((void)((EX) || assfail(#EX, __FILE__, __LINE__)))
58 59 #else
59 60 #define ASSERT(x) ((void)0)
60 61 #endif
61 62
62 63 /*
63 64 * Assertion variants sensitive to the compilation data model
64 65 */
65 66 #if defined(_LP64)
66 67 #define ASSERT64(x) ASSERT(x)
67 68 #define ASSERT32(x)
68 69 #else
69 70 #define ASSERT64(x)
70 71 #define ASSERT32(x) ASSERT(x)
71 72 #endif
72 73
73 74 /*
74 75 * IMPLY and EQUIV are assertions of the form:
75 76 *
76 77 * if (a) then (b)
77 78 * and
78 79 * if (a) then (b) *AND* if (b) then (a)
79 80 */
80 81 #if DEBUG
81 82 #define IMPLY(A, B) \
82 83 ((void)(((!(A)) || (B)) || \
83 84 assfail("(" #A ") implies (" #B ")", __FILE__, __LINE__)))
84 85 #define EQUIV(A, B) \
85 86 ((void)((!!(A) == !!(B)) || \
86 87 assfail("(" #A ") is equivalent to (" #B ")", __FILE__, __LINE__)))
87 88 #else
88 89 #define IMPLY(A, B) ((void)0)
89 90 #define EQUIV(A, B) ((void)0)
90 91 #endif
91 92
92 93 /*
93 94 * ASSERT3() behaves like ASSERT() except that it is an explicit conditional,
94 95 * and prints out the values of the left and right hand expressions as part of
95 96 * the panic message to ease debugging. The three variants imply the type
96 97 * of their arguments. ASSERT3S() is for signed data types, ASSERT3U() is
97 98 * for unsigned, and ASSERT3P() is for pointers. The VERIFY3*() macros
98 99 * have the same relationship as above.
99 100 */
100 101 extern void assfail3(const char *, uintmax_t, const char *, uintmax_t,
101 102 const char *, int);
102 103 #define VERIFY3_IMPL(LEFT, OP, RIGHT, TYPE) do { \
103 104 const TYPE __left = (TYPE)(LEFT); \
104 105 const TYPE __right = (TYPE)(RIGHT); \
105 106 if (!(__left OP __right)) \
106 107 assfail3(#LEFT " " #OP " " #RIGHT, \
107 108 (uintmax_t)__left, #OP, (uintmax_t)__right, \
108 109 __FILE__, __LINE__); \
109 110 _NOTE(CONSTCOND) } while (0)
110 111
111 112 #define VERIFY3B(x, y, z) VERIFY3_IMPL(x, y, z, boolean_t)
112 113 #define VERIFY3S(x, y, z) VERIFY3_IMPL(x, y, z, int64_t)
113 114 #define VERIFY3U(x, y, z) VERIFY3_IMPL(x, y, z, uint64_t)
114 115 #define VERIFY3P(x, y, z) VERIFY3_IMPL(x, y, z, uintptr_t)
115 116 #define VERIFY0(x) VERIFY3_IMPL(x, ==, 0, uintmax_t)
116 117
117 118 #if DEBUG
118 119 #define ASSERT3B(x, y, z) VERIFY3_IMPL(x, y, z, boolean_t)
119 120 #define ASSERT3S(x, y, z) VERIFY3_IMPL(x, y, z, int64_t)
120 121 #define ASSERT3U(x, y, z) VERIFY3_IMPL(x, y, z, uint64_t)
121 122 #define ASSERT3P(x, y, z) VERIFY3_IMPL(x, y, z, uintptr_t)
122 123 #define ASSERT0(x) VERIFY3_IMPL(x, ==, 0, uintmax_t)
123 124 #else
124 125 #define ASSERT3B(x, y, z) ((void)0)
125 126 #define ASSERT3S(x, y, z) ((void)0)
126 127 #define ASSERT3U(x, y, z) ((void)0)
127 128 #define ASSERT3P(x, y, z) ((void)0)
128 129 #define ASSERT0(x) ((void)0)
|
↓ open down ↓ |
88 lines elided |
↑ open up ↑ |
129 130 #endif
130 131
131 132 /*
132 133 * Compile-time assertion. The condition 'x' must be constant.
133 134 */
134 135 #define CTASSERT(x) _CTASSERT(x, __LINE__)
135 136 #define _CTASSERT(x, y) __CTASSERT(x, y)
136 137 #define __CTASSERT(x, y) \
137 138 typedef char __compile_time_assertion__ ## y [(x) ? 1 : -1] __unused
138 139
139 -#ifdef _KERNEL
140 +#if defined(_KERNEL) || defined(_FAKE_KERNEL)
140 141
141 142 extern void abort_sequence_enter(char *);
142 143 extern void debug_enter(char *);
143 144
144 -#endif /* _KERNEL */
145 +#endif /* _KERNEL || _FAKE_KERNEL */
145 146
146 147 #if defined(DEBUG) && !defined(__sun)
147 148 /* CSTYLED */
148 149 #define STATIC
149 150 #else
150 151 /* CSTYLED */
151 152 #define STATIC static
152 153 #endif
153 154
154 155 #ifdef __cplusplus
155 156 }
156 157 #endif
157 158
158 159 #endif /* _SYS_DEBUG_H */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX