diff options
author | Nicholas Bellinger <nab@linux-iscsi.org> | 2012-11-15 14:02:49 -0500 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2012-11-15 15:27:21 -0500 |
commit | 773cbaf7460aa58c67d4dca83c3f8bca10323bbe (patch) | |
tree | 91e6015ade8d62c34c64861f1f3810b3c15a6a25 /include/target | |
parent | cd063bef414c51d79b9c6ea7a8ef8f9d319529bc (diff) |
target: Add/check max_write_same_len device attribute + update block limits VPD
This patch adds a new max_write_same_len device attribute for use with
WRITE_SAME w/ UNMAP=0 backend emulation. This can be useful for
lowering the default backend value (IBLOCK uses 0xFFFF).
Also, update block limits VPD emulation code in spc_emulate_evpd_b0() to
report MAXIMUM WRITE SAME LENGTH, and enforce max_write_same_len during
sbc_parse() -> sbc_setup_write_same() CDB sanity checking for all emulated
WRITE_SAME w/ UNMAP=0 cases.
(Robert: Move max_write_same_len check in sbc_setup_write_same() to
check both WRITE_SAME w/ UNMAP=1 and w/ UNMAP=0 cases)
Cc: Christoph Hellwig <hch@lst.de>
Cc: Martin K. Petersen <martin.petersen@oracle.com>
Cc: Robert Elliott <Elliott@hp.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'include/target')
-rw-r--r-- | include/target/target_core_base.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h index 5350f6e580f0..645d90ac6097 100644 --- a/include/target/target_core_base.h +++ b/include/target/target_core_base.h | |||
@@ -71,6 +71,8 @@ | |||
71 | #define DA_UNMAP_GRANULARITY_DEFAULT 0 | 71 | #define DA_UNMAP_GRANULARITY_DEFAULT 0 |
72 | /* Default unmap_granularity_alignment */ | 72 | /* Default unmap_granularity_alignment */ |
73 | #define DA_UNMAP_GRANULARITY_ALIGNMENT_DEFAULT 0 | 73 | #define DA_UNMAP_GRANULARITY_ALIGNMENT_DEFAULT 0 |
74 | /* Default max_write_same_len, disabled by default */ | ||
75 | #define DA_MAX_WRITE_SAME_LEN 0 | ||
74 | /* Default max transfer length */ | 76 | /* Default max transfer length */ |
75 | #define DA_FABRIC_MAX_SECTORS 8192 | 77 | #define DA_FABRIC_MAX_SECTORS 8192 |
76 | /* Emulation for Direct Page Out */ | 78 | /* Emulation for Direct Page Out */ |
@@ -609,6 +611,7 @@ struct se_dev_attrib { | |||
609 | u32 max_unmap_block_desc_count; | 611 | u32 max_unmap_block_desc_count; |
610 | u32 unmap_granularity; | 612 | u32 unmap_granularity; |
611 | u32 unmap_granularity_alignment; | 613 | u32 unmap_granularity_alignment; |
614 | u32 max_write_same_len; | ||
612 | struct se_device *da_dev; | 615 | struct se_device *da_dev; |
613 | struct config_group da_group; | 616 | struct config_group da_group; |
614 | }; | 617 | }; |