The branch stable/12 has been updated by mav:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=f65faff5da28865efb2a90e8fbdae5864e630800

commit f65faff5da28865efb2a90e8fbdae5864e630800
Author:     Alexander Motin <[email protected]>
AuthorDate: 2021-07-14 18:56:34 +0000
Commit:     Alexander Motin <[email protected]>
CommitDate: 2021-07-21 01:57:05 +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
    
    (cherry picked from commit dbf1dce8d6d2d0eedac5402c1f137a80805179ca)
---
 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");
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to