aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/target/target_core_device.c
diff options
context:
space:
mode:
authorNicholas Bellinger <nab@daterainc.com>2013-08-22 17:17:20 -0400
committerNicholas Bellinger <nab@linux-iscsi.org>2013-09-10 19:48:46 -0400
commitd397a445f43c7ae9b35260f236a08d5b5760de3d (patch)
tree9bc760fc767b73a5a20cba6e4ddd0154aa7003a6 /drivers/target/target_core_device.c
parent04b1b7954649767f2ab9bf08cf2457e21d5c7167 (diff)
target: Add Third Party Copy (3PC) bit in INQUIRY response
This patch adds the Third Party Copy (3PC) bit to signal support for EXTENDED_COPY within standard inquiry response data. Also add emulate_3pc device attribute in configfs (enabled by default) to allow the exposure of this bit to be disabled, if necessary. Cc: Christoph Hellwig <hch@lst.de> Cc: Hannes Reinecke <hare@suse.de> Cc: Martin Petersen <martin.petersen@oracle.com> Cc: Chris Mason <chris.mason@fusionio.com> Cc: Roland Dreier <roland@purestorage.com> Cc: Zach Brown <zab@redhat.com> Cc: James Bottomley <JBottomley@Parallels.com> Cc: Nicholas Bellinger <nab@linux-iscsi.org> Signed-off-by: Nicholas Bellinger <nab@daterainc.com>
Diffstat (limited to 'drivers/target/target_core_device.c')
-rw-r--r--drivers/target/target_core_device.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c
index b2b081236abb..f9f17934f956 100644
--- a/drivers/target/target_core_device.c
+++ b/drivers/target/target_core_device.c
@@ -906,6 +906,19 @@ int se_dev_set_emulate_caw(struct se_device *dev, int flag)
906 return 0; 906 return 0;
907} 907}
908 908
909int se_dev_set_emulate_3pc(struct se_device *dev, int flag)
910{
911 if (flag != 0 && flag != 1) {
912 pr_err("Illegal value %d\n", flag);
913 return -EINVAL;
914 }
915 dev->dev_attrib.emulate_3pc = flag;
916 pr_debug("dev[%p]: SE Device 3rd Party Copy (EXTENDED_COPY): %d\n",
917 dev, flag);
918
919 return 0;
920}
921
909int se_dev_set_enforce_pr_isids(struct se_device *dev, int flag) 922int se_dev_set_enforce_pr_isids(struct se_device *dev, int flag)
910{ 923{
911 if ((flag != 0) && (flag != 1)) { 924 if ((flag != 0) && (flag != 1)) {
@@ -1442,6 +1455,7 @@ struct se_device *target_alloc_device(struct se_hba *hba, const char *name)
1442 dev->dev_attrib.emulate_tpu = DA_EMULATE_TPU; 1455 dev->dev_attrib.emulate_tpu = DA_EMULATE_TPU;
1443 dev->dev_attrib.emulate_tpws = DA_EMULATE_TPWS; 1456 dev->dev_attrib.emulate_tpws = DA_EMULATE_TPWS;
1444 dev->dev_attrib.emulate_caw = DA_EMULATE_CAW; 1457 dev->dev_attrib.emulate_caw = DA_EMULATE_CAW;
1458 dev->dev_attrib.emulate_3pc = DA_EMULATE_3PC;
1445 dev->dev_attrib.enforce_pr_isids = DA_ENFORCE_PR_ISIDS; 1459 dev->dev_attrib.enforce_pr_isids = DA_ENFORCE_PR_ISIDS;
1446 dev->dev_attrib.is_nonrot = DA_IS_NONROT; 1460 dev->dev_attrib.is_nonrot = DA_IS_NONROT;
1447 dev->dev_attrib.emulate_rest_reord = DA_EMULATE_REST_REORD; 1461 dev->dev_attrib.emulate_rest_reord = DA_EMULATE_REST_REORD;