summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel <g2p.code@gmail.com>2013-09-27 12:05:46 +0200
committerGabriel <g2p.code@gmail.com>2013-09-27 12:05:46 +0200
commitdecab738147cf0eb7d6508454d43048b6ff2ab24 (patch)
tree9287d0df557c91167373b3dbd097ab91bdfe545b
parent8b3e39e0525df37dfbc840e49f2f5a4069b34a1f (diff)
super-show: Show sync mode and cache replacement policy
-rw-r--r--bcache-super-show.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/bcache-super-show.c b/bcache-super-show.c
index fab5e81..c00d22e 100644
--- a/bcache-super-show.c
+++ b/bcache-super-show.c
@@ -136,13 +136,31 @@ int main(int argc, char **argv)
printf("dev.cache.first_sector\t%u\n"
"dev.cache.cache_sectors\t%ju\n"
"dev.cache.total_sectors\t%ju\n"
+ "dev.cache.ordered\t%s\n"
"dev.cache.discard\t%s\n"
- "dev.cache.pos\t\t%u\n",
+ "dev.cache.pos\t\t%u\n"
+ "dev.cache.replacement\t%ju",
sb.bucket_size * sb.first_bucket,
sb.bucket_size * (sb.nbuckets - sb.first_bucket),
sb.bucket_size * sb.nbuckets,
+ CACHE_SYNC(&sb) ? "yes" : "no",
CACHE_DISCARD(&sb) ? "yes" : "no",
- sb.nr_this_dev);
+ sb.nr_this_dev,
+ CACHE_REPLACEMENT(&sb));
+ switch (CACHE_REPLACEMENT(&sb)) {
+ case CACHE_REPLACEMENT_LRU:
+ printf(" [lru]\n");
+ break;
+ case CACHE_REPLACEMENT_FIFO:
+ printf(" [fifo]\n");
+ break;
+ case CACHE_REPLACEMENT_RANDOM:
+ printf(" [random]\n");
+ break;
+ default:
+ putchar('\n');
+ }
+
} else {
uint64_t first_sector;
if (sb.version == BCACHE_SB_VERSION_BDEV) {