Skip to contentSkip to conversation

Use REQ_OP_WRITE_SAME to implement WRITE SAME

PATCH In review Bart Van Assche 2 participants 3 messages Jul 2, 2019 SCSI target

lore
Share & tools
lore
#0 lore raw

cover Use REQ_OP_WRITE_SAME to implement WRITE SAME

Hi Martin,

The SCSI target iblock backend uses regular writes to implement the SCSI WRITE SAME command. That is suboptimal for at least SCSI and NVMe SSDs. This patch series makes the iblock backend use REQ_OP_WRITE_SAME instead. Please consider these patches for inclusion in the upstream kernel.

Thanks,

Bart.

Bart Van Assche (2):
block: Add blkdev_submit_write_same() target/core: Use REQ_OP_WRITE_SAME to implement WRITE SAME

 block/blk-lib.c                     | 37 ++++++++++++++++++++++++++++-
 drivers/target/target_core_iblock.c | 17 +++++++++++++
 include/linux/blkdev.h              |  3 +++
 3 files changed, 56 insertions(+), 1 deletion(-)
Signature · 1 line
2.22.0.410.gd8fdbe21b5-goog
#1 lore raw

I actually rather wanted to get rid of REQ_OP_WRITE_SAME entirely. Do you have a use case for this?

Note that it isn't going to help with nvme either, as there is no write same command in nvme.

#2 lore raw
In reply to Bart Van Assche
Quoted 2 lines · Christoph Hellwig

I actually rather wanted to get rid of REQ_OP_WRITE_SAME entirely. Do you have a use case for this?

Hi Christoph,

I don't have a use case for this myself. I posted these patches because Roman Bolshakov reported a bug in the SCSI target WRITE SAME implementation. I think that means that he uses this functionality.

Bart.