summaryrefslogtreecommitdiff
path: root/bcache.h
diff options
context:
space:
mode:
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);