-
Notifications
You must be signed in to change notification settings - Fork 4
/
ctree.h
58 lines (45 loc) · 1.2 KB
/
ctree.h
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
// SPDX-License-Identifier: MIT
#ifndef BTRFS_FUSE_CTREE_H
#define BTRFS_FUSE_CTREE_H
#include <pthread.h>
#include "accessors.h"
#include "libs/rbtree.h"
#include "libs/list.h"
#define BTRFS_UUID_UNPARSED_SIZE 37
struct btrfs_root {
struct extent_buffer *node;
struct btrfs_key root_key;
struct btrfs_fs_info *fs_info;
struct rb_node rb_node;
/*
* Indicates the first inode number, which is also the inode for the
* subvolume root.
*/
u64 root_dirid;
};
/* Represents a btrfs filesystem */
struct btrfs_fs_info {
u8 chunk_tree_uuid[BTRFS_UUID_SIZE];
u8 fsid[BTRFS_UUID_SIZE];
struct btrfs_root *tree_root;
struct btrfs_root *default_root;
struct btrfs_root *chunk_root;
struct btrfs_root *csum_root;
/* Records all subvolume trees that are in use */
struct rb_root subvols_root;
/* Records logical->physical mappings */
struct rb_root mapping_root;
/* Recrods all extent_buffers */
struct rb_root eb_root;
pthread_mutex_t eb_lock;
/* Cached generation, the same as superblock::generation */
u64 generation;
/* Cached basic sizes */
u32 nodesize;
u32 sectorsize;
u16 csum_size;
u16 csum_type;
struct btrfs_fs_devices *fs_devices;
struct btrfs_super_block super_copy;
};
#endif