1 /* SPDX-License-Identifier: LGPL-2.1+ */
4 #include <linux/types.h>
6 #include "missing_btrfs.h"
8 /* linux@db6711600e27c885aed89751f04e727f3af26715 (4.7) */
9 #if HAVE_LINUX_BTRFS_TREE_H
10 #include <linux/btrfs_tree.h>
12 #define BTRFS_ROOT_TREE_OBJECTID 1
13 #define BTRFS_QUOTA_TREE_OBJECTID 8
14 #define BTRFS_FIRST_FREE_OBJECTID 256
15 #define BTRFS_LAST_FREE_OBJECTID -256ULL
17 #define BTRFS_ROOT_ITEM_KEY 132
18 #define BTRFS_ROOT_BACKREF_KEY 144
19 #define BTRFS_QGROUP_STATUS_KEY 240
20 #define BTRFS_QGROUP_INFO_KEY 242
21 #define BTRFS_QGROUP_LIMIT_KEY 244
22 #define BTRFS_QGROUP_RELATION_KEY 246
24 struct btrfs_disk_key
{
28 } __attribute__ ((__packed__
));
30 struct btrfs_timespec
{
33 } __attribute__ ((__packed__
));
35 struct btrfs_inode_item
{
49 struct btrfs_timespec atime
;
50 struct btrfs_timespec ctime
;
51 struct btrfs_timespec mtime
;
52 struct btrfs_timespec otime
;
53 } __attribute__ ((__packed__
));
55 #define BTRFS_ROOT_SUBVOL_RDONLY (1ULL << 0)
57 struct btrfs_root_item
{
58 struct btrfs_inode_item inode
;
67 struct btrfs_disk_key drop_progress
;
72 __u8 uuid
[BTRFS_UUID_SIZE
];
73 __u8 parent_uuid
[BTRFS_UUID_SIZE
];
74 __u8 received_uuid
[BTRFS_UUID_SIZE
];
75 __le64 ctransid
; /* updated when an inode changes */
76 __le64 otransid
; /* trans when created */
77 __le64 stransid
; /* trans when sent. non-zero for received subvol */
78 __le64 rtransid
; /* trans when received. non-zero for received subvol */
79 struct btrfs_timespec ctime
;
80 struct btrfs_timespec otime
;
81 struct btrfs_timespec stime
;
82 struct btrfs_timespec rtime
;
83 __le64 reserved
[8]; /* for future */
84 } __attribute__ ((__packed__
));
86 struct btrfs_root_ref
{
90 } __attribute__ ((__packed__
));
92 #define BTRFS_QGROUP_LEVEL_SHIFT 48
94 struct btrfs_qgroup_info_item
{
100 } __attribute__ ((__packed__
));
102 struct btrfs_qgroup_limit_item
{
108 } __attribute__ ((__packed__
));