[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250318073545.3518707-6-yi.zhang@huaweicloud.com>
Date: Tue, 18 Mar 2025 15:35:40 +0800
From: Zhang Yi <yi.zhang@...weicloud.com>
To: linux-fsdevel@...r.kernel.org,
linux-ext4@...r.kernel.org,
linux-block@...r.kernel.org,
dm-devel@...ts.linux.dev,
linux-nvme@...ts.infradead.org,
linux-scsi@...r.kernel.org
Cc: linux-xfs@...r.kernel.org,
linux-kernel@...r.kernel.org,
hch@....de,
tytso@....edu,
djwong@...nel.org,
john.g.garry@...cle.com,
bmarzins@...hat.com,
chaitanyak@...dia.com,
shinichiro.kawasaki@....com,
yi.zhang@...wei.com,
yi.zhang@...weicloud.com,
chengzhihao1@...wei.com,
yukuai3@...wei.com,
yangerkun@...wei.com
Subject: [RFC PATCH -next v3 05/10] scsi: sd: set BLK_FEAT_WRITE_ZEROES_UNMAP if device supports unmap zeroing mode
From: Zhang Yi <yi.zhang@...wei.com>
When the device supports the Write Zeroes command and the zeroing mode
is set to SD_ZERO_WS16_UNMAP or SD_ZERO_WS10_UNMAP, this means that the
device supports unmap Write Zeroes, so set the corresponding
BLK_FEAT_WRITE_ZEROES_UNMAP feature to the device's queue limit.
Signed-off-by: Zhang Yi <yi.zhang@...wei.com>
Reviewed-by: Christoph Hellwig <hch@....de>
---
drivers/scsi/sd.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 950d8c9fb884..652630b410de 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -1118,6 +1118,11 @@ static void sd_config_write_same(struct scsi_disk *sdkp,
else
sdkp->zeroing_mode = SD_ZERO_WRITE;
+ if (sdkp->max_ws_blocks &&
+ (sdkp->zeroing_mode == SD_ZERO_WS16_UNMAP ||
+ sdkp->zeroing_mode == SD_ZERO_WS10_UNMAP))
+ lim->features |= BLK_FEAT_WRITE_ZEROES_UNMAP;
+
if (sdkp->max_ws_blocks &&
sdkp->physical_block_size > logical_block_size) {
/*
--
2.46.1
Powered by blists - more mailing lists