diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2021-12-10 14:07:31 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2021-12-10 14:07:31 -0500 |
commit | 2fc5a50bd67ec1d8d7930bbf9dfe03e86884277a (patch) | |
tree | 883251652818e13411712adeabfdcf999e7b7e96 /cmd_device.c | |
parent | 55e3496d06c9b112f93bb1dea942564f900c2f7d (diff) |
Fix device add for kernel sysfs changes
Also slightly improve some error messages
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'cmd_device.c')
-rw-r--r-- | cmd_device.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/cmd_device.c b/cmd_device.c index e7e33367..c5d516bf 100644 --- a/cmd_device.c +++ b/cmd_device.c @@ -104,8 +104,8 @@ int cmd_device_add(int argc, char *argv[]) if (!fs_path) die("Please supply a filesystem"); - char *dev_path = arg_pop(); - if (!dev_path) + dev_opts.path = arg_pop(); + if (!dev_opts.path) die("Please supply a device"); if (argc) @@ -113,7 +113,6 @@ int cmd_device_add(int argc, char *argv[]) struct bchfs_handle fs = bcache_fs_open(fs_path); - dev_opts.path = dev_path; dev_opts.fd = open_for_format(dev_opts.path, force); struct bch_opt_strs fs_opt_strs; @@ -122,9 +121,9 @@ int cmd_device_add(int argc, char *argv[]) struct bch_opts fs_opts = bch2_parse_opts(fs_opt_strs); opt_set(fs_opts, block_size, - read_file_u64(fs.sysfs_fd, "block_size") >> 9); + read_file_u64(fs.sysfs_fd, "options/block_size") >> 9); opt_set(fs_opts, btree_node_size, - read_file_u64(fs.sysfs_fd, "btree_node_size") >> 9); + read_file_u64(fs.sysfs_fd, "options/btree_node_size") >> 9); struct bch_sb *sb = bch2_format(fs_opt_strs, fs_opts, |