]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/basic/btrfs-ctree.h
Merge pull request #2569 from zonque/removals
[thirdparty/systemd.git] / src / basic / btrfs-ctree.h
1 #pragma once
2
3 #include "macro.h"
4 #include "sparse-endian.h"
5
6 /* Stolen from btrfs' ctree.h */
7
8 struct btrfs_timespec {
9 le64_t sec;
10 le32_t nsec;
11 } _packed_;
12
13 struct btrfs_disk_key {
14 le64_t objectid;
15 uint8_t type;
16 le64_t offset;
17 } _packed_;
18
19 struct btrfs_inode_item {
20 le64_t generation;
21 le64_t transid;
22 le64_t size;
23 le64_t nbytes;
24 le64_t block_group;
25 le32_t nlink;
26 le32_t uid;
27 le32_t gid;
28 le32_t mode;
29 le64_t rdev;
30 le64_t flags;
31 le64_t sequence;
32 le64_t reserved[4];
33 struct btrfs_timespec atime;
34 struct btrfs_timespec ctime;
35 struct btrfs_timespec mtime;
36 struct btrfs_timespec otime;
37 } _packed_;
38
39 struct btrfs_root_item {
40 struct btrfs_inode_item inode;
41 le64_t generation;
42 le64_t root_dirid;
43 le64_t bytenr;
44 le64_t byte_limit;
45 le64_t bytes_used;
46 le64_t last_snapshot;
47 le64_t flags;
48 le32_t refs;
49 struct btrfs_disk_key drop_progress;
50 uint8_t drop_level;
51 uint8_t level;
52 le64_t generation_v2;
53 uint8_t uuid[BTRFS_UUID_SIZE];
54 uint8_t parent_uuid[BTRFS_UUID_SIZE];
55 uint8_t received_uuid[BTRFS_UUID_SIZE];
56 le64_t ctransid;
57 le64_t otransid;
58 le64_t stransid;
59 le64_t rtransid;
60 struct btrfs_timespec ctime;
61 struct btrfs_timespec otime;
62 struct btrfs_timespec stime;
63 struct btrfs_timespec rtime;
64 le64_t reserved[8];
65 } _packed_;
66
67 #define BTRFS_ROOT_SUBVOL_RDONLY (1ULL << 0)
68
69 struct btrfs_qgroup_info_item {
70 le64_t generation;
71 le64_t rfer;
72 le64_t rfer_cmpr;
73 le64_t excl;
74 le64_t excl_cmpr;
75 } _packed_;
76
77 #define BTRFS_QGROUP_LIMIT_MAX_RFER (1ULL << 0)
78 #define BTRFS_QGROUP_LIMIT_MAX_EXCL (1ULL << 1)
79 #define BTRFS_QGROUP_LIMIT_RSV_RFER (1ULL << 2)
80 #define BTRFS_QGROUP_LIMIT_RSV_EXCL (1ULL << 3)
81 #define BTRFS_QGROUP_LIMIT_RFER_CMPR (1ULL << 4)
82 #define BTRFS_QGROUP_LIMIT_EXCL_CMPR (1ULL << 5)
83
84 struct btrfs_qgroup_limit_item {
85 le64_t flags;
86 le64_t max_rfer;
87 le64_t max_excl;
88 le64_t rsv_rfer;
89 le64_t rsv_excl;
90 } _packed_;
91
92 struct btrfs_root_ref {
93 le64_t dirid;
94 le64_t sequence;
95 le16_t name_len;
96 } _packed_;