Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 242685
b: refs/heads/master
c: 05aea6e
h: refs/heads/master
i:
  242683: 2636d58
v: v3
  • Loading branch information
Fubo Chen authored and James Bottomley committed Mar 23, 2011
1 parent 4107fa6 commit d51233b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 51 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 613640e4e1b5358ce880d16f10ecc2550b32b250
refs/heads/master: 05aea6e7e497ab418239ae54fe5966d52cbd8550
39 changes: 2 additions & 37 deletions trunk/drivers/target/target_core_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -779,49 +779,14 @@ void se_release_vpd_for_dev(struct se_device *dev)
return;
}

/*
* Called with struct se_hba->device_lock held.
*/
void se_clear_dev_ports(struct se_device *dev)
{
struct se_hba *hba = dev->se_hba;
struct se_lun *lun;
struct se_portal_group *tpg;
struct se_port *sep, *sep_tmp;

spin_lock(&dev->se_port_lock);
list_for_each_entry_safe(sep, sep_tmp, &dev->dev_sep_list, sep_list) {
spin_unlock(&dev->se_port_lock);
spin_unlock(&hba->device_lock);

lun = sep->sep_lun;
tpg = sep->sep_tpg;
spin_lock(&lun->lun_sep_lock);
if (lun->lun_se_dev == NULL) {
spin_unlock(&lun->lun_sep_lock);
continue;
}
spin_unlock(&lun->lun_sep_lock);

core_dev_del_lun(tpg, lun->unpacked_lun);

spin_lock(&hba->device_lock);
spin_lock(&dev->se_port_lock);
}
spin_unlock(&dev->se_port_lock);

return;
}

/* se_free_virtual_device():
*
* Used for IBLOCK, RAMDISK, and FILEIO Transport Drivers.
*/
int se_free_virtual_device(struct se_device *dev, struct se_hba *hba)
{
spin_lock(&hba->device_lock);
se_clear_dev_ports(dev);
spin_unlock(&hba->device_lock);
if (!list_empty(&dev->dev_sep_list))
dump_stack();

core_alua_free_lu_gp_mem(dev);
se_release_device_for_hba(dev);
Expand Down
15 changes: 2 additions & 13 deletions trunk/drivers/target/target_core_hba.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,19 +151,8 @@ core_alloc_hba(const char *plugin_name, u32 plugin_dep_id, u32 hba_flags)
int
core_delete_hba(struct se_hba *hba)
{
struct se_device *dev, *dev_tmp;

spin_lock(&hba->device_lock);
list_for_each_entry_safe(dev, dev_tmp, &hba->hba_dev_list, dev_list) {

se_clear_dev_ports(dev);
spin_unlock(&hba->device_lock);

se_release_device_for_hba(dev);

spin_lock(&hba->device_lock);
}
spin_unlock(&hba->device_lock);
if (!list_empty(&hba->hba_dev_list))
dump_stack();

hba->transport->detach_hba(hba);

Expand Down

0 comments on commit d51233b

Please sign in to comment.