DW(zras_feat, NVME_ZNS_MGMT_RECV_ZRAS_FEAT);
struct nvme_passthru_cmd cmd = {
- .opcode = nvme_zns_cmd_mgmt_send,
+ .opcode = nvme_zns_cmd_mgmt_recv,
.nsid = nsid,
.cdw10 = cdw10,
.cdw11 = cdw11,
return nvme_submit_io_passthru(fd, &cmd, NULL);
}
+int nvme_zns_report_zones(int fd, __u32 nsid, __u64 slba, bool extended,
+ enum nvme_zns_report_options opts, bool partial,
+ __u32 data_len, void *data)
+{
+ BUILD_ASSERT(sizeof(struct nvme_zns_desc) == 64);
+ enum nvme_zns_recv_action zra;
+
+ if (extended)
+ zra = NVME_ZNS_ZRA_EXTENDED_REPORT_ZONES;
+ else
+ zra = NVME_ZNS_ZRA_REPORT_ZONES;
+
+ return nvme_zns_mgmt_recv(fd, nsid, slba, zra, opts, partial,
+ data_len, data);
+}
+
int nvme_zns_append(int fd, __u32 nsid, __u64 zslba, __u16 nlb, __u16 control,
__u32 ilbrt, __u16 lbat, __u16 lbatm, __u32 data_len,
void *data, __u32 metadata_len, void *metadata,
};
/**
- * enum nvme_zns_recv_action_spec -
+ * nvme_zns_mgmt_recv() -
+ * @fd: File descriptor of nvme device
+ * @nsid: Namespace ID
+ * @slba:
+ * @zra:
+ * @zrasf:
+ * @zras_feat:
+ * @data_len:
+ * @data:
+ *
+ * Return: The nvme command status if a response was received (see
+ * &enum nvme_status_field) or -1 with errno set otherwise.
+ */
+int nvme_zns_mgmt_recv(int fd, __u32 nsid, __u64 slba,
+ enum nvme_zns_recv_action zra, __u16 zrasf,
+ bool zras_feat, __u32 data_len, void *data);
+
+/**
+ * enum nvme_zns_report_options -
*/
-enum nvme_zns_recv_action_spec {
+enum nvme_zns_report_options {
NVME_ZNS_ZRAS_REPORT_ALL = 0x0,
NVME_ZNS_ZRAS_REPORT_EMPTY = 0x1,
NVME_ZNS_ZRAS_REPORT_IMPL_OPENED = 0x2,
NVME_ZNS_ZRAS_REPORT_OFFLINE = 0x7,
};
-/**
- * nvme_zns_mgmt_recv() -
- * @fd: File descriptor of nvme device
- * @nsid: Namespace ID
- *
- * Return: The nvme command status if a response was received (see
- * &enum nvme_status_field) or -1 with errno set otherwise.
- */
-int nvme_zns_mgmt_recv(int fd, __u32 nsid, __u64 slba,
- enum nvme_zns_recv_action zra, __u16 zrasf,
- bool zras_feat, __u32 data_len, void *data);
+int nvme_zns_report_zones(int fd, __u32 nsid, __u64 slba, bool extended,
+ enum nvme_zns_report_options opts, bool partial,
+ __u32 data_len, void *data);
/**
* nvme_zns_append() -