target/iblock: Convert WRITE_SAME to blkdev_issue_zeroout
Subsystems (2)
PATCH v2 1/1 target/iblock: Convert WRITE_SAME to blkdev_issue_zeroout
From: Nicholas Bellinger <[email protected]>
The people who are actively using iblock_execute_write_same_direct() are doing so in the context of ESX VAAI BlockZero, together with EXTENDED_COPY and COMPARE_AND_WRITE primitives.
In practice though I've not seen any users of IBLOCK WRITE_SAME for anything other than VAAI BlockZero, so just using blkdev_issue_zeroout() when available, and falling back to iblock_execute_write_same() if the WRITE_SAME buffer contains anything other than zeros should be OK.
(Hook up max_write_zeroes_sectors to signal LBPRZ feature bit in
target_configure_unmap_from_queue - nab)
--- drivers/target/target_core_device.c | 2 +- drivers/target/target_core_iblock.c | 44 +++++++++++++++++++++++-------------- 2 files changed, 28 insertions(+), 18 deletions(-)
drivers/target/target_core_device.c +1 -1
@@ -851,7 +851,7 @@ bool target_configure_unmap_from_queue(struct se_dev_attrib *attrib, attrib->unmap_granularity = q->limits.discard_granularity / block_size; attrib->unmap_granularity_alignment = q->limits.discard_alignment / block_size; - attrib->unmap_zeroes_data =0 ; + attrib->unmap_zeroes_data = (q->limits.max_write_zeroes_sectors);return true; }EXPORT_SYMBOL (target_configure_unmap_from_queue);
drivers/target/target_core_iblock.c +27 -17
76 lines not on this page · raw message
Signature · 1 line
1.9.1
Nicholas,
Quoted 4 lines
The people who are actively using
iblock_execute_write_same_direct()are doing so in the context of ESX VAAI BlockZero, together withEXTENDED_COPYandCOMPARE_AND_WRITEprimitives.
Quoted 8 lines
In practice though I've not seen any users of IBLOCK
WRITE_SAMEfor anything other than VAAI BlockZero, so just usingblkdev_issue_zeroout()when available, and falling back toiblock_execute_write_same()if theWRITE_SAMEbuffer contains anything other than zeros should be OK.(Hook up
max_write_zeroes_sectorsto signal LBPRZ feature bit in
target_configure_unmap_from_queue- nab)
Looks reasonable.
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering