nvme: set max_hw_wzeroes_unmap_sectors if device supports DEAC bit
authorZhang Yi <yi.zhang@huawei.com>
Thu, 19 Jun 2025 11:17:59 +0000 (19:17 +0800)
committerChristian Brauner <brauner@kernel.org>
Mon, 23 Jun 2025 10:45:13 +0000 (12:45 +0200)
commit545fb46e5bc6ffaa303181bd3878db506a0f0fa6
tree88f189ea572d9119b54b77115f817668a310958d
parent0c40d7cb5ef3af260e8c7f88e0e5d7ae15d6ce57
nvme: set max_hw_wzeroes_unmap_sectors if device supports DEAC bit

When the device supports the Write Zeroes command and the DEAC bit, it
indicates that the deallocate bit in the Write Zeroes command is
supported, and the bytes read from a deallocated logical block are
zeroes. This means the device supports unmap Write Zeroes operation, so
set the max_hw_wzeroes_unmap_sectors to max_write_zeroes_sectors on the
device's queue limit.

Signed-off-by: Zhang Yi <yi.zhang@huawei.com>
Link: https://lore.kernel.org/20250619111806.3546162-3-yi.zhang@huaweicloud.com
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: "Martin K. Petersen" <martin.petersen@oracle.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
drivers/nvme/host/core.c