nvmet: add helper to report invalid opcode
authorChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Wed, 10 Feb 2021 05:47:56 +0000 (21:47 -0800)
committerChristoph Hellwig <hch@lst.de>
Wed, 10 Feb 2021 15:38:05 +0000 (16:38 +0100)
commitd81d57cf1b4702b7c2fa8ce8f1d5c6961a0c20b5
treec6dc382e3a0d32548a86e509d33a738471cd78e9
parent3999434b6ce6fa452128c36cbb5017f0cd347615
nvmet: add helper to report invalid opcode

In the NVMeOF block device backend, file backend, and passthru backend
we reject and report the commands if opcode is not handled.

Add an helper and use it in block device backend to keep the code
and error message uniform.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/target/core.c
drivers/nvme/target/io-cmd-bdev.c
drivers/nvme/target/nvmet.h