-
Notifications
You must be signed in to change notification settings - Fork 54
Expand file tree
/
Copy pathbtrfs.rs
More file actions
1937 lines (1936 loc) · 57.4 KB
/
btrfs.rs
File metadata and controls
1937 lines (1936 loc) · 57.4 KB
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
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* automatically generated by rust-bindgen 0.72.1 */
pub type __s8 = crate::ctypes::c_schar;
pub type __u8 = crate::ctypes::c_uchar;
pub type __s16 = crate::ctypes::c_short;
pub type __u16 = crate::ctypes::c_ushort;
pub type __s32 = crate::ctypes::c_int;
pub type __u32 = crate::ctypes::c_uint;
pub type __s64 = crate::ctypes::c_longlong;
pub type __u64 = crate::ctypes::c_ulonglong;
pub type __kernel_key_t = crate::ctypes::c_int;
pub type __kernel_mqd_t = crate::ctypes::c_int;
pub type __kernel_long_t = crate::ctypes::c_long;
pub type __kernel_ulong_t = crate::ctypes::c_ulong;
pub type __kernel_ino_t = __kernel_ulong_t;
pub type __kernel_mode_t = crate::ctypes::c_uint;
pub type __kernel_pid_t = crate::ctypes::c_int;
pub type __kernel_ipc_pid_t = crate::ctypes::c_int;
pub type __kernel_uid_t = crate::ctypes::c_uint;
pub type __kernel_gid_t = crate::ctypes::c_uint;
pub type __kernel_suseconds_t = __kernel_long_t;
pub type __kernel_daddr_t = crate::ctypes::c_int;
pub type __kernel_uid32_t = crate::ctypes::c_uint;
pub type __kernel_gid32_t = crate::ctypes::c_uint;
pub type __kernel_old_uid_t = __kernel_uid_t;
pub type __kernel_old_gid_t = __kernel_gid_t;
pub type __kernel_old_dev_t = crate::ctypes::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;
pub type __kernel_off_t = __kernel_long_t;
pub type __kernel_loff_t = crate::ctypes::c_longlong;
pub type __kernel_old_time_t = __kernel_long_t;
pub type __kernel_time_t = __kernel_long_t;
pub type __kernel_time64_t = crate::ctypes::c_longlong;
pub type __kernel_clock_t = __kernel_long_t;
pub type __kernel_timer_t = crate::ctypes::c_int;
pub type __kernel_clockid_t = crate::ctypes::c_int;
pub type __kernel_caddr_t = *mut crate::ctypes::c_char;
pub type __kernel_uid16_t = crate::ctypes::c_ushort;
pub type __kernel_gid16_t = crate::ctypes::c_ushort;
pub type __s128 = i128;
pub type __u128 = u128;
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 = crate::ctypes::c_uint;
pub type __kernel_rwf_t = crate::ctypes::c_int;
#[repr(C)]
#[derive(Default)]
pub struct __IncompleteArrayField<T>(::core::marker::PhantomData<T>, [T; 0]);
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fscrypt_policy_v1 {
pub version: __u8,
pub contents_encryption_mode: __u8,
pub filenames_encryption_mode: __u8,
pub flags: __u8,
pub master_key_descriptor: [__u8; 8usize],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fscrypt_key {
pub mode: __u32,
pub raw: [__u8; 64usize],
pub size: __u32,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fscrypt_policy_v2 {
pub version: __u8,
pub contents_encryption_mode: __u8,
pub filenames_encryption_mode: __u8,
pub flags: __u8,
pub log2_data_unit_size: __u8,
pub __reserved: [__u8; 3usize],
pub master_key_identifier: [__u8; 16usize],
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct fscrypt_get_policy_ex_arg {
pub policy_size: __u64,
pub policy: fscrypt_get_policy_ex_arg__bindgen_ty_1,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct fscrypt_key_specifier {
pub type_: __u32,
pub __reserved: __u32,
pub u: fscrypt_key_specifier__bindgen_ty_1,
}
#[repr(C)]
#[derive(Debug)]
pub struct fscrypt_provisioning_key_payload {
pub type_: __u32,
pub flags: __u32,
pub raw: __IncompleteArrayField<__u8>,
}
#[repr(C)]
pub struct fscrypt_add_key_arg {
pub key_spec: fscrypt_key_specifier,
pub raw_size: __u32,
pub key_id: __u32,
pub flags: __u32,
pub __reserved: [__u32; 7usize],
pub raw: __IncompleteArrayField<__u8>,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct fscrypt_remove_key_arg {
pub key_spec: fscrypt_key_specifier,
pub removal_status_flags: __u32,
pub __reserved: [__u32; 5usize],
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct fscrypt_get_key_status_arg {
pub key_spec: fscrypt_key_specifier,
pub __reserved: [__u32; 6usize],
pub status: __u32,
pub status_flags: __u32,
pub user_count: __u32,
pub __out_reserved: [__u32; 13usize],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct mount_attr {
pub attr_set: __u64,
pub attr_clr: __u64,
pub propagation: __u64,
pub userns_fd: __u64,
}
#[repr(C)]
#[derive(Debug)]
pub struct statmount {
pub size: __u32,
pub mnt_opts: __u32,
pub mask: __u64,
pub sb_dev_major: __u32,
pub sb_dev_minor: __u32,
pub sb_magic: __u64,
pub sb_flags: __u32,
pub fs_type: __u32,
pub mnt_id: __u64,
pub mnt_parent_id: __u64,
pub mnt_id_old: __u32,
pub mnt_parent_id_old: __u32,
pub mnt_attr: __u64,
pub mnt_propagation: __u64,
pub mnt_peer_group: __u64,
pub mnt_master: __u64,
pub propagate_from: __u64,
pub mnt_root: __u32,
pub mnt_point: __u32,
pub mnt_ns_id: __u64,
pub fs_subtype: __u32,
pub sb_source: __u32,
pub opt_num: __u32,
pub opt_array: __u32,
pub opt_sec_num: __u32,
pub opt_sec_array: __u32,
pub supported_mask: __u64,
pub mnt_uidmap_num: __u32,
pub mnt_uidmap: __u32,
pub mnt_gidmap_num: __u32,
pub mnt_gidmap: __u32,
pub __spare2: [__u64; 43usize],
pub str_: __IncompleteArrayField<crate::ctypes::c_char>,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct mnt_id_req {
pub size: __u32,
pub spare: __u32,
pub mnt_id: __u64,
pub param: __u64,
pub mnt_ns_id: __u64,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct file_clone_range {
pub src_fd: __s64,
pub src_offset: __u64,
pub src_length: __u64,
pub dest_offset: __u64,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fstrim_range {
pub start: __u64,
pub len: __u64,
pub minlen: __u64,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fsuuid2 {
pub len: __u8,
pub uuid: [__u8; 16usize],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fs_sysfs_path {
pub len: __u8,
pub name: [__u8; 128usize],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct logical_block_metadata_cap {
pub lbmd_flags: __u32,
pub lbmd_interval: __u16,
pub lbmd_size: __u8,
pub lbmd_opaque_size: __u8,
pub lbmd_opaque_offset: __u8,
pub lbmd_pi_size: __u8,
pub lbmd_pi_offset: __u8,
pub lbmd_guard_tag_type: __u8,
pub lbmd_app_tag_size: __u8,
pub lbmd_ref_tag_size: __u8,
pub lbmd_storage_tag_size: __u8,
pub pad: __u8,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct file_dedupe_range_info {
pub dest_fd: __s64,
pub dest_offset: __u64,
pub bytes_deduped: __u64,
pub status: __s32,
pub reserved: __u32,
}
#[repr(C)]
#[derive(Debug)]
pub struct file_dedupe_range {
pub src_offset: __u64,
pub src_length: __u64,
pub dest_count: __u16,
pub reserved1: __u16,
pub reserved2: __u32,
pub info: __IncompleteArrayField<file_dedupe_range_info>,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct files_stat_struct {
pub nr_files: crate::ctypes::c_ulong,
pub nr_free_files: crate::ctypes::c_ulong,
pub max_files: crate::ctypes::c_ulong,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct inodes_stat_t {
pub nr_inodes: crate::ctypes::c_long,
pub nr_unused: crate::ctypes::c_long,
pub dummy: [crate::ctypes::c_long; 5usize],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fsxattr {
pub fsx_xflags: __u32,
pub fsx_extsize: __u32,
pub fsx_nextents: __u32,
pub fsx_projid: __u32,
pub fsx_cowextsize: __u32,
pub fsx_pad: [crate::ctypes::c_uchar; 8usize],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct file_attr {
pub fa_xflags: __u64,
pub fa_extsize: __u32,
pub fa_nextents: __u32,
pub fa_projid: __u32,
pub fa_cowextsize: __u32,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct page_region {
pub start: __u64,
pub end: __u64,
pub categories: __u64,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pm_scan_arg {
pub size: __u64,
pub flags: __u64,
pub start: __u64,
pub end: __u64,
pub walk_end: __u64,
pub vec: __u64,
pub vec_len: __u64,
pub max_pages: __u64,
pub category_inverted: __u64,
pub category_mask: __u64,
pub category_anyof_mask: __u64,
pub return_mask: __u64,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct procmap_query {
pub size: __u64,
pub query_flags: __u64,
pub query_addr: __u64,
pub vma_start: __u64,
pub vma_end: __u64,
pub vma_flags: __u64,
pub vma_page_size: __u64,
pub vma_offset: __u64,
pub inode: __u64,
pub dev_major: __u32,
pub dev_minor: __u32,
pub vma_name_size: __u32,
pub build_id_size: __u32,
pub vma_name_addr: __u64,
pub build_id_addr: __u64,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_ioctl_vol_args {
pub fd: __s64,
pub name: [crate::ctypes::c_char; 4088usize],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_qgroup_limit {
pub flags: __u64,
pub max_rfer: __u64,
pub max_excl: __u64,
pub rsv_rfer: __u64,
pub rsv_excl: __u64,
}
#[repr(C)]
#[derive(Debug)]
pub struct btrfs_qgroup_inherit {
pub flags: __u64,
pub num_qgroups: __u64,
pub num_ref_copies: __u64,
pub num_excl_copies: __u64,
pub lim: btrfs_qgroup_limit,
pub qgroups: __IncompleteArrayField<__u64>,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_ioctl_qgroup_limit_args {
pub qgroupid: __u64,
pub lim: btrfs_qgroup_limit,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct btrfs_ioctl_vol_args_v2 {
pub fd: __s64,
pub transid: __u64,
pub flags: __u64,
pub __bindgen_anon_1: btrfs_ioctl_vol_args_v2__bindgen_ty_1,
pub __bindgen_anon_2: btrfs_ioctl_vol_args_v2__bindgen_ty_2,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_ioctl_vol_args_v2__bindgen_ty_1__bindgen_ty_1 {
pub size: __u64,
pub qgroup_inherit: *mut btrfs_qgroup_inherit,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_scrub_progress {
pub data_extents_scrubbed: __u64,
pub tree_extents_scrubbed: __u64,
pub data_bytes_scrubbed: __u64,
pub tree_bytes_scrubbed: __u64,
pub read_errors: __u64,
pub csum_errors: __u64,
pub verify_errors: __u64,
pub no_csum: __u64,
pub csum_discards: __u64,
pub super_errors: __u64,
pub malloc_errors: __u64,
pub uncorrectable_errors: __u64,
pub corrected_errors: __u64,
pub last_physical: __u64,
pub unverified_errors: __u64,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_ioctl_scrub_args {
pub devid: __u64,
pub start: __u64,
pub end: __u64,
pub flags: __u64,
pub progress: btrfs_scrub_progress,
pub unused: [__u64; 109usize],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_ioctl_dev_replace_start_params {
pub srcdevid: __u64,
pub cont_reading_from_srcdev_mode: __u64,
pub srcdev_name: [__u8; 1025usize],
pub tgtdev_name: [__u8; 1025usize],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_ioctl_dev_replace_status_params {
pub replace_state: __u64,
pub progress_1000: __u64,
pub time_started: __u64,
pub time_stopped: __u64,
pub num_write_errors: __u64,
pub num_uncorrectable_read_errors: __u64,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct btrfs_ioctl_dev_replace_args {
pub cmd: __u64,
pub result: __u64,
pub __bindgen_anon_1: btrfs_ioctl_dev_replace_args__bindgen_ty_1,
pub spare: [__u64; 64usize],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_ioctl_dev_info_args {
pub devid: __u64,
pub uuid: [__u8; 16usize],
pub bytes_used: __u64,
pub total_bytes: __u64,
pub fsid: [__u8; 16usize],
pub unused: [__u64; 377usize],
pub path: [__u8; 1024usize],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_ioctl_fs_info_args {
pub max_id: __u64,
pub num_devices: __u64,
pub fsid: [__u8; 16usize],
pub nodesize: __u32,
pub sectorsize: __u32,
pub clone_alignment: __u32,
pub csum_type: __u16,
pub csum_size: __u16,
pub flags: __u64,
pub generation: __u64,
pub metadata_uuid: [__u8; 16usize],
pub reserved: [__u8; 944usize],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_ioctl_feature_flags {
pub compat_flags: __u64,
pub compat_ro_flags: __u64,
pub incompat_flags: __u64,
}
#[repr(C, packed)]
#[derive(Copy, Clone)]
pub struct btrfs_balance_args {
pub profiles: __u64,
pub __bindgen_anon_1: btrfs_balance_args__bindgen_ty_1,
pub devid: __u64,
pub pstart: __u64,
pub pend: __u64,
pub vstart: __u64,
pub vend: __u64,
pub target: __u64,
pub flags: __u64,
pub __bindgen_anon_2: btrfs_balance_args__bindgen_ty_2,
pub stripes_min: __u32,
pub stripes_max: __u32,
pub unused: [__u64; 6usize],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_balance_args__bindgen_ty_1__bindgen_ty_1 {
pub usage_min: __u32,
pub usage_max: __u32,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_balance_args__bindgen_ty_2__bindgen_ty_1 {
pub limit_min: __u32,
pub limit_max: __u32,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_balance_progress {
pub expected: __u64,
pub considered: __u64,
pub completed: __u64,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct btrfs_ioctl_balance_args {
pub flags: __u64,
pub state: __u64,
pub data: btrfs_balance_args,
pub meta: btrfs_balance_args,
pub sys: btrfs_balance_args,
pub stat: btrfs_balance_progress,
pub unused: [__u64; 72usize],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_ioctl_ino_lookup_args {
pub treeid: __u64,
pub objectid: __u64,
pub name: [crate::ctypes::c_char; 4080usize],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_ioctl_ino_lookup_user_args {
pub dirid: __u64,
pub treeid: __u64,
pub name: [crate::ctypes::c_char; 256usize],
pub path: [crate::ctypes::c_char; 3824usize],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_ioctl_search_key {
pub tree_id: __u64,
pub min_objectid: __u64,
pub max_objectid: __u64,
pub min_offset: __u64,
pub max_offset: __u64,
pub min_transid: __u64,
pub max_transid: __u64,
pub min_type: __u32,
pub max_type: __u32,
pub nr_items: __u32,
pub unused: __u32,
pub unused1: __u64,
pub unused2: __u64,
pub unused3: __u64,
pub unused4: __u64,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_ioctl_search_header {
pub transid: __u64,
pub objectid: __u64,
pub offset: __u64,
pub type_: __u32,
pub len: __u32,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_ioctl_search_args {
pub key: btrfs_ioctl_search_key,
pub buf: [crate::ctypes::c_char; 3992usize],
}
#[repr(C)]
#[derive(Debug)]
pub struct btrfs_ioctl_search_args_v2 {
pub key: btrfs_ioctl_search_key,
pub buf_size: __u64,
pub buf: __IncompleteArrayField<__u64>,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_ioctl_clone_range_args {
pub src_fd: __s64,
pub src_offset: __u64,
pub src_length: __u64,
pub dest_offset: __u64,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct btrfs_ioctl_defrag_range_args {
pub start: __u64,
pub len: __u64,
pub flags: __u64,
pub extent_thresh: __u32,
pub __bindgen_anon_1: btrfs_ioctl_defrag_range_args__bindgen_ty_1,
pub unused: [__u32; 4usize],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_ioctl_defrag_range_args__bindgen_ty_1__bindgen_ty_1 {
pub type_: __u8,
pub level: __s8,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_ioctl_same_extent_info {
pub fd: __s64,
pub logical_offset: __u64,
pub bytes_deduped: __u64,
pub status: __s32,
pub reserved: __u32,
}
#[repr(C)]
#[derive(Debug)]
pub struct btrfs_ioctl_same_args {
pub logical_offset: __u64,
pub length: __u64,
pub dest_count: __u16,
pub reserved1: __u16,
pub reserved2: __u32,
pub info: __IncompleteArrayField<btrfs_ioctl_same_extent_info>,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_ioctl_space_info {
pub flags: __u64,
pub total_bytes: __u64,
pub used_bytes: __u64,
}
#[repr(C)]
#[derive(Debug)]
pub struct btrfs_ioctl_space_args {
pub space_slots: __u64,
pub total_spaces: __u64,
pub spaces: __IncompleteArrayField<btrfs_ioctl_space_info>,
}
#[repr(C)]
#[derive(Debug)]
pub struct btrfs_data_container {
pub bytes_left: __u32,
pub bytes_missing: __u32,
pub elem_cnt: __u32,
pub elem_missed: __u32,
pub val: __IncompleteArrayField<__u64>,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_ioctl_ino_path_args {
pub inum: __u64,
pub size: __u64,
pub reserved: [__u64; 4usize],
pub fspath: __u64,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_ioctl_logical_ino_args {
pub logical: __u64,
pub size: __u64,
pub reserved: [__u64; 3usize],
pub flags: __u64,
pub inodes: __u64,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_ioctl_get_dev_stats {
pub devid: __u64,
pub nr_items: __u64,
pub flags: __u64,
pub values: [__u64; 5usize],
pub unused: [__u64; 121usize],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_ioctl_quota_ctl_args {
pub cmd: __u64,
pub status: __u64,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_ioctl_quota_rescan_args {
pub flags: __u64,
pub progress: __u64,
pub reserved: [__u64; 6usize],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_ioctl_qgroup_assign_args {
pub assign: __u64,
pub src: __u64,
pub dst: __u64,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_ioctl_qgroup_create_args {
pub create: __u64,
pub qgroupid: __u64,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_ioctl_timespec {
pub sec: __u64,
pub nsec: __u32,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_ioctl_received_subvol_args {
pub uuid: [crate::ctypes::c_char; 16usize],
pub stransid: __u64,
pub rtransid: __u64,
pub stime: btrfs_ioctl_timespec,
pub rtime: btrfs_ioctl_timespec,
pub flags: __u64,
pub reserved: [__u64; 16usize],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_ioctl_send_args {
pub send_fd: __s64,
pub clone_sources_count: __u64,
pub clone_sources: *mut __u64,
pub parent_root: __u64,
pub flags: __u64,
pub version: __u32,
pub reserved: [__u8; 28usize],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_ioctl_get_subvol_info_args {
pub treeid: __u64,
pub name: [crate::ctypes::c_char; 256usize],
pub parent_id: __u64,
pub dirid: __u64,
pub generation: __u64,
pub flags: __u64,
pub uuid: [__u8; 16usize],
pub parent_uuid: [__u8; 16usize],
pub received_uuid: [__u8; 16usize],
pub ctransid: __u64,
pub otransid: __u64,
pub stransid: __u64,
pub rtransid: __u64,
pub ctime: btrfs_ioctl_timespec,
pub otime: btrfs_ioctl_timespec,
pub stime: btrfs_ioctl_timespec,
pub rtime: btrfs_ioctl_timespec,
pub reserved: [__u64; 8usize],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_ioctl_get_subvol_rootref_args {
pub min_treeid: __u64,
pub rootref: [btrfs_ioctl_get_subvol_rootref_args__bindgen_ty_1; 255usize],
pub num_items: __u8,
pub align: [__u8; 7usize],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_ioctl_get_subvol_rootref_args__bindgen_ty_1 {
pub treeid: __u64,
pub dirid: __u64,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_ioctl_encoded_io_args {
pub iov: *const iovec,
pub iovcnt: crate::ctypes::c_ulong,
pub offset: __s64,
pub flags: __u64,
pub len: __u64,
pub unencoded_len: __u64,
pub unencoded_offset: __u64,
pub compression: __u32,
pub encryption: __u32,
pub reserved: [__u8; 64usize],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_ioctl_subvol_wait {
pub subvolid: __u64,
pub mode: __u32,
pub count: __u32,
}
#[repr(C, packed)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_disk_key {
pub objectid: __le64,
pub type_: __u8,
pub offset: __le64,
}
#[repr(C, packed)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_key {
pub objectid: __u64,
pub type_: __u8,
pub offset: __u64,
}
#[repr(C, packed)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_header {
pub csum: [__u8; 32usize],
pub fsid: [__u8; 16usize],
pub bytenr: __le64,
pub flags: __le64,
pub chunk_tree_uuid: [__u8; 16usize],
pub generation: __le64,
pub owner: __le64,
pub nritems: __le32,
pub level: __u8,
}
#[repr(C, packed)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_root_backup {
pub tree_root: __le64,
pub tree_root_gen: __le64,
pub chunk_root: __le64,
pub chunk_root_gen: __le64,
pub extent_root: __le64,
pub extent_root_gen: __le64,
pub fs_root: __le64,
pub fs_root_gen: __le64,
pub dev_root: __le64,
pub dev_root_gen: __le64,
pub csum_root: __le64,
pub csum_root_gen: __le64,
pub total_bytes: __le64,
pub bytes_used: __le64,
pub num_devices: __le64,
pub unused_64: [__le64; 4usize],
pub tree_root_level: __u8,
pub chunk_root_level: __u8,
pub extent_root_level: __u8,
pub fs_root_level: __u8,
pub dev_root_level: __u8,
pub csum_root_level: __u8,
pub unused_8: [__u8; 10usize],
}
#[repr(C, packed)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_item {
pub key: btrfs_disk_key,
pub offset: __le32,
pub size: __le32,
}
#[repr(C, packed)]
pub struct btrfs_leaf {
pub header: btrfs_header,
pub items: __IncompleteArrayField<btrfs_item>,
}
#[repr(C, packed)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_key_ptr {
pub key: btrfs_disk_key,
pub blockptr: __le64,
pub generation: __le64,
}
#[repr(C, packed)]
pub struct btrfs_node {
pub header: btrfs_header,
pub ptrs: __IncompleteArrayField<btrfs_key_ptr>,
}
#[repr(C, packed)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_dev_item {
pub devid: __le64,
pub total_bytes: __le64,
pub bytes_used: __le64,
pub io_align: __le32,
pub io_width: __le32,
pub sector_size: __le32,
pub type_: __le64,
pub generation: __le64,
pub start_offset: __le64,
pub dev_group: __le32,
pub seek_speed: __u8,
pub bandwidth: __u8,
pub uuid: [__u8; 16usize],
pub fsid: [__u8; 16usize],
}
#[repr(C, packed)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_stripe {
pub devid: __le64,
pub offset: __le64,
pub dev_uuid: [__u8; 16usize],
}
#[repr(C, packed)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_chunk {
pub length: __le64,
pub owner: __le64,
pub stripe_len: __le64,
pub type_: __le64,
pub io_align: __le32,
pub io_width: __le32,
pub sector_size: __le32,
pub num_stripes: __le16,
pub sub_stripes: __le16,
pub stripe: btrfs_stripe,
}
#[repr(C, packed)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_super_block {
pub csum: [__u8; 32usize],
pub fsid: [__u8; 16usize],
pub bytenr: __le64,
pub flags: __le64,
pub magic: __le64,
pub generation: __le64,
pub root: __le64,
pub chunk_root: __le64,
pub log_root: __le64,
pub __unused_log_root_transid: __le64,
pub total_bytes: __le64,
pub bytes_used: __le64,
pub root_dir_objectid: __le64,
pub num_devices: __le64,
pub sectorsize: __le32,
pub nodesize: __le32,
pub __unused_leafsize: __le32,
pub stripesize: __le32,
pub sys_chunk_array_size: __le32,
pub chunk_root_generation: __le64,
pub compat_flags: __le64,
pub compat_ro_flags: __le64,
pub incompat_flags: __le64,
pub csum_type: __le16,
pub root_level: __u8,
pub chunk_root_level: __u8,
pub log_root_level: __u8,
pub dev_item: btrfs_dev_item,
pub label: [crate::ctypes::c_char; 256usize],
pub cache_generation: __le64,
pub uuid_tree_generation: __le64,
pub metadata_uuid: [__u8; 16usize],
pub nr_global_roots: __u64,
pub reserved: [__le64; 27usize],
pub sys_chunk_array: [__u8; 2048usize],
pub super_roots: [btrfs_root_backup; 4usize],
pub padding: [__u8; 565usize],
}
#[repr(C, packed)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_free_space_entry {
pub offset: __le64,
pub bytes: __le64,
pub type_: __u8,
}
#[repr(C, packed)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_free_space_header {
pub location: btrfs_disk_key,
pub generation: __le64,
pub num_entries: __le64,
pub num_bitmaps: __le64,
}
#[repr(C, packed)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_raid_stride {
pub devid: __le64,
pub physical: __le64,
}
#[repr(C, packed)]
pub struct btrfs_stripe_extent {
pub __bindgen_anon_1: btrfs_stripe_extent__bindgen_ty_1,
}
#[repr(C)]
#[derive(Debug)]
pub struct btrfs_stripe_extent__bindgen_ty_1 {
pub __empty_strides: btrfs_stripe_extent__bindgen_ty_1__bindgen_ty_1,
pub strides: __IncompleteArrayField<btrfs_raid_stride>,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_stripe_extent__bindgen_ty_1__bindgen_ty_1 {}
#[repr(C, packed)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_extent_item {
pub refs: __le64,
pub generation: __le64,
pub flags: __le64,
}
#[repr(C, packed)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_extent_item_v0 {
pub refs: __le32,
}
#[repr(C, packed)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_tree_block_info {
pub key: btrfs_disk_key,
pub level: __u8,
}
#[repr(C, packed)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_extent_data_ref {
pub root: __le64,
pub objectid: __le64,
pub offset: __le64,
pub count: __le32,
}
#[repr(C, packed)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_shared_data_ref {
pub count: __le32,
}
#[repr(C, packed)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_extent_owner_ref {
pub root_id: __le64,
}
#[repr(C, packed)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_extent_inline_ref {
pub type_: __u8,
pub offset: __le64,
}
#[repr(C, packed)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_dev_extent {
pub chunk_tree: __le64,
pub chunk_objectid: __le64,