summaryrefslogtreecommitdiff
path: root/bcache.h
diff options
context:
space:
mode:
authorKent Overstreet <koverstreet@google.com>2012-01-18 16:05:32 -0800
committerKent Overstreet <koverstreet@google.com>2012-01-18 16:05:32 -0800
commit7f023533a8ee93126ff86097aca3630a9390c904 (patch)
treea9dc87fc6d12d82f3d3f261c995042b8213c4b37 /bcache.h
parent58f79db74b6d825d5d63eaa1d164139ed0778d7f (diff)
Add --discard and --cache_replacement_policy
Diffstat (limited to 'bcache.h')
-rw-r--r--bcache.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/bcache.h b/bcache.h
index e667cc0..8087092 100644
--- a/bcache.h
+++ b/bcache.h
@@ -15,6 +15,14 @@ static const char bcache_magic[] = {
0xc6, 0x85, 0x73, 0xf6, 0x4e, 0x1a, 0x45, 0xca,
0x82, 0x65, 0xf5, 0x7f, 0x48, 0xba, 0x6d, 0x81 };
+/* Version 1: Backing dev
+ * Version 2: Seed pointer into btree node checksum
+ * Version 3: Backing dev superblock has offset of start of data
+ */
+
+#define BCACHE_SB_BDEV_VERSION 3
+#define BCACHE_SB_MAX_VERSION 3
+
#define SB_SECTOR 8
#define SB_LABEL_SIZE 32
@@ -51,8 +59,13 @@ struct cache_sb {
uint64_t d[]; /* journal buckets */
};
+BITMASK(SB_BDEV, struct cache_sb, version, 0, 1);
+
BITMASK(BDEV_WRITEBACK, struct cache_sb, flags, 0, 1);
+BITMASK(CACHE_DISCARD, struct cache_sb, flags, 1, 1);
+BITMASK(CACHE_REPLACEMENT, struct cache_sb, flags, 2, 3);
+
inline uint64_t crc64(const void *_data, size_t len);
#define node(i, j) ((void *) ((i)->d + (j)))