From 0fd97ccf45be26fb01b3a412f1f6c6b5044b2f16 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Mon, 8 Oct 2012 00:03:19 -0400 Subject: target: kill struct se_subsystem_dev Simplify the code a lot by killing the superflous struct se_subsystem_dev. Instead se_device is allocated early on by the backend driver, which allocates it as part of its own per-device structure, borrowing the scheme that is for example used for inode allocation. Signed-off-by: Christoph Hellwig Signed-off-by: Nicholas Bellinger --- drivers/target/target_core_fabric_configfs.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'drivers/target/target_core_fabric_configfs.c') diff --git a/drivers/target/target_core_fabric_configfs.c b/drivers/target/target_core_fabric_configfs.c index bca737bb813d..aa6731337f84 100644 --- a/drivers/target/target_core_fabric_configfs.c +++ b/drivers/target/target_core_fabric_configfs.c @@ -734,14 +734,12 @@ static int target_fabric_port_link( struct config_item *se_dev_ci) { struct config_item *tpg_ci; - struct se_device *dev; struct se_lun *lun = container_of(to_config_group(lun_ci), struct se_lun, lun_group); struct se_lun *lun_p; struct se_portal_group *se_tpg; - struct se_subsystem_dev *se_dev = container_of( - to_config_group(se_dev_ci), struct se_subsystem_dev, - se_dev_group); + struct se_device *dev = + container_of(to_config_group(se_dev_ci), struct se_device, dev_group); struct target_fabric_configfs *tf; int ret; @@ -755,14 +753,6 @@ static int target_fabric_port_link( return -EEXIST; } - dev = se_dev->se_dev_ptr; - if (!dev) { - pr_err("Unable to locate struct se_device pointer from" - " %s\n", config_item_name(se_dev_ci)); - ret = -ENODEV; - goto out; - } - lun_p = core_dev_add_lun(se_tpg, dev, lun->unpacked_lun); if (IS_ERR(lun_p)) { pr_err("core_dev_add_lun() failed\n"); -- cgit v1.2.3