]> git.sesse.net Git - bcachefs-tools-debian/blob - bcache.h
UUIDs
[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         uint32_t        version;
13         uint16_t        block_size;     /* sectors */
14         uint16_t        bucket_size;    /* sectors */
15         uint32_t        journal_start;  /* buckets */
16         uint32_t        first_bucket;   /* start of data */
17         uint64_t        nbuckets;       /* device size */
18         uint64_t        btree_root;
19         uint16_t        btree_level;
20         uint16_t        _pad[3];
21         uint8_t         uuid[16];
22 };
23
24 struct bucket_disk {
25         uint16_t        priority;
26         uint8_t         generation;
27 } __attribute((packed));
28
29 #endif