From 9f98746bfcd5159307237f7a491fd79db02d8bf3 Mon Sep 17 00:00:00 2001 From: Hunter Shaffer Date: Tue, 29 Aug 2023 18:05:09 -0400 Subject: 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 --- cmd_format.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'cmd_format.c') 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, -- cgit v1.2.3