Commit 86f8a1b4b472e4b2b58df5826709d4797d84d46f

Authored by Christof Schmitt
Committed by James Bottomley
1 parent a5b11dda12

[SCSI] zfcp: Remove UNIT_REGISTERED status flag

Use the device pointer in zfcp_unit for tracking if we have a
registered SCSI device. With this approach, the flag
ZFCP_STATUS_UNIT_REGISTERED is only redundant and can be removed.

Acked-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>

Showing 4 changed files with 2 additions and 8 deletions Side-by-side Diff

drivers/s390/scsi/zfcp_ccw.c
... ... @@ -72,8 +72,7 @@
72 72  
73 73 list_for_each_entry_safe(port, p, &port_remove_lh, list) {
74 74 list_for_each_entry_safe(unit, u, &unit_remove_lh, list) {
75   - if (atomic_read(&unit->status) &
76   - ZFCP_STATUS_UNIT_REGISTERED)
  75 + if (unit->device)
77 76 scsi_remove_device(unit->device);
78 77 zfcp_unit_dequeue(unit);
79 78 }
drivers/s390/scsi/zfcp_def.h
... ... @@ -255,7 +255,6 @@
255 255 /* logical unit status */
256 256 #define ZFCP_STATUS_UNIT_SHARED 0x00000004
257 257 #define ZFCP_STATUS_UNIT_READONLY 0x00000008
258   -#define ZFCP_STATUS_UNIT_REGISTERED 0x00000010
259 258 #define ZFCP_STATUS_UNIT_SCSI_WORK_PENDING 0x00000020
260 259  
261 260 /* FSF request status (this does not have a common part) */
drivers/s390/scsi/zfcp_erp.c
... ... @@ -1250,8 +1250,6 @@
1250 1250 case ZFCP_ERP_ACTION_REOPEN_UNIT:
1251 1251 if ((result == ZFCP_ERP_SUCCEEDED) &&
1252 1252 !unit->device && port->rport) {
1253   - atomic_set_mask(ZFCP_STATUS_UNIT_REGISTERED,
1254   - &unit->status);
1255 1253 if (!(atomic_read(&unit->status) &
1256 1254 ZFCP_STATUS_UNIT_SCSI_WORK_PENDING))
1257 1255 zfcp_erp_schedule_work(unit);
drivers/s390/scsi/zfcp_scsi.c
... ... @@ -27,7 +27,6 @@
27 27 static void zfcp_scsi_slave_destroy(struct scsi_device *sdpnt)
28 28 {
29 29 struct zfcp_unit *unit = (struct zfcp_unit *) sdpnt->hostdata;
30   - atomic_clear_mask(ZFCP_STATUS_UNIT_REGISTERED, &unit->status);
31 30 unit->device = NULL;
32 31 zfcp_erp_unit_failed(unit, 12, NULL);
33 32 zfcp_unit_put(unit);
... ... @@ -133,8 +132,7 @@
133 132  
134 133 read_lock_irqsave(&zfcp_data.config_lock, flags);
135 134 unit = zfcp_unit_lookup(adapter, sdp->channel, sdp->id, sdp->lun);
136   - if (unit &&
137   - (atomic_read(&unit->status) & ZFCP_STATUS_UNIT_REGISTERED)) {
  135 + if (unit) {
138 136 sdp->hostdata = unit;
139 137 unit->device = sdp;
140 138 zfcp_unit_get(unit);