[11/23] target/sbc: Add LBPRZ attribute + control CDB emulation

Submitted by Andrei Vagin on March 27, 2018, 5:37 p.m.

Details

Message ID 1522172237-6960-12-git-send-email-avagin@openvz.org
State New
Series "target: backport bug fixes from the upstream kernel"
Headers show

Commit Message

Andrei Vagin March 27, 2018, 5:37 p.m.
From: Jamie Pocas <jamie.pocas@emc.com>

ML: e6f41633cb79b55ead84b023c02035322c7827e7

This change sets the LBPRZ flag in EVPD page b2h and READ CAPACITY (16)
based on a new unmap_zeroes_data device attribute. This flag is set
automatically for iblock based on underlying block device queue's
discard_zeroes_data flag.

Signed-off-by: Jamie Pocas <jamie.pocas@emc.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Andrei Vagin <avagin@openvz.org>
---
 drivers/target/target_core_iblock.c | 2 ++
 1 file changed, 2 insertions(+)

Patch hide | download patch | download mbox

diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c
index c68e255..02c5ab0a 100644
--- a/drivers/target/target_core_iblock.c
+++ b/drivers/target/target_core_iblock.c
@@ -144,6 +144,8 @@  static int iblock_configure_device(struct se_device *dev)
 				q->limits.discard_granularity >> 9;
 		dev->dev_attrib.unmap_granularity_alignment =
 				q->limits.discard_alignment;
+		dev->dev_attrib.unmap_zeroes_data =
+				q->limits.discard_zeroes_data;
 
 		pr_debug("IBLOCK: BLOCK Discard support available,"
 				" disabled by default\n");