summaryrefslogtreecommitdiff
path: root/drivers/target/target_core_device.c
diff options
context:
space:
mode:
authorNicholas Bellinger <nab@linux-iscsi.org>2012-08-26 13:35:58 -0700
committerNicholas Bellinger <nab@linux-iscsi.org>2012-09-17 17:13:34 -0700
commitfd30e9310253235e88a4eaa38fa92439b56c220e (patch)
treeeaa3c34f2c0baf84a407c92ff9d1f05b273e74fb /drivers/target/target_core_device.c
parent93d441a888c4aefd9f37b30911f8fefa27bdfda3 (diff)
downloadlinux-fd30e9310253235e88a4eaa38fa92439b56c220e.tar.gz
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/target_core_device.c')
-rw-r--r--drivers/target/target_core_device.c10
1 files changed, 6 insertions, 4 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)
return -EINVAL;
}
- if (flag && dev->transport->fua_write_emulated == 0) {
- pr_err("fua_write_emulated not supported\n");
+ if (flag &&
+ dev->transport->transport_type == TRANSPORT_PLUGIN_PHBA_PDEV) {
+ pr_err("emulate_fua_write not supported for pSCSI\n");
return -EINVAL;
}
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)
pr_err("Illegal value %d\n", flag);
return -EINVAL;
}
- if (flag && dev->transport->write_cache_emulated == 0) {
- pr_err("write_cache_emulated not supported\n");
+ if (flag &&
+ dev->transport->transport_type == TRANSPORT_PLUGIN_PHBA_PDEV) {
+ pr_err("emulate_write_cache not supported for pSCSI\n");
return -EINVAL;
}
dev->se_sub_dev->se_dev_attrib.emulate_write_cache = flag;