From: Steven Seungcheol Lee Date: Fri, 26 Jun 2020 10:11:37 +0000 (+0900) Subject: zns: getting zdes logic using exist function, data_len should be in bytes X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=b6bcfa6be20e1121335ac3e3defa580460b10942;p=users%2Fhch%2Fnvme-cli.git zns: getting zdes logic using exist function, data_len should be in bytes Signed-off-by: Steven Seungcheol Lee --- diff --git a/plugins/zns/zns.c b/plugins/zns/zns.c index 73e37a8..407e7f9 100644 --- a/plugins/zns/zns.c +++ b/plugins/zns/zns.c @@ -368,8 +368,6 @@ static int set_zone_desc(int argc, char **argv, struct command *cmd, struct plug const char *data = "optional file for zone extention data (default stdin)"; int fd, ffd = STDIN_FILENO, err; - struct nvme_zns_id_ns ns; - struct nvme_id_ns id_ns; void *buf = NULL; __u32 data_len; uint8_t lbaf; @@ -402,20 +400,7 @@ static int set_zone_desc(int argc, char **argv, struct command *cmd, struct plug } } - err = nvme_identify_ns(fd, cfg.namespace_id, false, &id_ns); - if (err) { - nvme_show_status(err); - goto close_fd; - } - - err = nvme_zns_identify_ns(fd, cfg.namespace_id, &ns); - if (err) { - nvme_show_status(err); - goto close_fd; - } - - lbaf = id_ns.flbas & NVME_NS_FLBAS_LBA_MASK; - data_len = ns.lbafe[lbaf].zdes; + data_len = get_zdes_bytes(fd, cfg.namespace_id); if (!data_len) { fprintf(stderr,