1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
/* automatically generated by rust-bindgen 0.56.0 */

pub const ZFS_MAX_DATASET_NAME_LEN: u32 = 256;
pub mod boolean_t {
    pub type Type = ::std::os::raw::c_uint;
    pub const B_FALSE: Type = 0;
    pub const B_TRUE: Type = 1;
}
pub type uchar_t = ::std::os::raw::c_uchar;
pub type uint_t = ::std::os::raw::c_uint;
pub type nvlist_t = nvlist;
pub mod pool_initialize_func {
    pub type Type = ::std::os::raw::c_uint;
    pub const POOL_INITIALIZE_START: Type = 0;
    pub const POOL_INITIALIZE_CANCEL: Type = 1;
    pub const POOL_INITIALIZE_SUSPEND: Type = 2;
    pub const POOL_INITIALIZE_FUNCS: Type = 3;
}
pub use self::pool_initialize_func::Type as pool_initialize_func_t;
pub mod pool_trim_func {
    pub type Type = ::std::os::raw::c_uint;
    pub const POOL_TRIM_START: Type = 0;
    pub const POOL_TRIM_CANCEL: Type = 1;
    pub const POOL_TRIM_SUSPEND: Type = 2;
    pub const POOL_TRIM_FUNCS: Type = 3;
}
pub use self::pool_trim_func::Type as pool_trim_func_t;
pub mod zpool_wait_activity_t {
    pub type Type = ::std::os::raw::c_uint;
    pub const ZPOOL_WAIT_CKPT_DISCARD: Type = 0;
    pub const ZPOOL_WAIT_FREE: Type = 1;
    pub const ZPOOL_WAIT_INITIALIZE: Type = 2;
    pub const ZPOOL_WAIT_REPLACE: Type = 3;
    pub const ZPOOL_WAIT_REMOVE: Type = 4;
    pub const ZPOOL_WAIT_RESILVER: Type = 5;
    pub const ZPOOL_WAIT_SCRUB: Type = 6;
    pub const ZPOOL_WAIT_TRIM: Type = 7;
    pub const ZPOOL_WAIT_NUM_ACTIVITIES: Type = 8;
}
pub mod zfs_wait_activity_t {
    pub type Type = ::std::os::raw::c_uint;
    pub const ZFS_WAIT_DELETEQ: Type = 0;
    pub const ZFS_WAIT_NUM_ACTIVITIES: Type = 1;
}
extern "C" {
    pub fn libzfs_core_init() -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn libzfs_core_fini();
}
pub mod lzc_dataset_type {
    pub type Type = ::std::os::raw::c_uint;
    pub const LZC_DATSET_TYPE_ZFS: Type = 2;
    pub const LZC_DATSET_TYPE_ZVOL: Type = 3;
}
extern "C" {
    pub fn lzc_snapshot(
        arg1: *mut nvlist_t,
        arg2: *mut nvlist_t,
        arg3: *mut *mut nvlist_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn lzc_create(
        arg1: *const ::std::os::raw::c_char,
        arg2: lzc_dataset_type::Type,
        arg3: *mut nvlist_t,
        arg4: *mut u8,
        arg5: uint_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn lzc_clone(
        arg1: *const ::std::os::raw::c_char,
        arg2: *const ::std::os::raw::c_char,
        arg3: *mut nvlist_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn lzc_promote(
        arg1: *const ::std::os::raw::c_char,
        arg2: *mut ::std::os::raw::c_char,
        arg3: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn lzc_destroy_snaps(
        arg1: *mut nvlist_t,
        arg2: boolean_t::Type,
        arg3: *mut *mut nvlist_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn lzc_bookmark(arg1: *mut nvlist_t, arg2: *mut *mut nvlist_t) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn lzc_get_bookmarks(
        arg1: *const ::std::os::raw::c_char,
        arg2: *mut nvlist_t,
        arg3: *mut *mut nvlist_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn lzc_get_bookmark_props(
        arg1: *const ::std::os::raw::c_char,
        arg2: *mut *mut nvlist_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn lzc_destroy_bookmarks(
        arg1: *mut nvlist_t,
        arg2: *mut *mut nvlist_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn lzc_load_key(
        arg1: *const ::std::os::raw::c_char,
        arg2: boolean_t::Type,
        arg3: *mut u8,
        arg4: uint_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn lzc_unload_key(arg1: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn lzc_change_key(
        arg1: *const ::std::os::raw::c_char,
        arg2: u64,
        arg3: *mut nvlist_t,
        arg4: *mut u8,
        arg5: uint_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn lzc_initialize(
        arg1: *const ::std::os::raw::c_char,
        arg2: pool_initialize_func_t,
        arg3: *mut nvlist_t,
        arg4: *mut *mut nvlist_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn lzc_trim(
        arg1: *const ::std::os::raw::c_char,
        arg2: pool_trim_func_t,
        arg3: u64,
        arg4: boolean_t::Type,
        arg5: *mut nvlist_t,
        arg6: *mut *mut nvlist_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn lzc_redact(
        arg1: *const ::std::os::raw::c_char,
        arg2: *const ::std::os::raw::c_char,
        arg3: *mut nvlist_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn lzc_snaprange_space(
        arg1: *const ::std::os::raw::c_char,
        arg2: *const ::std::os::raw::c_char,
        arg3: *mut u64,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn lzc_hold(
        arg1: *mut nvlist_t,
        arg2: ::std::os::raw::c_int,
        arg3: *mut *mut nvlist_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn lzc_release(arg1: *mut nvlist_t, arg2: *mut *mut nvlist_t) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn lzc_get_holds(
        arg1: *const ::std::os::raw::c_char,
        arg2: *mut *mut nvlist_t,
    ) -> ::std::os::raw::c_int;
}
pub mod lzc_send_flags {
    pub type Type = ::std::os::raw::c_uint;
    pub const LZC_SEND_FLAG_EMBED_DATA: Type = 1;
    pub const LZC_SEND_FLAG_LARGE_BLOCK: Type = 2;
    pub const LZC_SEND_FLAG_COMPRESS: Type = 4;
    pub const LZC_SEND_FLAG_RAW: Type = 8;
    pub const LZC_SEND_FLAG_SAVED: Type = 16;
}
extern "C" {
    pub fn lzc_send(
        arg1: *const ::std::os::raw::c_char,
        arg2: *const ::std::os::raw::c_char,
        arg3: ::std::os::raw::c_int,
        arg4: lzc_send_flags::Type,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn lzc_send_resume(
        arg1: *const ::std::os::raw::c_char,
        arg2: *const ::std::os::raw::c_char,
        arg3: ::std::os::raw::c_int,
        arg4: lzc_send_flags::Type,
        arg5: u64,
        arg6: u64,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn lzc_send_space(
        arg1: *const ::std::os::raw::c_char,
        arg2: *const ::std::os::raw::c_char,
        arg3: lzc_send_flags::Type,
        arg4: *mut u64,
    ) -> ::std::os::raw::c_int;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct dmu_replay_record {
    _unused: [u8; 0],
}
extern "C" {
    pub fn lzc_send_redacted(
        arg1: *const ::std::os::raw::c_char,
        arg2: *const ::std::os::raw::c_char,
        arg3: ::std::os::raw::c_int,
        arg4: lzc_send_flags::Type,
        arg5: *const ::std::os::raw::c_char,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn lzc_send_resume_redacted(
        arg1: *const ::std::os::raw::c_char,
        arg2: *const ::std::os::raw::c_char,
        arg3: ::std::os::raw::c_int,
        arg4: lzc_send_flags::Type,
        arg5: u64,
        arg6: u64,
        arg7: *const ::std::os::raw::c_char,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn lzc_receive(
        arg1: *const ::std::os::raw::c_char,
        arg2: *mut nvlist_t,
        arg3: *const ::std::os::raw::c_char,
        arg4: boolean_t::Type,
        arg5: boolean_t::Type,
        arg6: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn lzc_receive_resumable(
        arg1: *const ::std::os::raw::c_char,
        arg2: *mut nvlist_t,
        arg3: *const ::std::os::raw::c_char,
        arg4: boolean_t::Type,
        arg5: boolean_t::Type,
        arg6: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn lzc_receive_with_header(
        arg1: *const ::std::os::raw::c_char,
        arg2: *mut nvlist_t,
        arg3: *const ::std::os::raw::c_char,
        arg4: boolean_t::Type,
        arg5: boolean_t::Type,
        arg6: boolean_t::Type,
        arg7: ::std::os::raw::c_int,
        arg8: *const dmu_replay_record,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn lzc_receive_one(
        arg1: *const ::std::os::raw::c_char,
        arg2: *mut nvlist_t,
        arg3: *const ::std::os::raw::c_char,
        arg4: boolean_t::Type,
        arg5: boolean_t::Type,
        arg6: boolean_t::Type,
        arg7: ::std::os::raw::c_int,
        arg8: *const dmu_replay_record,
        arg9: ::std::os::raw::c_int,
        arg10: *mut u64,
        arg11: *mut u64,
        arg12: *mut u64,
        arg13: *mut *mut nvlist_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn lzc_receive_with_cmdprops(
        arg1: *const ::std::os::raw::c_char,
        arg2: *mut nvlist_t,
        arg3: *mut nvlist_t,
        arg4: *mut u8,
        arg5: uint_t,
        arg6: *const ::std::os::raw::c_char,
        arg7: boolean_t::Type,
        arg8: boolean_t::Type,
        arg9: boolean_t::Type,
        arg10: ::std::os::raw::c_int,
        arg11: *const dmu_replay_record,
        arg12: ::std::os::raw::c_int,
        arg13: *mut u64,
        arg14: *mut u64,
        arg15: *mut u64,
        arg16: *mut *mut nvlist_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn lzc_send_space_resume_redacted(
        arg1: *const ::std::os::raw::c_char,
        arg2: *const ::std::os::raw::c_char,
        arg3: lzc_send_flags::Type,
        arg4: u64,
        arg5: u64,
        arg6: u64,
        arg7: *const ::std::os::raw::c_char,
        arg8: ::std::os::raw::c_int,
        arg9: *mut u64,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn lzc_send_progress(arg1: ::std::os::raw::c_int) -> u64;
}
extern "C" {
    pub fn lzc_exists(arg1: *const ::std::os::raw::c_char) -> boolean_t::Type;
}
extern "C" {
    pub fn lzc_rollback(
        arg1: *const ::std::os::raw::c_char,
        arg2: *mut ::std::os::raw::c_char,
        arg3: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn lzc_rollback_to(
        arg1: *const ::std::os::raw::c_char,
        arg2: *const ::std::os::raw::c_char,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn lzc_rename(
        arg1: *const ::std::os::raw::c_char,
        arg2: *const ::std::os::raw::c_char,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn lzc_destroy(arg1: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn lzc_channel_program(
        arg1: *const ::std::os::raw::c_char,
        arg2: *const ::std::os::raw::c_char,
        arg3: u64,
        arg4: u64,
        arg5: *mut nvlist_t,
        arg6: *mut *mut nvlist_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn lzc_channel_program_nosync(
        arg1: *const ::std::os::raw::c_char,
        arg2: *const ::std::os::raw::c_char,
        arg3: u64,
        arg4: u64,
        arg5: *mut nvlist_t,
        arg6: *mut *mut nvlist_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn lzc_sync(
        arg1: *const ::std::os::raw::c_char,
        arg2: *mut nvlist_t,
        arg3: *mut *mut nvlist_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn lzc_reopen(
        arg1: *const ::std::os::raw::c_char,
        arg2: boolean_t::Type,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn lzc_pool_checkpoint(arg1: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn lzc_pool_checkpoint_discard(
        arg1: *const ::std::os::raw::c_char,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn lzc_wait(
        arg1: *const ::std::os::raw::c_char,
        arg2: zpool_wait_activity_t::Type,
        arg3: *mut boolean_t::Type,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn lzc_wait_tag(
        arg1: *const ::std::os::raw::c_char,
        arg2: zpool_wait_activity_t::Type,
        arg3: u64,
        arg4: *mut boolean_t::Type,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn lzc_wait_fs(
        arg1: *const ::std::os::raw::c_char,
        arg2: zfs_wait_activity_t::Type,
        arg3: *mut boolean_t::Type,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn lzc_set_bootenv(
        arg1: *const ::std::os::raw::c_char,
        arg2: *const nvlist_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn lzc_get_bootenv(
        arg1: *const ::std::os::raw::c_char,
        arg2: *mut *mut nvlist_t,
    ) -> ::std::os::raw::c_int;
}