Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

NVMe: Add definitions for format command

The SCSI emulation has the ability to send format commands, so we need
to add the definition of the command. Also add a missing error code.

Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>

authored by

Vishal Verma and committed by
Matthew Wilcox
f8ebf840 13c3b0fc

+13
+1
drivers/block/nvme-core.c
··· 93 93 BUILD_BUG_ON(sizeof(struct nvme_create_sq) != 64); 94 94 BUILD_BUG_ON(sizeof(struct nvme_delete_queue) != 64); 95 95 BUILD_BUG_ON(sizeof(struct nvme_features) != 64); 96 + BUILD_BUG_ON(sizeof(struct nvme_format_cmd) != 64); 96 97 BUILD_BUG_ON(sizeof(struct nvme_command) != 64); 97 98 BUILD_BUG_ON(sizeof(struct nvme_id_ctrl) != 4096); 98 99 BUILD_BUG_ON(sizeof(struct nvme_id_ns) != 4096);
+12
include/linux/nvme.h
··· 393 393 __u32 rsvd12[4]; 394 394 }; 395 395 396 + struct nvme_format_cmd { 397 + __u8 opcode; 398 + __u8 flags; 399 + __u16 command_id; 400 + __le32 nsid; 401 + __u64 rsvd2[4]; 402 + __le32 cdw10; 403 + __u32 rsvd11[5]; 404 + }; 405 + 396 406 struct nvme_command { 397 407 union { 398 408 struct nvme_common_command common; ··· 413 403 struct nvme_create_sq create_sq; 414 404 struct nvme_delete_queue delete_queue; 415 405 struct nvme_download_firmware dlfw; 406 + struct nvme_format_cmd format; 416 407 struct nvme_dsm_cmd dsm; 417 408 }; 418 409 }; ··· 431 420 NVME_SC_FUSED_FAIL = 0x9, 432 421 NVME_SC_FUSED_MISSING = 0xa, 433 422 NVME_SC_INVALID_NS = 0xb, 423 + NVME_SC_CMD_SEQ_ERROR = 0xc, 434 424 NVME_SC_LBA_RANGE = 0x80, 435 425 NVME_SC_CAP_EXCEEDED = 0x81, 436 426 NVME_SC_NS_NOT_READY = 0x82,