diff options
author | Christof Schmitt <christof.schmitt@de.ibm.com> | 2010-09-08 08:39:55 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-09-16 22:54:17 -0400 |
commit | b62a8d9b45b971a67a0f8413338c230e3117dff5 (patch) | |
tree | a38acd9f0fcb14e41e26503d8a25d8f1539dd27d /drivers/s390/scsi/zfcp_unit.c | |
parent | fdbd1c5e27dabfa950d4b0f52a20069aeaf67b9d (diff) |
[SCSI] zfcp: Use SCSI device data zfcp_scsi_dev instead of zfcp_unit
This is the large change to switch from using the data in
zfcp_unit to zfcp_scsi_dev. Keeping everything working requires doing
the switch in one piece. To ensure that no code keeps using the data
in zfcp_unit, this patch also removes the data from zfcp_unit that is
now being replaced with zfcp_scsi_dev.
For zfcp, the scsi_device together with zfcp_scsi_dev exist from the
call of slave_alloc to the call of slave_destroy. The data in
zfcp_scsi_dev is initialized in zfcp_scsi_slave_alloc and the LUN is
opened; the final shutdown for the LUN is run from slave_destroy.
Where the scsi_device or zfcp_scsi_dev is needed, the pointer to the
scsi_device is passed as function argument and inside the function
converted to the pointer to zfcp_scsi_dev; this avoids back and forth
conversion betweeen scsi_device and zfcp_scsi_dev.
While changing the function arguments from zfcp_unit to scsi_device,
the functions names are renamed form "unit" to "lun". This is to have
a seperation between zfcp_scsi_dev/LUN and the zfcp_unit; only code
referring to the remaining configuration information in zfcp_unit
struct uses "unit".
Reviewed-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/s390/scsi/zfcp_unit.c')
-rw-r--r-- | drivers/s390/scsi/zfcp_unit.c | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/drivers/s390/scsi/zfcp_unit.c b/drivers/s390/scsi/zfcp_unit.c index e210c41ee389..1119c535a667 100644 --- a/drivers/s390/scsi/zfcp_unit.c +++ b/drivers/s390/scsi/zfcp_unit.c | |||
@@ -134,14 +134,7 @@ int zfcp_unit_add(struct zfcp_port *port, u64 fcp_lun) | |||
134 | unit->fcp_lun = fcp_lun; | 134 | unit->fcp_lun = fcp_lun; |
135 | unit->dev.parent = &port->dev; | 135 | unit->dev.parent = &port->dev; |
136 | unit->dev.release = zfcp_unit_release; | 136 | unit->dev.release = zfcp_unit_release; |
137 | unit->latencies.write.channel.min = 0xFFFFFFFF; | ||
138 | unit->latencies.write.fabric.min = 0xFFFFFFFF; | ||
139 | unit->latencies.read.channel.min = 0xFFFFFFFF; | ||
140 | unit->latencies.read.fabric.min = 0xFFFFFFFF; | ||
141 | unit->latencies.cmd.channel.min = 0xFFFFFFFF; | ||
142 | unit->latencies.cmd.fabric.min = 0xFFFFFFFF; | ||
143 | INIT_WORK(&unit->scsi_work, zfcp_unit_scsi_scan_work); | 137 | INIT_WORK(&unit->scsi_work, zfcp_unit_scsi_scan_work); |
144 | spin_lock_init(&unit->latencies.lock); | ||
145 | 138 | ||
146 | if (dev_set_name(&unit->dev, "0x%016llx", | 139 | if (dev_set_name(&unit->dev, "0x%016llx", |
147 | (unsigned long long) fcp_lun)) { | 140 | (unsigned long long) fcp_lun)) { |
@@ -165,9 +158,6 @@ int zfcp_unit_add(struct zfcp_port *port, u64 fcp_lun) | |||
165 | list_add_tail(&unit->list, &port->unit_list); | 158 | list_add_tail(&unit->list, &port->unit_list); |
166 | write_unlock_irq(&port->unit_list_lock); | 159 | write_unlock_irq(&port->unit_list_lock); |
167 | 160 | ||
168 | atomic_set_mask(ZFCP_STATUS_COMMON_RUNNING, &unit->status); | ||
169 | zfcp_erp_unit_reopen(unit, 0, "syuas_1", NULL); | ||
170 | zfcp_erp_wait(unit->port->adapter); | ||
171 | zfcp_unit_scsi_scan(unit); | 161 | zfcp_unit_scsi_scan(unit); |
172 | 162 | ||
173 | return 0; | 163 | return 0; |
@@ -248,7 +238,6 @@ int zfcp_unit_remove(struct zfcp_port *port, u64 fcp_lun) | |||
248 | 238 | ||
249 | put_device(&unit->dev); | 239 | put_device(&unit->dev); |
250 | 240 | ||
251 | zfcp_erp_unit_shutdown(unit, 0, "unrem_1", NULL); | ||
252 | zfcp_device_unregister(&unit->dev, &zfcp_sysfs_unit_attrs); | 241 | zfcp_device_unregister(&unit->dev, &zfcp_sysfs_unit_attrs); |
253 | 242 | ||
254 | return 0; | 243 | return 0; |