aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShaoxiong Li <dahefanteng@gmail.com>2018-08-30 18:34:30 +0800
committerColy Li <colyli@suse.de>2019-09-28 15:40:01 +0800
commit3c78252b38b14881806afed675f28d9134801bc8 (patch)
tree8fdc8ab0b7cb5070f4967f632a4591f3d3ecbc11
parent3a300e50b2c52672b71dc9a0c76a9936f2c34139 (diff)
downloadbcache-tools-3c78252b38b14881806afed675f28d9134801bc8.tar.gz
bcache-tools: Add 'Name' and 'Type' field
When using 'bcache make' command,you can see the name and the type information in the output. Signed-off-by: Shaoxiong Li <dahefanteng@gmail.com> Signed-off-by: Coly Li <colyli@suse.de>
-rw-r--r--make.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/make.c b/make.c
index 90c3cc19..d6173d08 100644
--- a/make.c
+++ b/make.c
@@ -246,15 +246,18 @@ static void write_sb(char *dev, unsigned int block_size,
sb.data_offset = data_offset;
}
+ printf("Name %s\n", dev);
+ printf("Type data\n");
printf("UUID: %s\n"
"Set UUID: %s\n"
"version: %u\n"
- "block_size: %u\n"
- "data_offset: %ju\n",
+ "block_size_in_sectors: %u\n"
+ "data_offset_in_sectors: %ju\n",
uuid_str, set_uuid_str,
(unsigned int) sb.version,
sb.block_size,
data_offset);
+ putchar('\n');
} else {
sb.nbuckets = getblocks(fd) / sb.bucket_size;
sb.nr_in_set = 1;
@@ -269,12 +272,14 @@ static void write_sb(char *dev, unsigned int block_size,
SET_CACHE_DISCARD(&sb, discard);
SET_CACHE_REPLACEMENT(&sb, cache_replacement_policy);
+ printf("Name %s\n", dev);
+ printf("Type cache\n");
printf("UUID: %s\n"
"Set UUID: %s\n"
"version: %u\n"
"nbuckets: %ju\n"
- "block_size: %u\n"
- "bucket_size: %u\n"
+ "block_size_in_sectors: %u\n"
+ "bucket_size_in_sectors: %u\n"
"nr_in_set: %u\n"
"nr_this_dev: %u\n"
"first_bucket: %u\n",
@@ -286,6 +291,7 @@ static void write_sb(char *dev, unsigned int block_size,
sb.nr_in_set,
sb.nr_this_dev,
sb.first_bucket);
+ putchar('\n');
}
sb.csum = csum_set(&sb);