return err;
}
-int nvme_get_lba_status(int fd, __u64 slba, __u32 mndw, __u8 atype, __u16 rl,
- void *data)
+int nvme_get_lba_status(int fd, __u32 namespace_id, __u64 slba, __u32 mndw,
+ __u8 atype, __u16 rl, void *data)
{
struct nvme_admin_cmd cmd = {
.opcode = nvme_admin_get_lba_status,
+ .nsid = namespace_id,
.addr = (__u64)(uintptr_t) data,
+ .data_len = (mndw + 1) * 4,
.cdw10 = slba & 0xffffffff,
.cdw11 = slba >> 32,
.cdw12 = mndw,
int nvme_reset_controller(int fd);
int nvme_ns_rescan(int fd);
-int nvme_get_lba_status(int fd, __u64 slba, __u32 mndw, __u8 atype, __u16 rl,
- void *data);
+int nvme_get_lba_status(int fd, __u32 namespace_id, __u64 slba, __u32 mndw,
+ __u8 atype, __u16 rl, void *data);
int nvme_dir_send(int fd, __u32 nsid, __u16 dspec, __u8 dtype, __u8 doper,
__u32 data_len, __u32 dw12, void *data, __u32 *result);
int nvme_dir_recv(int fd, __u32 nsid, __u16 dspec, __u8 dtype, __u8 doper,
struct plugin *plugin)
{
const char *desc = "Information about potentially unrecoverable LBAs.";
+ const char *namespace_id = "Desired Namespace";
const char *slba = "Starting LBA(SLBA) in 64-bit address of the first"\
" logical block addressed by this command";
const char *mndw = "Maximum Number of Dwords(MNDW) specifies maximum"\
void *buf;
struct config {
+ __u32 namespace_id;
__u64 slba;
__u32 mndw;
__u8 atype;
};
struct config cfg = {
+ .namespace_id = 0,
.slba = 0,
.mndw = 0,
.atype = 0,
};
OPT_ARGS(opts) = {
+ OPT_UINT("namespace-id", 'n', &cfg.namespace_id, namespace_id),
OPT_SUFFIX("start-lba", 's', &cfg.slba, slba),
OPT_UINT("max-dw", 'm', &cfg.mndw, mndw),
OPT_BYTE("action", 'a', &cfg.atype, atype),
goto close_fd;
}
- err = nvme_get_lba_status(fd, cfg.slba, cfg.mndw, cfg.atype, cfg.rl,
- buf);
+ err = nvme_get_lba_status(fd, cfg.namespace_id, cfg.slba, cfg.mndw,
+ cfg.atype, cfg.rl, buf);
if (!err)
nvme_show_lba_status(buf, buf_len, flags);
else if (err > 0)