diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2025-04-28 14:50:43 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2025-04-28 15:31:43 -0400 |
commit | 6d7b47685b2625e3103e26a25c8003ef6de5f82d (patch) | |
tree | 421b388c1e90e45d7f653bf502c0858426b8d625 /c_src/cmd_key.c | |
parent | 0589d9f3c3cdff28a13f9efc96762d39ef615d22 (diff) |
Update bcachefs sources to f0ebca18293c bcachefs: bch2_fs_open() now takes a darray
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'c_src/cmd_key.c')
-rw-r--r-- | c_src/cmd_key.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/c_src/cmd_key.c b/c_src/cmd_key.c index ac8a94a8..c1b72ff4 100644 --- a/c_src/cmd_key.c +++ b/c_src/cmd_key.c @@ -87,12 +87,13 @@ int cmd_unlock(int argc, char *argv[]) int cmd_set_passphrase(int argc, char *argv[]) { - struct bch_opts opts = bch2_opts_empty(); - struct bch_fs *c; - - if (argc < 2) + args_shift(1); + if (!argc) die("Please supply one or more devices"); + darray_const_str devs = get_or_split_cmdline_devs(argc, argv); + + struct bch_opts opts = bch2_opts_empty(); opt_set(opts, nostart, true); /* @@ -100,7 +101,7 @@ int cmd_set_passphrase(int argc, char *argv[]) * to make sure we're opening and updating every component device: */ - c = bch2_fs_open(argv + 1, argc - 1, opts); + struct bch_fs *c = bch2_fs_open(&devs, &opts); if (IS_ERR(c)) die("Error opening %s: %s", argv[1], bch2_err_str(PTR_ERR(c))); @@ -126,14 +127,16 @@ int cmd_set_passphrase(int argc, char *argv[]) int cmd_remove_passphrase(int argc, char *argv[]) { - struct bch_opts opts = bch2_opts_empty(); - struct bch_fs *c; - - if (argc < 2) + args_shift(1); + if (!argc) die("Please supply one or more devices"); + darray_const_str devs = get_or_split_cmdline_devs(argc, argv); + + struct bch_opts opts = bch2_opts_empty(); opt_set(opts, nostart, true); - c = bch2_fs_open(argv + 1, argc - 1, opts); + + struct bch_fs *c = bch2_fs_open(&devs, &opts); if (IS_ERR(c)) die("Error opening %s: %s", argv[1], bch2_err_str(PTR_ERR(c))); |