summaryrefslogtreecommitdiff
path: root/bcache.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2010-10-08 07:04:49 -0700
committerKent Overstreet <kent.overstreet@gmail.com>2010-10-08 07:04:49 -0700
commit7e9790107563dfa88ccd89aa0d0fa33266848400 (patch)
treea1418f8289ca916ba329756fec003c66ac024d09 /bcache.h
parent1d895a5a451e041fcefeefbe1fd07eed034394cd (diff)
UUIDs
Diffstat (limited to 'bcache.h')
-rw-r--r--bcache.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/bcache.h b/bcache.h
new file mode 100644
index 0000000..448b6a5
--- /dev/null
+++ b/bcache.h
@@ -0,0 +1,29 @@
+#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 };
+
+struct cache_sb {
+ uint8_t magic[16];
+#define CACHE_CLEAN 1
+#define CACHE_SYNC 2
+ uint32_t version;
+ uint16_t block_size; /* sectors */
+ uint16_t bucket_size; /* sectors */
+ uint32_t journal_start; /* buckets */
+ uint32_t first_bucket; /* start of data */
+ uint64_t nbuckets; /* device size */
+ uint64_t btree_root;
+ uint16_t btree_level;
+ uint16_t _pad[3];
+ uint8_t uuid[16];
+};
+
+struct bucket_disk {
+ uint16_t priority;
+ uint8_t generation;
+} __attribute((packed));
+
+#endif