]> git.baikalelectronics.ru Git - kernel.git/commit
nvmet: add ns write protect support
authorChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Wed, 8 Aug 2018 06:01:07 +0000 (23:01 -0700)
committerChristoph Hellwig <hch@lst.de>
Wed, 8 Aug 2018 10:00:53 +0000 (12:00 +0200)
commit6713b6e8034f0fab2be92a70f3dc2e0a9a3640e8
tree3d1fb89742e040317621eb41f3b3f670ec3c198a
parent8fbdc5733b44e029e8f9a31c2ffaaa1558974c0f
nvmet: add ns write protect support

This patch implements the Namespace Write Protect feature described in
"NVMe TP 4005a Namespace Write Protect". In this version, we implement
No Write Protect and Write Protect states for target ns which can be
toggled by set-features commands from the host side.

For write-protect state transition, we need to flush the ns specified
as a part of command so we also add helpers for carrying out synchronous
flush operations.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
[hch: fixed an incorrect endianess conversion, minor cleanups]
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/target/admin-cmd.c
drivers/nvme/target/core.c
drivers/nvme/target/io-cmd-bdev.c
drivers/nvme/target/io-cmd-file.c
drivers/nvme/target/nvmet.h