From 72c0385014a140b6029c5c8bf88efb9ad166ae48 Mon Sep 17 00:00:00 2001 From: Nicholas Bellinger Date: Sun, 8 Feb 2015 04:02:08 -0800 Subject: [PATCH] target: Add internal READ_INSERT support This patch adds READ_INSERT support in target_read_prot_action() that invokes sbc_dif_generate() when LIO is responsible for generating the outgoing T10-PI. Required for supporting fabrics that exchange protection information, and would like to function with un-protected devices. Reviewed-by: Martin Petersen Reviewed-by: Sagi Grimberg Cc: Christoph Hellwig Signed-off-by: Nicholas Bellinger --- drivers/target/target_core_transport.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index bfdd6237a3d1..b671ebbe1df6 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -1994,6 +1994,12 @@ static bool target_read_prot_action(struct se_cmd *cmd) } } break; + case TARGET_PROT_DIN_INSERT: + if (cmd->se_sess->sup_prot_ops & TARGET_PROT_DIN_INSERT) + break; + + sbc_dif_generate(cmd); + break; default: break; } -- 2.20.1