2010-10-08 18:04:49 +04:00
|
|
|
#ifndef _BCACHE_H
|
|
|
|
#define _BCACHE_H
|
|
|
|
|
|
|
|
static const char bcache_magic[] = {
|
|
|
|
0xc6, 0x85, 0x73, 0xf6, 0x4e, 0x1a, 0x45, 0xca,
|
|
|
|
0x82, 0x65, 0xf5, 0x7f, 0x48, 0xba, 0x6d, 0x81 };
|
|
|
|
|
2011-07-25 21:46:20 +04:00
|
|
|
#define SB_SECTOR 8
|
|
|
|
#define SB_LABEL_SIZE 32
|
2011-05-20 07:25:14 +04:00
|
|
|
|
2010-10-08 18:04:49 +04:00
|
|
|
struct cache_sb {
|
2011-07-25 21:46:20 +04:00
|
|
|
uint64_t csum;
|
|
|
|
uint64_t offset; /* sector where this sb was written */
|
|
|
|
uint64_t version;
|
2011-07-25 11:18:42 +04:00
|
|
|
#define CACHE_BACKING_DEV 1
|
|
|
|
|
2011-07-25 21:46:20 +04:00
|
|
|
uint8_t magic[16];
|
2011-07-25 11:18:42 +04:00
|
|
|
|
2011-07-25 21:46:20 +04:00
|
|
|
uint8_t uuid[16];
|
|
|
|
union {
|
|
|
|
uint8_t set_uuid[16];
|
|
|
|
uint64_t set_magic;
|
|
|
|
};
|
|
|
|
uint8_t label[SB_LABEL_SIZE];
|
2011-07-25 11:18:42 +04:00
|
|
|
|
2011-07-25 21:46:20 +04:00
|
|
|
uint64_t flags;
|
|
|
|
uint64_t seq;
|
|
|
|
uint64_t pad[8];
|
2011-07-25 11:18:42 +04:00
|
|
|
|
2011-07-25 21:46:20 +04:00
|
|
|
uint64_t nbuckets; /* device size */
|
|
|
|
uint16_t block_size; /* sectors */
|
|
|
|
uint16_t bucket_size; /* sectors */
|
2011-07-25 11:18:42 +04:00
|
|
|
|
2011-07-25 21:46:20 +04:00
|
|
|
uint16_t nr_in_set;
|
|
|
|
uint16_t nr_this_dev;
|
2011-05-20 07:25:14 +04:00
|
|
|
|
2011-07-25 21:46:20 +04:00
|
|
|
uint32_t last_mount; /* time_t */
|
2011-05-20 07:25:14 +04:00
|
|
|
|
2011-07-25 21:46:20 +04:00
|
|
|
uint16_t first_bucket;
|
|
|
|
uint16_t keys; /* number of journal buckets */
|
|
|
|
uint64_t d[512]; /* journal buckets */
|
2011-07-25 11:18:42 +04:00
|
|
|
};
|
|
|
|
|
2010-10-08 18:04:49 +04:00
|
|
|
#endif
|