0001
0002 #ifndef _BTRFS_CTREE_H_
0003 #define _BTRFS_CTREE_H_
0004
0005 #include <linux/btrfs.h>
0006 #include <linux/types.h>
0007 #ifdef __KERNEL__
0008 #include <linux/stddef.h>
0009 #else
0010 #include <stddef.h>
0011 #endif
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 #define BTRFS_ROOT_TREE_OBJECTID 1ULL
0022
0023
0024 #define BTRFS_EXTENT_TREE_OBJECTID 2ULL
0025
0026
0027
0028
0029
0030 #define BTRFS_CHUNK_TREE_OBJECTID 3ULL
0031
0032
0033
0034
0035
0036 #define BTRFS_DEV_TREE_OBJECTID 4ULL
0037
0038
0039 #define BTRFS_FS_TREE_OBJECTID 5ULL
0040
0041
0042 #define BTRFS_ROOT_TREE_DIR_OBJECTID 6ULL
0043
0044
0045 #define BTRFS_CSUM_TREE_OBJECTID 7ULL
0046
0047
0048 #define BTRFS_QUOTA_TREE_OBJECTID 8ULL
0049
0050
0051 #define BTRFS_UUID_TREE_OBJECTID 9ULL
0052
0053
0054 #define BTRFS_FREE_SPACE_TREE_OBJECTID 10ULL
0055
0056
0057 #define BTRFS_BLOCK_GROUP_TREE_OBJECTID 11ULL
0058
0059
0060 #define BTRFS_DEV_STATS_OBJECTID 0ULL
0061
0062
0063 #define BTRFS_BALANCE_OBJECTID -4ULL
0064
0065
0066 #define BTRFS_ORPHAN_OBJECTID -5ULL
0067
0068
0069 #define BTRFS_TREE_LOG_OBJECTID -6ULL
0070 #define BTRFS_TREE_LOG_FIXUP_OBJECTID -7ULL
0071
0072
0073 #define BTRFS_TREE_RELOC_OBJECTID -8ULL
0074 #define BTRFS_DATA_RELOC_TREE_OBJECTID -9ULL
0075
0076
0077
0078
0079
0080
0081 #define BTRFS_EXTENT_CSUM_OBJECTID -10ULL
0082
0083
0084 #define BTRFS_FREE_SPACE_OBJECTID -11ULL
0085
0086
0087
0088
0089
0090 #define BTRFS_FREE_INO_OBJECTID -12ULL
0091
0092
0093 #define BTRFS_MULTIPLE_OBJECTIDS -255ULL
0094
0095
0096
0097
0098 #define BTRFS_FIRST_FREE_OBJECTID 256ULL
0099 #define BTRFS_LAST_FREE_OBJECTID -256ULL
0100 #define BTRFS_FIRST_CHUNK_TREE_OBJECTID 256ULL
0101
0102
0103
0104
0105
0106
0107 #define BTRFS_DEV_ITEMS_OBJECTID 1ULL
0108
0109 #define BTRFS_BTREE_INODE_OBJECTID 1
0110
0111 #define BTRFS_EMPTY_SUBVOL_DIR_OBJECTID 2
0112
0113 #define BTRFS_DEV_REPLACE_DEVID 0ULL
0114
0115
0116
0117
0118
0119
0120 #define BTRFS_INODE_ITEM_KEY 1
0121 #define BTRFS_INODE_REF_KEY 12
0122 #define BTRFS_INODE_EXTREF_KEY 13
0123 #define BTRFS_XATTR_ITEM_KEY 24
0124
0125
0126
0127
0128
0129
0130
0131
0132
0133
0134
0135
0136
0137
0138
0139
0140
0141
0142
0143
0144 #define BTRFS_VERITY_DESC_ITEM_KEY 36
0145 #define BTRFS_VERITY_MERKLE_ITEM_KEY 37
0146
0147 #define BTRFS_ORPHAN_ITEM_KEY 48
0148
0149
0150
0151
0152
0153
0154
0155
0156 #define BTRFS_DIR_LOG_ITEM_KEY 60
0157 #define BTRFS_DIR_LOG_INDEX_KEY 72
0158 #define BTRFS_DIR_ITEM_KEY 84
0159 #define BTRFS_DIR_INDEX_KEY 96
0160
0161
0162
0163 #define BTRFS_EXTENT_DATA_KEY 108
0164
0165
0166
0167
0168
0169 #define BTRFS_EXTENT_CSUM_KEY 128
0170
0171
0172
0173
0174
0175 #define BTRFS_ROOT_ITEM_KEY 132
0176
0177
0178
0179
0180
0181 #define BTRFS_ROOT_BACKREF_KEY 144
0182
0183
0184
0185
0186
0187
0188 #define BTRFS_ROOT_REF_KEY 156
0189
0190
0191
0192
0193
0194 #define BTRFS_EXTENT_ITEM_KEY 168
0195
0196
0197
0198
0199
0200 #define BTRFS_METADATA_ITEM_KEY 169
0201
0202 #define BTRFS_TREE_BLOCK_REF_KEY 176
0203
0204 #define BTRFS_EXTENT_DATA_REF_KEY 178
0205
0206 #define BTRFS_EXTENT_REF_V0_KEY 180
0207
0208 #define BTRFS_SHARED_BLOCK_REF_KEY 182
0209
0210 #define BTRFS_SHARED_DATA_REF_KEY 184
0211
0212
0213
0214
0215
0216 #define BTRFS_BLOCK_GROUP_ITEM_KEY 192
0217
0218
0219
0220
0221
0222
0223 #define BTRFS_FREE_SPACE_INFO_KEY 198
0224
0225
0226
0227
0228
0229 #define BTRFS_FREE_SPACE_EXTENT_KEY 199
0230
0231
0232
0233
0234
0235
0236
0237 #define BTRFS_FREE_SPACE_BITMAP_KEY 200
0238
0239 #define BTRFS_DEV_EXTENT_KEY 204
0240 #define BTRFS_DEV_ITEM_KEY 216
0241 #define BTRFS_CHUNK_ITEM_KEY 228
0242
0243
0244
0245
0246
0247
0248 #define BTRFS_QGROUP_STATUS_KEY 240
0249
0250
0251
0252
0253 #define BTRFS_QGROUP_INFO_KEY 242
0254
0255
0256
0257
0258 #define BTRFS_QGROUP_LIMIT_KEY 244
0259
0260
0261
0262
0263
0264
0265 #define BTRFS_QGROUP_RELATION_KEY 246
0266
0267
0268
0269
0270 #define BTRFS_BALANCE_ITEM_KEY 248
0271
0272
0273
0274
0275
0276
0277
0278
0279
0280
0281
0282
0283 #define BTRFS_TEMPORARY_ITEM_KEY 248
0284
0285
0286
0287
0288 #define BTRFS_DEV_STATS_KEY 249
0289
0290
0291
0292
0293
0294
0295
0296
0297
0298
0299
0300
0301
0302
0303 #define BTRFS_PERSISTENT_ITEM_KEY 249
0304
0305
0306
0307
0308
0309 #define BTRFS_DEV_REPLACE_KEY 250
0310
0311
0312
0313
0314
0315
0316
0317 #if BTRFS_UUID_SIZE != 16
0318 #error "UUID items require BTRFS_UUID_SIZE == 16!"
0319 #endif
0320 #define BTRFS_UUID_KEY_SUBVOL 251
0321 #define BTRFS_UUID_KEY_RECEIVED_SUBVOL 252
0322
0323
0324
0325
0326
0327
0328 #define BTRFS_STRING_ITEM_KEY 253
0329
0330
0331 #define BTRFS_MAX_METADATA_BLOCKSIZE 65536
0332
0333
0334 #define BTRFS_CSUM_SIZE 32
0335
0336
0337 enum btrfs_csum_type {
0338 BTRFS_CSUM_TYPE_CRC32 = 0,
0339 BTRFS_CSUM_TYPE_XXHASH = 1,
0340 BTRFS_CSUM_TYPE_SHA256 = 2,
0341 BTRFS_CSUM_TYPE_BLAKE2 = 3,
0342 };
0343
0344
0345
0346
0347
0348
0349
0350
0351
0352 #define BTRFS_FT_UNKNOWN 0
0353 #define BTRFS_FT_REG_FILE 1
0354 #define BTRFS_FT_DIR 2
0355 #define BTRFS_FT_CHRDEV 3
0356 #define BTRFS_FT_BLKDEV 4
0357 #define BTRFS_FT_FIFO 5
0358 #define BTRFS_FT_SOCK 6
0359 #define BTRFS_FT_SYMLINK 7
0360 #define BTRFS_FT_XATTR 8
0361 #define BTRFS_FT_MAX 9
0362
0363
0364
0365
0366
0367
0368
0369
0370
0371
0372
0373
0374
0375
0376
0377
0378
0379
0380 struct btrfs_disk_key {
0381 __le64 objectid;
0382 __u8 type;
0383 __le64 offset;
0384 } __attribute__ ((__packed__));
0385
0386 struct btrfs_key {
0387 __u64 objectid;
0388 __u8 type;
0389 __u64 offset;
0390 } __attribute__ ((__packed__));
0391
0392 struct btrfs_dev_item {
0393
0394 __le64 devid;
0395
0396
0397 __le64 total_bytes;
0398
0399
0400 __le64 bytes_used;
0401
0402
0403 __le32 io_align;
0404
0405
0406 __le32 io_width;
0407
0408
0409 __le32 sector_size;
0410
0411
0412 __le64 type;
0413
0414
0415 __le64 generation;
0416
0417
0418
0419
0420
0421 __le64 start_offset;
0422
0423
0424 __le32 dev_group;
0425
0426
0427 __u8 seek_speed;
0428
0429
0430 __u8 bandwidth;
0431
0432
0433 __u8 uuid[BTRFS_UUID_SIZE];
0434
0435
0436 __u8 fsid[BTRFS_UUID_SIZE];
0437 } __attribute__ ((__packed__));
0438
0439 struct btrfs_stripe {
0440 __le64 devid;
0441 __le64 offset;
0442 __u8 dev_uuid[BTRFS_UUID_SIZE];
0443 } __attribute__ ((__packed__));
0444
0445 struct btrfs_chunk {
0446
0447 __le64 length;
0448
0449
0450 __le64 owner;
0451
0452 __le64 stripe_len;
0453 __le64 type;
0454
0455
0456 __le32 io_align;
0457
0458
0459 __le32 io_width;
0460
0461
0462 __le32 sector_size;
0463
0464
0465
0466
0467 __le16 num_stripes;
0468
0469
0470 __le16 sub_stripes;
0471 struct btrfs_stripe stripe;
0472
0473 } __attribute__ ((__packed__));
0474
0475 #define BTRFS_FREE_SPACE_EXTENT 1
0476 #define BTRFS_FREE_SPACE_BITMAP 2
0477
0478 struct btrfs_free_space_entry {
0479 __le64 offset;
0480 __le64 bytes;
0481 __u8 type;
0482 } __attribute__ ((__packed__));
0483
0484 struct btrfs_free_space_header {
0485 struct btrfs_disk_key location;
0486 __le64 generation;
0487 __le64 num_entries;
0488 __le64 num_bitmaps;
0489 } __attribute__ ((__packed__));
0490
0491 #define BTRFS_HEADER_FLAG_WRITTEN (1ULL << 0)
0492 #define BTRFS_HEADER_FLAG_RELOC (1ULL << 1)
0493
0494
0495
0496 #define BTRFS_SUPER_FLAG_ERROR (1ULL << 2)
0497
0498 #define BTRFS_SUPER_FLAG_SEEDING (1ULL << 32)
0499 #define BTRFS_SUPER_FLAG_METADUMP (1ULL << 33)
0500 #define BTRFS_SUPER_FLAG_METADUMP_V2 (1ULL << 34)
0501 #define BTRFS_SUPER_FLAG_CHANGING_FSID (1ULL << 35)
0502 #define BTRFS_SUPER_FLAG_CHANGING_FSID_V2 (1ULL << 36)
0503
0504
0505
0506
0507
0508
0509
0510 struct btrfs_extent_item {
0511 __le64 refs;
0512 __le64 generation;
0513 __le64 flags;
0514 } __attribute__ ((__packed__));
0515
0516 struct btrfs_extent_item_v0 {
0517 __le32 refs;
0518 } __attribute__ ((__packed__));
0519
0520
0521 #define BTRFS_EXTENT_FLAG_DATA (1ULL << 0)
0522 #define BTRFS_EXTENT_FLAG_TREE_BLOCK (1ULL << 1)
0523
0524
0525
0526
0527 #define BTRFS_BLOCK_FLAG_FULL_BACKREF (1ULL << 8)
0528
0529
0530
0531
0532
0533 #define BTRFS_EXTENT_FLAG_SUPER (1ULL << 48)
0534
0535 struct btrfs_tree_block_info {
0536 struct btrfs_disk_key key;
0537 __u8 level;
0538 } __attribute__ ((__packed__));
0539
0540 struct btrfs_extent_data_ref {
0541 __le64 root;
0542 __le64 objectid;
0543 __le64 offset;
0544 __le32 count;
0545 } __attribute__ ((__packed__));
0546
0547 struct btrfs_shared_data_ref {
0548 __le32 count;
0549 } __attribute__ ((__packed__));
0550
0551 struct btrfs_extent_inline_ref {
0552 __u8 type;
0553 __le64 offset;
0554 } __attribute__ ((__packed__));
0555
0556
0557
0558
0559
0560 struct btrfs_dev_extent {
0561 __le64 chunk_tree;
0562 __le64 chunk_objectid;
0563 __le64 chunk_offset;
0564 __le64 length;
0565 __u8 chunk_tree_uuid[BTRFS_UUID_SIZE];
0566 } __attribute__ ((__packed__));
0567
0568 struct btrfs_inode_ref {
0569 __le64 index;
0570 __le16 name_len;
0571
0572 } __attribute__ ((__packed__));
0573
0574 struct btrfs_inode_extref {
0575 __le64 parent_objectid;
0576 __le64 index;
0577 __le16 name_len;
0578 __u8 name[];
0579
0580 } __attribute__ ((__packed__));
0581
0582 struct btrfs_timespec {
0583 __le64 sec;
0584 __le32 nsec;
0585 } __attribute__ ((__packed__));
0586
0587 struct btrfs_inode_item {
0588
0589 __le64 generation;
0590
0591 __le64 transid;
0592 __le64 size;
0593 __le64 nbytes;
0594 __le64 block_group;
0595 __le32 nlink;
0596 __le32 uid;
0597 __le32 gid;
0598 __le32 mode;
0599 __le64 rdev;
0600 __le64 flags;
0601
0602
0603 __le64 sequence;
0604
0605
0606
0607
0608
0609 __le64 reserved[4];
0610 struct btrfs_timespec atime;
0611 struct btrfs_timespec ctime;
0612 struct btrfs_timespec mtime;
0613 struct btrfs_timespec otime;
0614 } __attribute__ ((__packed__));
0615
0616 struct btrfs_dir_log_item {
0617 __le64 end;
0618 } __attribute__ ((__packed__));
0619
0620 struct btrfs_dir_item {
0621 struct btrfs_disk_key location;
0622 __le64 transid;
0623 __le16 data_len;
0624 __le16 name_len;
0625 __u8 type;
0626 } __attribute__ ((__packed__));
0627
0628 #define BTRFS_ROOT_SUBVOL_RDONLY (1ULL << 0)
0629
0630
0631
0632
0633
0634 #define BTRFS_ROOT_SUBVOL_DEAD (1ULL << 48)
0635
0636 struct btrfs_root_item {
0637 struct btrfs_inode_item inode;
0638 __le64 generation;
0639 __le64 root_dirid;
0640 __le64 bytenr;
0641 __le64 byte_limit;
0642 __le64 bytes_used;
0643 __le64 last_snapshot;
0644 __le64 flags;
0645 __le32 refs;
0646 struct btrfs_disk_key drop_progress;
0647 __u8 drop_level;
0648 __u8 level;
0649
0650
0651
0652
0653
0654
0655
0656
0657
0658
0659
0660
0661
0662
0663
0664
0665
0666 __le64 generation_v2;
0667 __u8 uuid[BTRFS_UUID_SIZE];
0668 __u8 parent_uuid[BTRFS_UUID_SIZE];
0669 __u8 received_uuid[BTRFS_UUID_SIZE];
0670 __le64 ctransid;
0671 __le64 otransid;
0672 __le64 stransid;
0673 __le64 rtransid;
0674 struct btrfs_timespec ctime;
0675 struct btrfs_timespec otime;
0676 struct btrfs_timespec stime;
0677 struct btrfs_timespec rtime;
0678 __le64 reserved[8];
0679 } __attribute__ ((__packed__));
0680
0681
0682
0683
0684
0685 static inline __u32 btrfs_legacy_root_item_size(void)
0686 {
0687 return offsetof(struct btrfs_root_item, generation_v2);
0688 }
0689
0690
0691
0692
0693 struct btrfs_root_ref {
0694 __le64 dirid;
0695 __le64 sequence;
0696 __le16 name_len;
0697 } __attribute__ ((__packed__));
0698
0699 struct btrfs_disk_balance_args {
0700
0701
0702
0703
0704 __le64 profiles;
0705
0706
0707
0708
0709
0710
0711 union {
0712 __le64 usage;
0713 struct {
0714 __le32 usage_min;
0715 __le32 usage_max;
0716 };
0717 };
0718
0719
0720 __le64 devid;
0721
0722
0723 __le64 pstart;
0724 __le64 pend;
0725
0726
0727 __le64 vstart;
0728 __le64 vend;
0729
0730
0731
0732
0733
0734 __le64 target;
0735
0736
0737 __le64 flags;
0738
0739
0740
0741
0742
0743
0744 union {
0745 __le64 limit;
0746 struct {
0747 __le32 limit_min;
0748 __le32 limit_max;
0749 };
0750 };
0751
0752
0753
0754
0755
0756 __le32 stripes_min;
0757 __le32 stripes_max;
0758
0759 __le64 unused[6];
0760 } __attribute__ ((__packed__));
0761
0762
0763
0764
0765
0766 struct btrfs_balance_item {
0767
0768 __le64 flags;
0769
0770 struct btrfs_disk_balance_args data;
0771 struct btrfs_disk_balance_args meta;
0772 struct btrfs_disk_balance_args sys;
0773
0774 __le64 unused[4];
0775 } __attribute__ ((__packed__));
0776
0777 enum {
0778 BTRFS_FILE_EXTENT_INLINE = 0,
0779 BTRFS_FILE_EXTENT_REG = 1,
0780 BTRFS_FILE_EXTENT_PREALLOC = 2,
0781 BTRFS_NR_FILE_EXTENT_TYPES = 3,
0782 };
0783
0784 struct btrfs_file_extent_item {
0785
0786
0787
0788 __le64 generation;
0789
0790
0791
0792
0793
0794
0795
0796 __le64 ram_bytes;
0797
0798
0799
0800
0801
0802
0803
0804
0805 __u8 compression;
0806 __u8 encryption;
0807 __le16 other_encoding;
0808
0809
0810 __u8 type;
0811
0812
0813
0814
0815
0816
0817
0818 __le64 disk_bytenr;
0819 __le64 disk_num_bytes;
0820
0821
0822
0823
0824
0825
0826
0827 __le64 offset;
0828
0829
0830
0831
0832 __le64 num_bytes;
0833
0834 } __attribute__ ((__packed__));
0835
0836 struct btrfs_csum_item {
0837 __u8 csum;
0838 } __attribute__ ((__packed__));
0839
0840 struct btrfs_dev_stats_item {
0841
0842
0843
0844
0845 __le64 values[BTRFS_DEV_STAT_VALUES_MAX];
0846 } __attribute__ ((__packed__));
0847
0848 #define BTRFS_DEV_REPLACE_ITEM_CONT_READING_FROM_SRCDEV_MODE_ALWAYS 0
0849 #define BTRFS_DEV_REPLACE_ITEM_CONT_READING_FROM_SRCDEV_MODE_AVOID 1
0850
0851 struct btrfs_dev_replace_item {
0852
0853
0854
0855
0856 __le64 src_devid;
0857 __le64 cursor_left;
0858 __le64 cursor_right;
0859 __le64 cont_reading_from_srcdev_mode;
0860
0861 __le64 replace_state;
0862 __le64 time_started;
0863 __le64 time_stopped;
0864 __le64 num_write_errors;
0865 __le64 num_uncorrectable_read_errors;
0866 } __attribute__ ((__packed__));
0867
0868
0869 #define BTRFS_BLOCK_GROUP_DATA (1ULL << 0)
0870 #define BTRFS_BLOCK_GROUP_SYSTEM (1ULL << 1)
0871 #define BTRFS_BLOCK_GROUP_METADATA (1ULL << 2)
0872 #define BTRFS_BLOCK_GROUP_RAID0 (1ULL << 3)
0873 #define BTRFS_BLOCK_GROUP_RAID1 (1ULL << 4)
0874 #define BTRFS_BLOCK_GROUP_DUP (1ULL << 5)
0875 #define BTRFS_BLOCK_GROUP_RAID10 (1ULL << 6)
0876 #define BTRFS_BLOCK_GROUP_RAID5 (1ULL << 7)
0877 #define BTRFS_BLOCK_GROUP_RAID6 (1ULL << 8)
0878 #define BTRFS_BLOCK_GROUP_RAID1C3 (1ULL << 9)
0879 #define BTRFS_BLOCK_GROUP_RAID1C4 (1ULL << 10)
0880 #define BTRFS_BLOCK_GROUP_RESERVED (BTRFS_AVAIL_ALLOC_BIT_SINGLE | \
0881 BTRFS_SPACE_INFO_GLOBAL_RSV)
0882
0883 #define BTRFS_BLOCK_GROUP_TYPE_MASK (BTRFS_BLOCK_GROUP_DATA | \
0884 BTRFS_BLOCK_GROUP_SYSTEM | \
0885 BTRFS_BLOCK_GROUP_METADATA)
0886
0887 #define BTRFS_BLOCK_GROUP_PROFILE_MASK (BTRFS_BLOCK_GROUP_RAID0 | \
0888 BTRFS_BLOCK_GROUP_RAID1 | \
0889 BTRFS_BLOCK_GROUP_RAID1C3 | \
0890 BTRFS_BLOCK_GROUP_RAID1C4 | \
0891 BTRFS_BLOCK_GROUP_RAID5 | \
0892 BTRFS_BLOCK_GROUP_RAID6 | \
0893 BTRFS_BLOCK_GROUP_DUP | \
0894 BTRFS_BLOCK_GROUP_RAID10)
0895 #define BTRFS_BLOCK_GROUP_RAID56_MASK (BTRFS_BLOCK_GROUP_RAID5 | \
0896 BTRFS_BLOCK_GROUP_RAID6)
0897
0898 #define BTRFS_BLOCK_GROUP_RAID1_MASK (BTRFS_BLOCK_GROUP_RAID1 | \
0899 BTRFS_BLOCK_GROUP_RAID1C3 | \
0900 BTRFS_BLOCK_GROUP_RAID1C4)
0901
0902
0903
0904
0905
0906
0907
0908
0909 #define BTRFS_AVAIL_ALLOC_BIT_SINGLE (1ULL << 48)
0910
0911
0912
0913
0914
0915 #define BTRFS_SPACE_INFO_GLOBAL_RSV (1ULL << 49)
0916
0917 #define BTRFS_EXTENDED_PROFILE_MASK (BTRFS_BLOCK_GROUP_PROFILE_MASK | \
0918 BTRFS_AVAIL_ALLOC_BIT_SINGLE)
0919
0920 static inline __u64 chunk_to_extended(__u64 flags)
0921 {
0922 if ((flags & BTRFS_BLOCK_GROUP_PROFILE_MASK) == 0)
0923 flags |= BTRFS_AVAIL_ALLOC_BIT_SINGLE;
0924
0925 return flags;
0926 }
0927 static inline __u64 extended_to_chunk(__u64 flags)
0928 {
0929 return flags & ~BTRFS_AVAIL_ALLOC_BIT_SINGLE;
0930 }
0931
0932 struct btrfs_block_group_item {
0933 __le64 used;
0934 __le64 chunk_objectid;
0935 __le64 flags;
0936 } __attribute__ ((__packed__));
0937
0938 struct btrfs_free_space_info {
0939 __le32 extent_count;
0940 __le32 flags;
0941 } __attribute__ ((__packed__));
0942
0943 #define BTRFS_FREE_SPACE_USING_BITMAPS (1ULL << 0)
0944
0945 #define BTRFS_QGROUP_LEVEL_SHIFT 48
0946 static inline __u16 btrfs_qgroup_level(__u64 qgroupid)
0947 {
0948 return (__u16)(qgroupid >> BTRFS_QGROUP_LEVEL_SHIFT);
0949 }
0950
0951
0952
0953
0954 #define BTRFS_QGROUP_STATUS_FLAG_ON (1ULL << 0)
0955
0956
0957
0958 #define BTRFS_QGROUP_STATUS_FLAG_RESCAN (1ULL << 1)
0959
0960
0961
0962
0963
0964
0965
0966 #define BTRFS_QGROUP_STATUS_FLAG_INCONSISTENT (1ULL << 2)
0967
0968 #define BTRFS_QGROUP_STATUS_VERSION 1
0969
0970 struct btrfs_qgroup_status_item {
0971 __le64 version;
0972
0973
0974
0975
0976
0977
0978 __le64 generation;
0979
0980
0981 __le64 flags;
0982
0983
0984
0985
0986
0987 __le64 rescan;
0988 } __attribute__ ((__packed__));
0989
0990 struct btrfs_qgroup_info_item {
0991 __le64 generation;
0992 __le64 rfer;
0993 __le64 rfer_cmpr;
0994 __le64 excl;
0995 __le64 excl_cmpr;
0996 } __attribute__ ((__packed__));
0997
0998 struct btrfs_qgroup_limit_item {
0999
1000
1001
1002 __le64 flags;
1003 __le64 max_rfer;
1004 __le64 max_excl;
1005 __le64 rsv_rfer;
1006 __le64 rsv_excl;
1007 } __attribute__ ((__packed__));
1008
1009 struct btrfs_verity_descriptor_item {
1010
1011 __le64 size;
1012
1013
1014
1015
1016
1017 __le64 reserved[2];
1018 __u8 encryption;
1019 } __attribute__ ((__packed__));
1020
1021 #endif