diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2016-10-04 01:10:24 -0800 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2016-10-06 06:52:54 -0800 |
commit | f3a8d548376295279d2d27fda5764adbe377c55b (patch) | |
tree | b3cb6b8e547fe419427d0490aa88c62bbfa454ae /bcache-device.c | |
parent | 837a476cc139167fc483016f0a2635a048f7709e (diff) |
bcache device_show now dumps superblocks
Diffstat (limited to 'bcache-device.c')
-rw-r--r-- | bcache-device.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/bcache-device.c b/bcache-device.c index 1f6f1574..a349e790 100644 --- a/bcache-device.c +++ b/bcache-device.c @@ -16,6 +16,10 @@ #include <nih/option.h> #include "bcache.h" +#include "libbcache.h" + +/* This code belongs under show_fs */ +#if 0 struct bcache_dev { unsigned nr; @@ -162,6 +166,20 @@ int cmd_device_show(int argc, char *argv[]) return 0; } +#endif + +int cmd_device_show(int argc, char *argv[]) +{ + struct cache_sb *sb; + + if (argc != 2) + die("please supply a single device"); + + sb = bcache_super_read(argv[1]); + bcache_super_print(sb, HUMAN_READABLE); + + return 0; +} int cmd_device_add(int argc, char *argv[]) { |