Date: Wed, 14 Jul 2021 19:06:02 GMT From: Alexander Motin <mav@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: dbf1dce8d6d2 - main - For ns identify/delete allow nsid of 0xffffffff. Message-ID: <202107141906.16EJ62KZ041002@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=dbf1dce8d6d2d0eedac5402c1f137a80805179ca commit dbf1dce8d6d2d0eedac5402c1f137a80805179ca Author: Alexander Motin <mav@FreeBSD.org> AuthorDate: 2021-07-14 18:56:34 +0000 Commit: Alexander Motin <mav@FreeBSD.org> CommitDate: 2021-07-14 19:05:56 +0000 For ns identify/delete allow nsid of 0xffffffff. The first should report common parameters, the second should delete all namespaces. MFC after: 1 week --- sbin/nvmecontrol/ns.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sbin/nvmecontrol/ns.c b/sbin/nvmecontrol/ns.c index dd20e4e47967..1da0cf01a69f 100644 --- a/sbin/nvmecontrol/ns.c +++ b/sbin/nvmecontrol/ns.c @@ -198,7 +198,7 @@ static struct delete_options { uint32_t nsid; const char *dev; } delete_opt = { - .nsid = NONE, + .nsid = NONE - 1, .dev = NULL, }; @@ -331,7 +331,7 @@ static struct identify_options { .hex = false, .verbose = false, .dev = NULL, - .nsid = NONE, + .nsid = NONE - 1, }; static const struct opts identify_opts[] = { @@ -639,12 +639,12 @@ nsdelete(const struct cmd *f, int argc, char *argv[]) if (nsid != 0) { close(fd); open_dev(path, &fd, 1, 1); - } else if (delete_opt.nsid == NONE) { + } else if (delete_opt.nsid == NONE - 1) { close(fd); fprintf(stderr, "No NSID specified"); arg_help(argc, argv, f); } - if (delete_opt.nsid != NONE) + if (delete_opt.nsid != NONE - 1) nsid = delete_opt.nsid; free(path); if (read_controller_data(fd, &cd)) @@ -912,12 +912,12 @@ nsidentify(const struct cmd *f, int argc, char *argv[]) if (nsid != 0) { close(fd); open_dev(path, &fd, 1, 1); - } else if (identify_opt.nsid == NONE) { + } else if (identify_opt.nsid == NONE - 1) { close(fd); fprintf(stderr, "No NSID specified"); arg_help(argc, argv, f); } - if (identify_opt.nsid != NONE) + if (identify_opt.nsid != NONE - 1) nsid = identify_opt.nsid; if (read_controller_data(fd, &cd)) errx(EX_IOERR, "Identify request failed");
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202107141906.16EJ62KZ041002>