]> git.sesse.net Git - bcachefs-tools-debian/blob - bcache.h
3f94dcee140609af9ad75b9611f5475c0a03a3ff
[bcachefs-tools-debian] / bcache.h
1 #ifndef _BCACHE_H
2 #define _BCACHE_H
3
4 static const char bcache_magic[] = {
5         0xc6, 0x85, 0x73, 0xf6, 0x4e, 0x1a, 0x45, 0xca,
6         0x82, 0x65, 0xf5, 0x7f, 0x48, 0xba, 0x6d, 0x81 };
7
8 struct cache_sb {
9         uint8_t         magic[16];
10 #define CACHE_CLEAN             1
11 #define CACHE_SYNC              2
12 #define CACHE_BACKING_DEVICE    4
13         uint32_t        version;
14         uint16_t        block_size;     /* sectors */
15         uint16_t        bucket_size;    /* sectors */
16         uint32_t        journal_start;  /* buckets */
17         uint32_t        first_bucket;   /* start of data */
18         uint64_t        nbuckets;       /* device size */
19         uint64_t        btree_root;
20         uint16_t        btree_level;
21         uint16_t        nr_in_set;
22         uint16_t        nr_this_dev;
23         uint16_t        _pad[1];
24         uint8_t         uuid[16];
25         uint8_t         set_uuid[16];
26 };
27
28 struct bucket_disk {
29         uint16_t        priority;
30         uint8_t         generation;
31 } __attribute((packed));
32
33 #endif