27
27
#ifndef _SYS_FS_ZFS_VFSOPS_H
28
28
#define _SYS_FS_ZFS_VFSOPS_H
29
29
30
- #if __FreeBSD_version >= 1300125
31
- #define TEARDOWN_RMS
32
- #endif
33
-
34
- #if __FreeBSD_version >= 1300109
35
- #define TEARDOWN_INACTIVE_RMS
36
- #endif
37
-
38
30
#include <sys/dataset_kstats.h>
39
31
#include <sys/list.h>
40
32
#include <sys/vfs.h>
41
33
#include <sys/zil.h>
42
34
#include <sys/sa.h>
43
35
#include <sys/rrwlock.h>
44
- #ifdef TEARDOWN_INACTIVE_RMS
45
36
#include <sys/rmlock.h>
46
- #endif
47
37
#include <sys/zfs_ioctl.h>
48
38
49
39
#ifdef __cplusplus
50
40
extern "C" {
51
41
#endif
52
42
53
- #ifdef TEARDOWN_RMS
54
43
typedef struct rmslock zfs_teardown_lock_t ;
55
- #else
56
- #define zfs_teardown_lock_t rrmlock_t
57
- #endif
58
-
59
- #ifdef TEARDOWN_INACTIVE_RMS
60
44
typedef struct rmslock zfs_teardown_inactive_lock_t ;
61
- #else
62
- #define zfs_teardown_inactive_lock_t krwlock_t
63
- #endif
64
45
65
46
typedef struct zfsvfs zfsvfs_t ;
66
47
struct znode ;
@@ -120,7 +101,6 @@ struct zfsvfs {
120
101
struct task z_unlinked_drain_task ;
121
102
};
122
103
123
- #ifdef TEARDOWN_RMS
124
104
#define ZFS_TEARDOWN_INIT (zfsvfs ) \
125
105
rms_init(&(zfsvfs)->z_teardown_lock, "zfs teardown")
126
106
@@ -150,39 +130,7 @@ struct zfsvfs {
150
130
151
131
#define ZFS_TEARDOWN_HELD (zfsvfs ) \
152
132
rms_owned_any(&(zfsvfs)->z_teardown_lock)
153
- #else
154
- #define ZFS_TEARDOWN_INIT (zfsvfs ) \
155
- rrm_init(&(zfsvfs)->z_teardown_lock, B_FALSE)
156
-
157
- #define ZFS_TEARDOWN_DESTROY (zfsvfs ) \
158
- rrm_destroy(&(zfsvfs)->z_teardown_lock)
159
-
160
- #define ZFS_TEARDOWN_ENTER_READ (zfsvfs , tag ) \
161
- rrm_enter_read(&(zfsvfs)->z_teardown_lock, tag);
162
-
163
- #define ZFS_TEARDOWN_EXIT_READ (zfsvfs , tag ) \
164
- rrm_exit(&(zfsvfs)->z_teardown_lock, tag)
165
-
166
- #define ZFS_TEARDOWN_ENTER_WRITE (zfsvfs , tag ) \
167
- rrm_enter(&(zfsvfs)->z_teardown_lock, RW_WRITER, tag)
168
-
169
- #define ZFS_TEARDOWN_EXIT_WRITE (zfsvfs ) \
170
- rrm_exit(&(zfsvfs)->z_teardown_lock, tag)
171
-
172
- #define ZFS_TEARDOWN_EXIT (zfsvfs , tag ) \
173
- rrm_exit(&(zfsvfs)->z_teardown_lock, tag)
174
-
175
- #define ZFS_TEARDOWN_READ_HELD (zfsvfs ) \
176
- RRM_READ_HELD(&(zfsvfs)->z_teardown_lock)
177
-
178
- #define ZFS_TEARDOWN_WRITE_HELD (zfsvfs ) \
179
- RRM_WRITE_HELD(&(zfsvfs)->z_teardown_lock)
180
-
181
- #define ZFS_TEARDOWN_HELD (zfsvfs ) \
182
- RRM_LOCK_HELD(&(zfsvfs)->z_teardown_lock)
183
- #endif
184
133
185
- #ifdef TEARDOWN_INACTIVE_RMS
186
134
#define ZFS_TEARDOWN_INACTIVE_INIT (zfsvfs ) \
187
135
rms_init(&(zfsvfs)->z_teardown_inactive_lock, "zfs teardown inactive")
188
136
@@ -206,31 +154,6 @@ struct zfsvfs {
206
154
207
155
#define ZFS_TEARDOWN_INACTIVE_WRITE_HELD (zfsvfs ) \
208
156
rms_wowned(&(zfsvfs)->z_teardown_inactive_lock)
209
- #else
210
- #define ZFS_TEARDOWN_INACTIVE_INIT (zfsvfs ) \
211
- rw_init(&(zfsvfs)->z_teardown_inactive_lock, NULL, RW_DEFAULT, NULL)
212
-
213
- #define ZFS_TEARDOWN_INACTIVE_DESTROY (zfsvfs ) \
214
- rw_destroy(&(zfsvfs)->z_teardown_inactive_lock)
215
-
216
- #define ZFS_TEARDOWN_INACTIVE_TRY_ENTER_READ (zfsvfs ) \
217
- rw_tryenter(&(zfsvfs)->z_teardown_inactive_lock, RW_READER)
218
-
219
- #define ZFS_TEARDOWN_INACTIVE_ENTER_READ (zfsvfs ) \
220
- rw_enter(&(zfsvfs)->z_teardown_inactive_lock, RW_READER)
221
-
222
- #define ZFS_TEARDOWN_INACTIVE_EXIT_READ (zfsvfs ) \
223
- rw_exit(&(zfsvfs)->z_teardown_inactive_lock)
224
-
225
- #define ZFS_TEARDOWN_INACTIVE_ENTER_WRITE (zfsvfs ) \
226
- rw_enter(&(zfsvfs)->z_teardown_inactive_lock, RW_WRITER)
227
-
228
- #define ZFS_TEARDOWN_INACTIVE_EXIT_WRITE (zfsvfs ) \
229
- rw_exit(&(zfsvfs)->z_teardown_inactive_lock)
230
-
231
- #define ZFS_TEARDOWN_INACTIVE_WRITE_HELD (zfsvfs ) \
232
- RW_WRITE_HELD(&(zfsvfs)->z_teardown_inactive_lock)
233
- #endif
234
157
235
158
#define ZSB_XATTR 0x0001 /* Enable user xattrs */
236
159
/*
0 commit comments