summaryrefslogtreecommitdiffstats
path: root/include/target
diff options
context:
space:
mode:
authorSagi Grimberg <sagig@mellanox.com>2015-04-19 19:27:19 +0200
committerNicholas Bellinger <nab@linux-iscsi.org>2015-05-31 07:41:41 +0200
commitf75b6fae1a1d0a79dcbb9cbaed1d06bf3fe57a3c (patch)
treeb255e230aa10d9ad6a5e6d9944d7f82eb78bf662 /include/target
parentiser-target: Fix error path in isert_create_pi_ctx() (diff)
downloadlinux-f75b6fae1a1d0a79dcbb9cbaed1d06bf3fe57a3c.tar.xz
linux-f75b6fae1a1d0a79dcbb9cbaed1d06bf3fe57a3c.zip
target: Merge sbc_verify_dif_read|write
Instead of providing DIF verify routines for read/write that are almost identical and conditionally copy protection information, just let the caller do the right thing. Have a single sbc_dif_verify that handles an sgl (that does NOT copy any data) and a protection information copy routine used by rd_mcp and fileio backend. In the WRITE case, call sbc_dif_verify with cmd->t_prot_sg and then do the copy from it to local sgl (assuming the verify succeeded of course). In the READ case, call sbc_dif_verify with the local sgl and if it succeeds, copy it to t_prot_sg (or not if we are stripping it). (Fix apply breakage from commit c836777 - nab) Tested-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Sagi Grimberg <sagig@mellanox.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'include/target')
-rw-r--r--include/target/target_core_backend.h8
1 files changed, 3 insertions, 5 deletions
diff --git a/include/target/target_core_backend.h b/include/target/target_core_backend.h
index 5f1225706993..47fafec556f8 100644
--- a/include/target/target_core_backend.h
+++ b/include/target/target_core_backend.h
@@ -84,12 +84,10 @@ sense_reason_t sbc_execute_unmap(struct se_cmd *cmd,
sector_t lba, sector_t nolb),
void *priv);
void sbc_dif_generate(struct se_cmd *);
-sense_reason_t sbc_dif_verify_write(struct se_cmd *, sector_t, unsigned int,
+sense_reason_t sbc_dif_verify(struct se_cmd *, sector_t, unsigned int,
unsigned int, struct scatterlist *, int);
-sense_reason_t sbc_dif_verify_read(struct se_cmd *, sector_t, unsigned int,
- unsigned int, struct scatterlist *, int);
-sense_reason_t sbc_dif_read_strip(struct se_cmd *);
-
+void sbc_dif_copy_prot(struct se_cmd *, unsigned int, bool,
+ struct scatterlist *, int);
void transport_set_vpd_proto_id(struct t10_vpd *, unsigned char *);
int transport_set_vpd_assoc(struct t10_vpd *, unsigned char *);
int transport_set_vpd_ident_type(struct t10_vpd *, unsigned char *);