target/sbc: Add DIF setup in sbc_check_prot + sbc_parse_cdb
authorNicholas Bellinger <nab@linux-iscsi.org>
Mon, 23 Dec 2013 20:30:03 +0000 (20:30 +0000)
committerNicholas Bellinger <nab@linux-iscsi.org>
Sat, 18 Jan 2014 09:53:11 +0000 (09:53 +0000)
commit499bf77b0169605a23c38351e3849066fe696877
treefbe3e65676dd452c29bf1ac82ba97479579a5a32
parentfcc4f17b9ce931c93ce08f8cf27d6bd010f0b1ef
target/sbc: Add DIF setup in sbc_check_prot + sbc_parse_cdb

This patch adds sbc_check_prot() for performing various DIF
related CDB sanity checks, along with setting cmd->prot_type
once sanity checks have passed.

Also, add calls in sbc_parse_cdb() for READ_[10,12,16] +
WRITE_[10,12,16] to perform DIF sanity checking.

v2 changes:
  - Make sbc_check_prot defined as static (Fengguang + Wei)
  - Remove unprotected READ/WRITE warning (mkp)
  - Populate cmd->prot_type + friends (Sagi)
  - Drop SCF_PROT usage

Cc: Martin K. Petersen <martin.petersen@oracle.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Hannes Reinecke <hare@suse.de>
Cc: Sagi Grimberg <sagig@mellanox.com>
Cc: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/target_core_sbc.c