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
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
#[repr(C)]
#[derive(Default)]
pub struct __IncompleteArrayField<T>(::std::marker::PhantomData<T>, [T; 0]);
impl<T> __IncompleteArrayField<T> {
#[inline]
pub const fn new() -> Self {
__IncompleteArrayField(::std::marker::PhantomData, [])
}
#[inline]
pub fn as_ptr(&self) -> *const T {
self as *const _ as *const T
}
#[inline]
pub fn as_mut_ptr(&mut self) -> *mut T {
self as *mut _ as *mut T
}
#[inline]
pub unsafe fn as_slice(&self, len: usize) -> &[T] {
::std::slice::from_raw_parts(self.as_ptr(), len)
}
#[inline]
pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] {
::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len)
}
}
impl<T> ::std::fmt::Debug for __IncompleteArrayField<T> {
fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
fmt.write_str("__IncompleteArrayField")
}
}
pub const __BITS_PER_LONG: u32 = 64;
pub const __FD_SETSIZE: u32 = 1024;
pub const DM_DIR: &'static [u8; 7usize] = b"mapper\0";
pub const DM_CONTROL_NODE: &'static [u8; 8usize] = b"control\0";
pub const DM_MAX_TYPE_NAME: u32 = 16;
pub const DM_NAME_LEN: u32 = 128;
pub const DM_UUID_LEN: u32 = 129;
pub const DM_IOCTL: u32 = 253;
pub const DM_VERSION_MAJOR: u32 = 4;
pub const DM_VERSION_MINOR: u32 = 41;
pub const DM_VERSION_PATCHLEVEL: u32 = 0;
pub const DM_VERSION_EXTRA: &'static [u8; 20usize] = b"-ioctl (2019-09-16)\0";
pub const DM_READONLY_FLAG: u32 = 1;
pub const DM_SUSPEND_FLAG: u32 = 2;
pub const DM_PERSISTENT_DEV_FLAG: u32 = 8;
pub const DM_STATUS_TABLE_FLAG: u32 = 16;
pub const DM_ACTIVE_PRESENT_FLAG: u32 = 32;
pub const DM_INACTIVE_PRESENT_FLAG: u32 = 64;
pub const DM_BUFFER_FULL_FLAG: u32 = 256;
pub const DM_SKIP_BDGET_FLAG: u32 = 512;
pub const DM_SKIP_LOCKFS_FLAG: u32 = 1024;
pub const DM_NOFLUSH_FLAG: u32 = 2048;
pub const DM_QUERY_INACTIVE_TABLE_FLAG: u32 = 4096;
pub const DM_UEVENT_GENERATED_FLAG: u32 = 8192;
pub const DM_UUID_FLAG: u32 = 16384;
pub const DM_SECURE_DATA_FLAG: u32 = 32768;
pub const DM_DATA_OUT_FLAG: u32 = 65536;
pub const DM_DEFERRED_REMOVE: u32 = 131072;
pub const DM_INTERNAL_SUSPEND_FLAG: u32 = 262144;
pub type __s8 = ::std::os::raw::c_schar;
pub type __u8 = ::std::os::raw::c_uchar;
pub type __s16 = ::std::os::raw::c_short;
pub type __u16 = ::std::os::raw::c_ushort;
pub type __s32 = ::std::os::raw::c_int;
pub type __u32 = ::std::os::raw::c_uint;
pub type __s64 = ::std::os::raw::c_longlong;
pub type __u64 = ::std::os::raw::c_ulonglong;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct __kernel_fd_set {
pub fds_bits: [::std::os::raw::c_ulong; 16usize],
}
#[test]
fn bindgen_test_layout___kernel_fd_set() {
assert_eq!(
::std::mem::size_of::<__kernel_fd_set>(),
128usize,
concat!("Size of: ", stringify!(__kernel_fd_set))
);
assert_eq!(
::std::mem::align_of::<__kernel_fd_set>(),
8usize,
concat!("Alignment of ", stringify!(__kernel_fd_set))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<__kernel_fd_set>())).fds_bits as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(__kernel_fd_set),
"::",
stringify!(fds_bits)
)
);
}
pub type __kernel_sighandler_t =
::std::option::Option<unsafe extern "C" fn(arg1: ::std::os::raw::c_int)>;
pub type __kernel_key_t = ::std::os::raw::c_int;
pub type __kernel_mqd_t = ::std::os::raw::c_int;
pub type __kernel_old_uid_t = ::std::os::raw::c_ushort;
pub type __kernel_old_gid_t = ::std::os::raw::c_ushort;
pub type __kernel_old_dev_t = ::std::os::raw::c_ulong;
pub type __kernel_long_t = ::std::os::raw::c_long;
pub type __kernel_ulong_t = ::std::os::raw::c_ulong;
pub type __kernel_ino_t = __kernel_ulong_t;
pub type __kernel_mode_t = ::std::os::raw::c_uint;
pub type __kernel_pid_t = ::std::os::raw::c_int;
pub type __kernel_ipc_pid_t = ::std::os::raw::c_int;
pub type __kernel_uid_t = ::std::os::raw::c_uint;
pub type __kernel_gid_t = ::std::os::raw::c_uint;
pub type __kernel_suseconds_t = __kernel_long_t;
pub type __kernel_daddr_t = ::std::os::raw::c_int;
pub type __kernel_uid32_t = ::std::os::raw::c_uint;
pub type __kernel_gid32_t = ::std::os::raw::c_uint;
pub type __kernel_size_t = __kernel_ulong_t;
pub type __kernel_ssize_t = __kernel_long_t;
pub type __kernel_ptrdiff_t = __kernel_long_t;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct __kernel_fsid_t {
pub val: [::std::os::raw::c_int; 2usize],
}
#[test]
fn bindgen_test_layout___kernel_fsid_t() {
assert_eq!(
::std::mem::size_of::<__kernel_fsid_t>(),
8usize,
concat!("Size of: ", stringify!(__kernel_fsid_t))
);
assert_eq!(
::std::mem::align_of::<__kernel_fsid_t>(),
4usize,
concat!("Alignment of ", stringify!(__kernel_fsid_t))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<__kernel_fsid_t>())).val as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(__kernel_fsid_t),
"::",
stringify!(val)
)
);
}
pub type __kernel_off_t = __kernel_long_t;
pub type __kernel_loff_t = ::std::os::raw::c_longlong;
pub type __kernel_time_t = __kernel_long_t;
pub type __kernel_time64_t = ::std::os::raw::c_longlong;
pub type __kernel_clock_t = __kernel_long_t;
pub type __kernel_timer_t = ::std::os::raw::c_int;
pub type __kernel_clockid_t = ::std::os::raw::c_int;
pub type __kernel_caddr_t = *mut ::std::os::raw::c_char;
pub type __kernel_uid16_t = ::std::os::raw::c_ushort;
pub type __kernel_gid16_t = ::std::os::raw::c_ushort;
pub type __le16 = __u16;
pub type __be16 = __u16;
pub type __le32 = __u32;
pub type __be32 = __u32;
pub type __le64 = __u64;
pub type __be64 = __u64;
pub type __sum16 = __u16;
pub type __wsum = __u32;
pub type __poll_t = ::std::os::raw::c_uint;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct dm_ioctl {
pub version: [__u32; 3usize],
pub data_size: __u32,
pub data_start: __u32,
pub target_count: __u32,
pub open_count: __s32,
pub flags: __u32,
pub event_nr: __u32,
pub padding: __u32,
pub dev: __u64,
pub name: [::std::os::raw::c_char; 128usize],
pub uuid: [::std::os::raw::c_char; 129usize],
pub data: [::std::os::raw::c_char; 7usize],
}
#[test]
fn bindgen_test_layout_dm_ioctl() {
assert_eq!(
::std::mem::size_of::<dm_ioctl>(),
312usize,
concat!("Size of: ", stringify!(dm_ioctl))
);
assert_eq!(
::std::mem::align_of::<dm_ioctl>(),
8usize,
concat!("Alignment of ", stringify!(dm_ioctl))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<dm_ioctl>())).version as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(dm_ioctl),
"::",
stringify!(version)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<dm_ioctl>())).data_size as *const _ as usize },
12usize,
concat!(
"Offset of field: ",
stringify!(dm_ioctl),
"::",
stringify!(data_size)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<dm_ioctl>())).data_start as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(dm_ioctl),
"::",
stringify!(data_start)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<dm_ioctl>())).target_count as *const _ as usize },
20usize,
concat!(
"Offset of field: ",
stringify!(dm_ioctl),
"::",
stringify!(target_count)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<dm_ioctl>())).open_count as *const _ as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(dm_ioctl),
"::",
stringify!(open_count)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<dm_ioctl>())).flags as *const _ as usize },
28usize,
concat!(
"Offset of field: ",
stringify!(dm_ioctl),
"::",
stringify!(flags)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<dm_ioctl>())).event_nr as *const _ as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(dm_ioctl),
"::",
stringify!(event_nr)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<dm_ioctl>())).padding as *const _ as usize },
36usize,
concat!(
"Offset of field: ",
stringify!(dm_ioctl),
"::",
stringify!(padding)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<dm_ioctl>())).dev as *const _ as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(dm_ioctl),
"::",
stringify!(dev)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<dm_ioctl>())).name as *const _ as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(dm_ioctl),
"::",
stringify!(name)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<dm_ioctl>())).uuid as *const _ as usize },
176usize,
concat!(
"Offset of field: ",
stringify!(dm_ioctl),
"::",
stringify!(uuid)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<dm_ioctl>())).data as *const _ as usize },
305usize,
concat!(
"Offset of field: ",
stringify!(dm_ioctl),
"::",
stringify!(data)
)
);
}
impl Default for dm_ioctl {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct dm_target_spec {
pub sector_start: __u64,
pub length: __u64,
pub status: __s32,
pub next: __u32,
pub target_type: [::std::os::raw::c_char; 16usize],
}
#[test]
fn bindgen_test_layout_dm_target_spec() {
assert_eq!(
::std::mem::size_of::<dm_target_spec>(),
40usize,
concat!("Size of: ", stringify!(dm_target_spec))
);
assert_eq!(
::std::mem::align_of::<dm_target_spec>(),
8usize,
concat!("Alignment of ", stringify!(dm_target_spec))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<dm_target_spec>())).sector_start as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(dm_target_spec),
"::",
stringify!(sector_start)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<dm_target_spec>())).length as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(dm_target_spec),
"::",
stringify!(length)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<dm_target_spec>())).status as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(dm_target_spec),
"::",
stringify!(status)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<dm_target_spec>())).next as *const _ as usize },
20usize,
concat!(
"Offset of field: ",
stringify!(dm_target_spec),
"::",
stringify!(next)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<dm_target_spec>())).target_type as *const _ as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(dm_target_spec),
"::",
stringify!(target_type)
)
);
}
#[repr(C)]
#[derive(Debug, Default)]
pub struct dm_target_deps {
pub count: __u32,
pub padding: __u32,
pub dev: __IncompleteArrayField<__u64>,
}
#[test]
fn bindgen_test_layout_dm_target_deps() {
assert_eq!(
::std::mem::size_of::<dm_target_deps>(),
8usize,
concat!("Size of: ", stringify!(dm_target_deps))
);
assert_eq!(
::std::mem::align_of::<dm_target_deps>(),
8usize,
concat!("Alignment of ", stringify!(dm_target_deps))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<dm_target_deps>())).count as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(dm_target_deps),
"::",
stringify!(count)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<dm_target_deps>())).padding as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(dm_target_deps),
"::",
stringify!(padding)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<dm_target_deps>())).dev as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(dm_target_deps),
"::",
stringify!(dev)
)
);
}
#[repr(C)]
#[derive(Debug, Default)]
pub struct dm_name_list {
pub dev: __u64,
pub next: __u32,
pub name: __IncompleteArrayField<::std::os::raw::c_char>,
}
#[test]
fn bindgen_test_layout_dm_name_list() {
assert_eq!(
::std::mem::size_of::<dm_name_list>(),
16usize,
concat!("Size of: ", stringify!(dm_name_list))
);
assert_eq!(
::std::mem::align_of::<dm_name_list>(),
8usize,
concat!("Alignment of ", stringify!(dm_name_list))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<dm_name_list>())).dev as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(dm_name_list),
"::",
stringify!(dev)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<dm_name_list>())).next as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(dm_name_list),
"::",
stringify!(next)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<dm_name_list>())).name as *const _ as usize },
12usize,
concat!(
"Offset of field: ",
stringify!(dm_name_list),
"::",
stringify!(name)
)
);
}
#[repr(C)]
#[derive(Debug, Default)]
pub struct dm_target_versions {
pub next: __u32,
pub version: [__u32; 3usize],
pub name: __IncompleteArrayField<::std::os::raw::c_char>,
}
#[test]
fn bindgen_test_layout_dm_target_versions() {
assert_eq!(
::std::mem::size_of::<dm_target_versions>(),
16usize,
concat!("Size of: ", stringify!(dm_target_versions))
);
assert_eq!(
::std::mem::align_of::<dm_target_versions>(),
4usize,
concat!("Alignment of ", stringify!(dm_target_versions))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<dm_target_versions>())).next as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(dm_target_versions),
"::",
stringify!(next)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<dm_target_versions>())).version as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(dm_target_versions),
"::",
stringify!(version)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<dm_target_versions>())).name as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(dm_target_versions),
"::",
stringify!(name)
)
);
}
#[repr(C)]
#[derive(Debug, Default)]
pub struct dm_target_msg {
pub sector: __u64,
pub message: __IncompleteArrayField<::std::os::raw::c_char>,
}
#[test]
fn bindgen_test_layout_dm_target_msg() {
assert_eq!(
::std::mem::size_of::<dm_target_msg>(),
8usize,
concat!("Size of: ", stringify!(dm_target_msg))
);
assert_eq!(
::std::mem::align_of::<dm_target_msg>(),
8usize,
concat!("Alignment of ", stringify!(dm_target_msg))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<dm_target_msg>())).sector as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(dm_target_msg),
"::",
stringify!(sector)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<dm_target_msg>())).message as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(dm_target_msg),
"::",
stringify!(message)
)
);
}
pub const DM_VERSION_CMD: ::std::os::raw::c_uint = 0;
pub const DM_REMOVE_ALL_CMD: ::std::os::raw::c_uint = 1;
pub const DM_LIST_DEVICES_CMD: ::std::os::raw::c_uint = 2;
pub const DM_DEV_CREATE_CMD: ::std::os::raw::c_uint = 3;
pub const DM_DEV_REMOVE_CMD: ::std::os::raw::c_uint = 4;
pub const DM_DEV_RENAME_CMD: ::std::os::raw::c_uint = 5;
pub const DM_DEV_SUSPEND_CMD: ::std::os::raw::c_uint = 6;
pub const DM_DEV_STATUS_CMD: ::std::os::raw::c_uint = 7;
pub const DM_DEV_WAIT_CMD: ::std::os::raw::c_uint = 8;
pub const DM_TABLE_LOAD_CMD: ::std::os::raw::c_uint = 9;
pub const DM_TABLE_CLEAR_CMD: ::std::os::raw::c_uint = 10;
pub const DM_TABLE_DEPS_CMD: ::std::os::raw::c_uint = 11;
pub const DM_TABLE_STATUS_CMD: ::std::os::raw::c_uint = 12;
pub const DM_LIST_VERSIONS_CMD: ::std::os::raw::c_uint = 13;
pub const DM_TARGET_MSG_CMD: ::std::os::raw::c_uint = 14;
pub const DM_DEV_SET_GEOMETRY_CMD: ::std::os::raw::c_uint = 15;
pub const DM_DEV_ARM_POLL_CMD: ::std::os::raw::c_uint = 16;
pub const DM_GET_TARGET_VERSION_CMD: ::std::os::raw::c_uint = 17;
pub type _bindgen_ty_1 = ::std::os::raw::c_uint;