]> git.karo-electronics.de Git - karo-tx-linux.git/commit
target/iblock: Add WRITE_SAME w/ UNMAP=0 emulation support
authorNicholas Bellinger <nab@linux-iscsi.org>
Thu, 8 Nov 2012 04:08:38 +0000 (20:08 -0800)
committerNicholas Bellinger <nab@linux-iscsi.org>
Thu, 8 Nov 2012 18:40:45 +0000 (10:40 -0800)
commitda97b6615fcd215b9d78a5e540d90202e41a21b2
treea7724516472c9a2925b1d1072bfeeaab5e3f8407
parentecf3d1d5c89dd2b9d76e1a8a1890c8279685669b
target/iblock: Add WRITE_SAME w/ UNMAP=0 emulation support

This patch adds support for emulation of WRITE_SAME w/ UNMAP=0 within
iblock_execute_write_same() backend code.

The emulation uses a bio_add_page() call for each sector, and by default
enforces a limit of max_write_same_len=0xFFFF (65536) sectors following
what scsi_debug reports per default for MAXIMUM WRITE SAME LENGTH.

It also sets max_write_same_len to the operational default at setup ->
iblock_configure_device() time.

Cc: Christoph Hellwig <hch@lst.de>
Cc: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/target_core_iblock.c