From c87fbd5656f263f0fc1c37d20f402797c068232e Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Wed, 10 Oct 2012 17:37:16 -0400 Subject: target: simplify alua support We always support ALUA for virtual backends, and never for physical ones. Simplify the code to just deal with these two cases and remove the superflous abstractions. Signed-off-by: Christoph Hellwig Signed-off-by: Nicholas Bellinger --- drivers/target/target_core_configfs.c | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) (limited to 'drivers/target/target_core_configfs.c') diff --git a/drivers/target/target_core_configfs.c b/drivers/target/target_core_configfs.c index 3d5570da41eb..7b473b66da7b 100644 --- a/drivers/target/target_core_configfs.c +++ b/drivers/target/target_core_configfs.c @@ -1615,15 +1615,9 @@ static ssize_t target_core_show_alua_lu_gp(void *p, char *page) struct t10_alua_lu_gp_member *lu_gp_mem; ssize_t len = 0; - if (dev->t10_alua.alua_type != SPC3_ALUA_EMULATED) - return len; - lu_gp_mem = dev->dev_alua_lu_gp_mem; - if (!lu_gp_mem) { - pr_err("NULL struct se_device->dev_alua_lu_gp_mem" - " pointer\n"); - return -EINVAL; - } + if (!lu_gp_mem) + return 0; spin_lock(&lu_gp_mem->lu_gp_mem_lock); lu_gp = lu_gp_mem->lu_gp; @@ -1649,12 +1643,10 @@ static ssize_t target_core_store_alua_lu_gp( unsigned char buf[LU_GROUP_NAME_BUF]; int move = 0; - if (dev->t10_alua.alua_type != SPC3_ALUA_EMULATED) { - pr_warn("SPC3_ALUA_EMULATED not enabled for %s/%s\n", - config_item_name(&hba->hba_group.cg_item), - config_item_name(&dev->dev_group.cg_item)); - return -EINVAL; - } + lu_gp_mem = dev->dev_alua_lu_gp_mem; + if (!lu_gp_mem) + return 0; + if (count > LU_GROUP_NAME_BUF) { pr_err("ALUA LU Group Alias too large!\n"); return -EINVAL; @@ -1675,14 +1667,6 @@ static ssize_t target_core_store_alua_lu_gp( if (!lu_gp_new) return -ENODEV; } - lu_gp_mem = dev->dev_alua_lu_gp_mem; - if (!lu_gp_mem) { - if (lu_gp_new) - core_alua_put_lu_gp_from_name(lu_gp_new); - pr_err("NULL struct se_device->dev_alua_lu_gp_mem" - " pointer\n"); - return -EINVAL; - } spin_lock(&lu_gp_mem->lu_gp_mem_lock); lu_gp = lu_gp_mem->lu_gp; -- cgit v1.2.3