summaryrefslogtreecommitdiff
path: root/cmd_format.c
diff options
context:
space:
mode:
authorHunter Shaffer <huntershaffer182456@gmail.com>2023-08-29 18:05:09 -0400
committerHunter Shaffer <huntershaffer182456@gmail.com>2023-10-08 21:06:07 -0400
commit9f98746bfcd5159307237f7a491fd79db02d8bf3 (patch)
tree10af18e18b44adf4cb8456d254aa5e2c44df9216 /cmd_format.c
parentb2ffa12074f1a6060b715e0891c1efb3ee64be68 (diff)
Change open_for_format to the block io api
Upcoming patch will add device benchmarking at format time, which needs the bio API. Signed-off-by: Hunter Shaffer <huntershaffer182456@gmail.com>
Diffstat (limited to 'cmd_format.c')
-rw-r--r--cmd_format.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/cmd_format.c b/cmd_format.c
index 4b1dcbe2..42f3fc6c 100644
--- a/cmd_format.c
+++ b/cmd_format.c
@@ -230,8 +230,11 @@ int cmd_format(int argc, char *argv[])
initialize = false;
}
- darray_for_each(devices, dev)
- dev->fd = open_for_format(dev->path, force);
+ darray_for_each(devices, dev) {
+ int ret = open_for_format(dev, force);
+ if (ret)
+ die("Error opening %s: %s", dev_opts.path, strerror(-ret));
+ }
struct bch_sb *sb =
bch2_format(fs_opt_strs,