int cmd_dump(int argc, char *argv[])
{
- DECLARE_COMPLETION_ONSTACK(shutdown);
- struct cache_set_opts opts = cache_set_opts_empty();
+ struct bch_opts opts = bch_opts_empty();
struct cache_set *c = NULL;
const char *err;
char *out = NULL, *buf;
buf = alloca(strlen(out) + 10);
strcpy(buf, out);
- err = bch_register_cache_set(argv + optind, argc - optind, opts, &c);
+ err = bch_fs_open(argv + optind, argc - optind, opts, &c);
if (err)
die("error opening %s: %s", argv[optind], err);
up_read(&c->gc_lock);
- c->stop_completion = &shutdown;
- bch_cache_set_stop(c);
- closure_put(&c->cl);
- wait_for_completion(&shutdown);
+ bch_fs_stop_sync(c);
return 0;
}
int cmd_list(int argc, char *argv[])
{
- DECLARE_COMPLETION_ONSTACK(shutdown);
- struct cache_set_opts opts = cache_set_opts_empty();
+ struct bch_opts opts = bch_opts_empty();
struct cache_set *c = NULL;
enum btree_id btree_id = BTREE_ID_EXTENTS;
struct bpos start = POS_MIN, end = POS_MAX;
if (optind >= argc)
die("Please supply device(s) to check");
- err = bch_register_cache_set(argv + optind, argc - optind, opts, &c);
+ err = bch_fs_open(argv + optind, argc - optind, opts, &c);
if (err)
die("error opening %s: %s", argv[optind], err);
die("Invalid mode");
}
- c->stop_completion = &shutdown;
- bch_cache_set_stop(c);
- closure_put(&c->cl);
- wait_for_completion(&shutdown);
+ bch_fs_stop_sync(c);
return 0;
}