nvme: implement the DEAC bit for the Write Zeroes command
authorChristoph Hellwig <hch@lst.de>
Sun, 30 Oct 2022 15:50:15 +0000 (16:50 +0100)
committerChristoph Hellwig <hch@lst.de>
Tue, 15 Nov 2022 09:50:31 +0000 (10:50 +0100)
commit1b96f862ecccb3e6f950eba584bebf22955cecc5
tree85ca6d248f86146a2d487a0c90fbc1280e179124
parente4fbcf32c860f98103ca7f1dc8c0dc69e2219ec6
nvme: implement the DEAC bit for the Write Zeroes command

While the specification allows devices to either deallocate data
or to actually write zeroes on any Write Zeroes command, many SSDs
only do the sensible thing and deallocate data when the DEAC bit
is specific.  Set it when it is supported and the caller doesn't
explicitly opt out of deallocation.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/nvme/host/core.c
drivers/nvme/host/nvme.h
include/linux/nvme.h