summaryrefslogtreecommitdiff
path: root/bcache.h
diff options
context:
space:
mode:
authorGabriel <g2p.code@gmail.com>2013-05-01 19:15:18 +0200
committerGabriel <g2p.code@gmail.com>2013-05-08 09:40:46 +0200
commit315ab92e58e3984351df8650527986b2b950e189 (patch)
tree0d196745be071547392d4867377a3a22cfcd75a2 /bcache.h
parentaf6e3f1c7421e8517e0b9e1a99a88c9e2b34236d (diff)
super-show: print cache mode (writethrough, writeback, writearound, none)
Diffstat (limited to 'bcache.h')
-rw-r--r--bcache.h21
1 files changed, 17 insertions, 4 deletions
diff --git a/bcache.h b/bcache.h
index bd87121..ac1633c 100644
--- a/bcache.h
+++ b/bcache.h
@@ -91,10 +91,23 @@ static inline bool SB_IS_BDEV(const struct cache_sb *sb)
|| sb->version == BCACHE_SB_VERSION_BDEV_WITH_OFFSET;
}
-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);
+BITMASK(CACHE_SYNC, struct cache_sb, flags, 0, 1);
+BITMASK(CACHE_DISCARD, struct cache_sb, flags, 1, 1);
+BITMASK(CACHE_REPLACEMENT, struct cache_sb, flags, 2, 3);
+#define CACHE_REPLACEMENT_LRU 0U
+#define CACHE_REPLACEMENT_FIFO 1U
+#define CACHE_REPLACEMENT_RANDOM 2U
+
+BITMASK(BDEV_CACHE_MODE, struct cache_sb, flags, 0, 4);
+#define CACHE_MODE_WRITETHROUGH 0U
+#define CACHE_MODE_WRITEBACK 1U
+#define CACHE_MODE_WRITEAROUND 2U
+#define CACHE_MODE_NONE 3U
+BITMASK(BDEV_STATE, struct cache_sb, flags, 61, 2);
+#define BDEV_STATE_NONE 0U
+#define BDEV_STATE_CLEAN 1U
+#define BDEV_STATE_DIRTY 2U
+#define BDEV_STATE_STALE 3U
inline uint64_t crc64(const void *_data, size_t len);