summaryrefslogtreecommitdiff
path: root/bcache.h
diff options
context:
space:
mode:
authorGabriel <g2p.code@gmail.com>2013-03-09 14:58:57 +0100
committerKent Overstreet <koverstreet@google.com>2013-04-15 12:48:39 -0700
commit94755cc7572a9a6c368d3518a370b49c8913727a (patch)
treeb8301f9054ab89c979b10196a9d8748c3ad205f2 /bcache.h
parent849ce473389cd827268c7d6781ba5082cbac162d (diff)
Update data offset format and warn about the previous one.
Also update the macro to select a bdev. Also reindent.
Diffstat (limited to 'bcache.h')
-rw-r--r--bcache.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/bcache.h b/bcache.h
index 25e3047..bd87121 100644
--- a/bcache.h
+++ b/bcache.h
@@ -32,6 +32,7 @@ static const char bcache_magic[] = {
#define SB_LABEL_SIZE 32
#define SB_JOURNAL_BUCKETS 256U
#define BDEV_DATA_START_DEFAULT 16 /* sectors */
+#define SB_START (SB_SECTOR * 512)
struct cache_sb {
uint64_t csum;
@@ -84,7 +85,11 @@ struct cache_sb {
uint64_t d[SB_JOURNAL_BUCKETS]; /* journal buckets */
};
-BITMASK(SB_BDEV, struct cache_sb, version, 0, 1);
+static inline bool SB_IS_BDEV(const struct cache_sb *sb)
+{
+ return sb->version == BCACHE_SB_VERSION_BDEV
+ || sb->version == BCACHE_SB_VERSION_BDEV_WITH_OFFSET;
+}
BITMASK(BDEV_WRITEBACK, struct cache_sb, flags, 0, 1);