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