[SCSI] zfcp: Remove UNIT_REGISTERED status flag
authorChristof Schmitt <christof.schmitt@de.ibm.com>
Mon, 2 Mar 2009 12:08:55 +0000 (13:08 +0100)
committerJames Bottomley <James.Bottomley@HansenPartnership.com>
Thu, 12 Mar 2009 17:58:18 +0000 (12:58 -0500)
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>
drivers/s390/scsi/zfcp_ccw.c
drivers/s390/scsi/zfcp_def.h
drivers/s390/scsi/zfcp_erp.c
drivers/s390/scsi/zfcp_scsi.c

index 285881f076485bb47b6641a2d91c57f335a59f19..683ac4ed5e566bd808f2521da8bf8f2552de427d 100644 (file)
@@ -72,8 +72,7 @@ static void zfcp_ccw_remove(struct ccw_device *ccw_device)
 
        list_for_each_entry_safe(port, p, &port_remove_lh, list) {
                list_for_each_entry_safe(unit, u, &unit_remove_lh, list) {
-                       if (atomic_read(&unit->status) &
-                           ZFCP_STATUS_UNIT_REGISTERED)
+                       if (unit->device)
                                scsi_remove_device(unit->device);
                        zfcp_unit_dequeue(unit);
                }
index 62f9ee58c9b8925207a6b2a48e87d4a6aa9a5268..56302a1a4b682795b38936e81c496849aace21e5 100644 (file)
@@ -255,7 +255,6 @@ enum zfcp_wka_status {
 /* logical unit status */
 #define ZFCP_STATUS_UNIT_SHARED                        0x00000004
 #define ZFCP_STATUS_UNIT_READONLY              0x00000008
-#define ZFCP_STATUS_UNIT_REGISTERED            0x00000010
 #define ZFCP_STATUS_UNIT_SCSI_WORK_PENDING     0x00000020
 
 /* FSF request status (this does not have a common part) */
index aed08e70aa96c298090a3cda9ac4ca4ded34519d..2a00f812779aff1c3f8b60be8f6d7718b95e420d 100644 (file)
@@ -1250,8 +1250,6 @@ static void zfcp_erp_action_cleanup(struct zfcp_erp_action *act, int result)
        case ZFCP_ERP_ACTION_REOPEN_UNIT:
                if ((result == ZFCP_ERP_SUCCEEDED) &&
                    !unit->device && port->rport) {
-                       atomic_set_mask(ZFCP_STATUS_UNIT_REGISTERED,
-                                       &unit->status);
                        if (!(atomic_read(&unit->status) &
                              ZFCP_STATUS_UNIT_SCSI_WORK_PENDING))
                                zfcp_erp_schedule_work(unit);
index 9dc42a68fbdd5194fa2ab62d978ab73f81b2cde0..7829c72d83d0854d6760e5e68415751bec46485f 100644 (file)
@@ -27,7 +27,6 @@ char *zfcp_get_fcp_sns_info_ptr(struct fcp_rsp_iu *fcp_rsp_iu)
 static void zfcp_scsi_slave_destroy(struct scsi_device *sdpnt)
 {
        struct zfcp_unit *unit = (struct zfcp_unit *) sdpnt->hostdata;
-       atomic_clear_mask(ZFCP_STATUS_UNIT_REGISTERED, &unit->status);
        unit->device = NULL;
        zfcp_erp_unit_failed(unit, 12, NULL);
        zfcp_unit_put(unit);
@@ -133,8 +132,7 @@ static int zfcp_scsi_slave_alloc(struct scsi_device *sdp)
 
        read_lock_irqsave(&zfcp_data.config_lock, flags);
        unit = zfcp_unit_lookup(adapter, sdp->channel, sdp->id, sdp->lun);
-       if (unit &&
-           (atomic_read(&unit->status) & ZFCP_STATUS_UNIT_REGISTERED)) {
+       if (unit) {
                sdp->hostdata = unit;
                unit->device = sdp;
                zfcp_unit_get(unit);