diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2018-01-11 06:41:59 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2018-01-11 07:02:08 -0500 |
commit | 4de98a2712764bceb9e0f67b1ac2f2c7862feb77 (patch) | |
tree | 94861af51e19af917d80952dfabeaa7a76901eaa /cmd_debug.c | |
parent | f8cbede6d18e81c804e62fd7d576310b420dcaac (diff) |
Update bcachefs sources to 02ae70070a bcachefs: Allocate new btree roots lazily
Diffstat (limited to 'cmd_debug.c')
-rw-r--r-- | cmd_debug.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/cmd_debug.c b/cmd_debug.c index 1a2c1dbd..6e395bab 100644 --- a/cmd_debug.c +++ b/cmd_debug.c @@ -80,9 +80,7 @@ static void dump_one_device(struct bch_fs *c, struct bch_dev *ca, int fd) int cmd_dump(int argc, char *argv[]) { struct bch_opts opts = bch2_opts_empty(); - struct bch_fs *c = NULL; struct bch_dev *ca; - const char *err; char *out = NULL; unsigned i, nr_devices = 0; bool force = false; @@ -112,9 +110,9 @@ int cmd_dump(int argc, char *argv[]) if (!out) die("Please supply output filename"); - err = bch2_fs_open(argv + optind, argc - optind, opts, &c); - if (err) - die("error opening %s: %s", argv[optind], err); + struct bch_fs *c = bch2_fs_open(argv + optind, argc - optind, opts); + if (IS_ERR(c)) + die("error opening %s: %s", argv[optind], strerror(-PTR_ERR(c))); down_read(&c->gc_lock); @@ -258,10 +256,8 @@ static const char * const list_modes[] = { int cmd_list(int argc, char *argv[]) { struct bch_opts opts = bch2_opts_empty(); - struct bch_fs *c = NULL; enum btree_id btree_id = BTREE_ID_EXTENTS; struct bpos start = POS_MIN, end = POS_MAX; - const char *err; u64 inum; int mode = 0, opt; @@ -307,9 +303,9 @@ int cmd_list(int argc, char *argv[]) if (optind >= argc) die("Please supply device(s) to check"); - err = bch2_fs_open(argv + optind, argc - optind, opts, &c); - if (err) - die("error opening %s: %s", argv[optind], err); + struct bch_fs *c = bch2_fs_open(argv + optind, argc - optind, opts); + if (IS_ERR(c)) + die("error opening %s: %s", argv[optind], strerror(-PTR_ERR(c))); switch (mode) { case 0: |