aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/target
diff options
context:
space:
mode:
authorNicholas Bellinger <nab@linux-iscsi.org>2012-08-26 16:35:58 -0400
committerNicholas Bellinger <nab@linux-iscsi.org>2012-09-17 20:13:34 -0400
commitfd30e9310253235e88a4eaa38fa92439b56c220e (patch)
treeeaa3c34f2c0baf84a407c92ff9d1f05b273e74fb /drivers/target
parent93d441a888c4aefd9f37b30911f8fefa27bdfda3 (diff)
target: Drop se_subsystem_api->[write_cache,fua_write]_emulated flags
This patch drops se_subsystem_api->[write_cache,fua_write]_emulated flags set by viritual FILEIO/IBLOCK/RD_MCP backend drivers in favor of explict TRANSPORT_PLUGIN_PHBA_PDEV checks to know when to fail if userspace is attempting to set virtual emulation bits for an pSCSI (passthrough) backend device. Reported-by: Christoph Hellwig <hch@lst.de> Cc: Christoph Hellwig <hch@lst.de> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target')
-rw-r--r--drivers/target/target_core_device.c10
-rw-r--r--drivers/target/target_core_file.c2
-rw-r--r--drivers/target/target_core_iblock.c2
-rw-r--r--drivers/target/target_core_rd.c1
4 files changed, 6 insertions, 9 deletions
diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c
index 2d0353355ebd..8d774da16320 100644
--- a/drivers/target/target_core_device.c
+++ b/drivers/target/target_core_device.c
@@ -988,8 +988,9 @@ int se_dev_set_emulate_fua_write(struct se_device *dev, int flag)
988 return -EINVAL; 988 return -EINVAL;
989 } 989 }
990 990
991 if (flag && dev->transport->fua_write_emulated == 0) { 991 if (flag &&
992 pr_err("fua_write_emulated not supported\n"); 992 dev->transport->transport_type == TRANSPORT_PLUGIN_PHBA_PDEV) {
993 pr_err("emulate_fua_write not supported for pSCSI\n");
993 return -EINVAL; 994 return -EINVAL;
994 } 995 }
995 dev->se_sub_dev->se_dev_attrib.emulate_fua_write = flag; 996 dev->se_sub_dev->se_dev_attrib.emulate_fua_write = flag;
@@ -1019,8 +1020,9 @@ int se_dev_set_emulate_write_cache(struct se_device *dev, int flag)
1019 pr_err("Illegal value %d\n", flag); 1020 pr_err("Illegal value %d\n", flag);
1020 return -EINVAL; 1021 return -EINVAL;
1021 } 1022 }
1022 if (flag && dev->transport->write_cache_emulated == 0) { 1023 if (flag &&
1023 pr_err("write_cache_emulated not supported\n"); 1024 dev->transport->transport_type == TRANSPORT_PLUGIN_PHBA_PDEV) {
1025 pr_err("emulate_write_cache not supported for pSCSI\n");
1024 return -EINVAL; 1026 return -EINVAL;
1025 } 1027 }
1026 dev->se_sub_dev->se_dev_attrib.emulate_write_cache = flag; 1028 dev->se_sub_dev->se_dev_attrib.emulate_write_cache = flag;
diff --git a/drivers/target/target_core_file.c b/drivers/target/target_core_file.c
index cbb5aaf3e567..11119257e514 100644
--- a/drivers/target/target_core_file.c
+++ b/drivers/target/target_core_file.c
@@ -546,8 +546,6 @@ static struct se_subsystem_api fileio_template = {
546 .name = "fileio", 546 .name = "fileio",
547 .owner = THIS_MODULE, 547 .owner = THIS_MODULE,
548 .transport_type = TRANSPORT_PLUGIN_VHBA_PDEV, 548 .transport_type = TRANSPORT_PLUGIN_VHBA_PDEV,
549 .write_cache_emulated = 1,
550 .fua_write_emulated = 1,
551 .attach_hba = fd_attach_hba, 549 .attach_hba = fd_attach_hba,
552 .detach_hba = fd_detach_hba, 550 .detach_hba = fd_detach_hba,
553 .allocate_virtdevice = fd_allocate_virtdevice, 551 .allocate_virtdevice = fd_allocate_virtdevice,
diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c
index 0f6ece80bffe..5b745bb56a68 100644
--- a/drivers/target/target_core_iblock.c
+++ b/drivers/target/target_core_iblock.c
@@ -766,8 +766,6 @@ static struct se_subsystem_api iblock_template = {
766 .name = "iblock", 766 .name = "iblock",
767 .owner = THIS_MODULE, 767 .owner = THIS_MODULE,
768 .transport_type = TRANSPORT_PLUGIN_VHBA_PDEV, 768 .transport_type = TRANSPORT_PLUGIN_VHBA_PDEV,
769 .write_cache_emulated = 1,
770 .fua_write_emulated = 1,
771 .attach_hba = iblock_attach_hba, 769 .attach_hba = iblock_attach_hba,
772 .detach_hba = iblock_detach_hba, 770 .detach_hba = iblock_detach_hba,
773 .allocate_virtdevice = iblock_allocate_virtdevice, 771 .allocate_virtdevice = iblock_allocate_virtdevice,
diff --git a/drivers/target/target_core_rd.c b/drivers/target/target_core_rd.c
index 58bcc870366f..d00bbe33ff8b 100644
--- a/drivers/target/target_core_rd.c
+++ b/drivers/target/target_core_rd.c
@@ -474,7 +474,6 @@ static int rd_parse_cdb(struct se_cmd *cmd)
474static struct se_subsystem_api rd_mcp_template = { 474static struct se_subsystem_api rd_mcp_template = {
475 .name = "rd_mcp", 475 .name = "rd_mcp",
476 .transport_type = TRANSPORT_PLUGIN_VHBA_VDEV, 476 .transport_type = TRANSPORT_PLUGIN_VHBA_VDEV,
477 .write_cache_emulated = 1,
478 .attach_hba = rd_attach_hba, 477 .attach_hba = rd_attach_hba,
479 .detach_hba = rd_detach_hba, 478 .detach_hba = rd_detach_hba,
480 .allocate_virtdevice = rd_allocate_virtdevice, 479 .allocate_virtdevice = rd_allocate_virtdevice,