2016-03-12 09:18:42 +03:00
|
|
|
|
|
|
|
#include <nih/option.h>
|
|
|
|
|
|
|
|
#include "bcache.h"
|
|
|
|
|
|
|
|
struct bcache_fs {
|
|
|
|
/* options... */
|
|
|
|
|
|
|
|
u64 capacity;
|
|
|
|
|
|
|
|
/* XXX: dirty != used, it doesn't count metadata */
|
|
|
|
u64 bytes_dirty;
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct bcache_fs fill_fs(struct bcache_handle fs)
|
|
|
|
{
|
|
|
|
return (struct bcache_fs) {
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2016-08-24 06:50:31 +03:00
|
|
|
int cmd_fs_show(int argc, char *argv[])
|
2016-03-12 09:18:42 +03:00
|
|
|
{
|
2016-08-24 06:50:31 +03:00
|
|
|
NihOption opts[] = {
|
|
|
|
// { int shortoption, char *longoption, char *help, NihOptionGroup, char *argname, void *value, NihOptionSetter}
|
|
|
|
NIH_OPTION_LAST
|
|
|
|
};
|
|
|
|
char **args = bch_nih_init(argc, argv, opts);
|
|
|
|
|
2016-03-12 09:18:42 +03:00
|
|
|
if (nr_args(args) != 1)
|
|
|
|
die("Please supply a filesystem");
|
|
|
|
|
|
|
|
struct bcache_handle fs = bcache_fs_open(args[0]);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2016-08-24 06:50:31 +03:00
|
|
|
int cmd_fs_set(int argc, char *argv[])
|
2016-03-12 09:18:42 +03:00
|
|
|
{
|
2016-08-24 06:50:31 +03:00
|
|
|
NihOption opts[] = {
|
|
|
|
// { int shortoption, char *longoption, char *help, NihOptionGroup, char *argname, void *value, NihOptionSetter}
|
|
|
|
NIH_OPTION_LAST
|
|
|
|
};
|
|
|
|
char **args = bch_nih_init(argc, argv, opts);
|
|
|
|
|
2016-03-12 09:18:42 +03:00
|
|
|
if (nr_args(args) < 1)
|
|
|
|
die("Please supply a filesystem");
|
|
|
|
|
|
|
|
struct bcache_handle fs = bcache_fs_open(args[0]);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|