Commit b98478d7 authored by Christof Schmitt's avatar Christof Schmitt Committed by James Bottomley

[SCSI] zfcp: remove DID_DID flag

The port flag DID_DID indicates whether we know the current id of the
port. This is always set in parallel. Since the id 0 is invalid
(because the port id 0 is invalid) we can remove the DID_DID flag:
d_id of 0 indicates an invalid d_id != 0 is a valid one.
Signed-off-by: default avatarChristof Schmitt <christof.schmitt@de.ibm.com>
Acked-by: default avatarFelix Beck <felix@linux.vnet.ibm.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
parent e0d7fcb5
...@@ -244,7 +244,6 @@ struct zfcp_ls_adisc { ...@@ -244,7 +244,6 @@ struct zfcp_ls_adisc {
/* remote port status */ /* remote port status */
#define ZFCP_STATUS_PORT_PHYS_OPEN 0x00000001 #define ZFCP_STATUS_PORT_PHYS_OPEN 0x00000001
#define ZFCP_STATUS_PORT_DID_DID 0x00000002
#define ZFCP_STATUS_PORT_PHYS_CLOSING 0x00000004 #define ZFCP_STATUS_PORT_PHYS_CLOSING 0x00000004
#define ZFCP_STATUS_PORT_NO_WWPN 0x00000008 #define ZFCP_STATUS_PORT_NO_WWPN 0x00000008
#define ZFCP_STATUS_PORT_INVALID_WWPN 0x00000020 #define ZFCP_STATUS_PORT_INVALID_WWPN 0x00000020
......
...@@ -840,7 +840,6 @@ static int zfcp_erp_open_ptp_port(struct zfcp_erp_action *act) ...@@ -840,7 +840,6 @@ static int zfcp_erp_open_ptp_port(struct zfcp_erp_action *act)
return ZFCP_ERP_FAILED; return ZFCP_ERP_FAILED;
} }
port->d_id = adapter->peer_d_id; port->d_id = adapter->peer_d_id;
atomic_set_mask(ZFCP_STATUS_PORT_DID_DID, &port->status);
return zfcp_erp_port_strategy_open_port(act); return zfcp_erp_port_strategy_open_port(act);
} }
...@@ -871,12 +870,12 @@ static int zfcp_erp_port_strategy_open_common(struct zfcp_erp_action *act) ...@@ -871,12 +870,12 @@ static int zfcp_erp_port_strategy_open_common(struct zfcp_erp_action *act)
case ZFCP_ERP_STEP_PORT_CLOSING: case ZFCP_ERP_STEP_PORT_CLOSING:
if (fc_host_port_type(adapter->scsi_host) == FC_PORTTYPE_PTP) if (fc_host_port_type(adapter->scsi_host) == FC_PORTTYPE_PTP)
return zfcp_erp_open_ptp_port(act); return zfcp_erp_open_ptp_port(act);
if (!(p_status & ZFCP_STATUS_PORT_DID_DID)) { if (!port->d_id) {
queue_work(zfcp_data.work_queue, &port->gid_pn_work); queue_work(zfcp_data.work_queue, &port->gid_pn_work);
return ZFCP_ERP_CONTINUES; return ZFCP_ERP_CONTINUES;
} }
case ZFCP_ERP_STEP_NAMESERVER_LOOKUP: case ZFCP_ERP_STEP_NAMESERVER_LOOKUP:
if (!(p_status & ZFCP_STATUS_PORT_DID_DID)) { if (!port->d_id) {
if (p_status & (ZFCP_STATUS_PORT_INVALID_WWPN)) { if (p_status & (ZFCP_STATUS_PORT_INVALID_WWPN)) {
zfcp_erp_port_failed(port, 26, NULL); zfcp_erp_port_failed(port, 26, NULL);
return ZFCP_ERP_EXIT; return ZFCP_ERP_EXIT;
...@@ -888,7 +887,7 @@ static int zfcp_erp_port_strategy_open_common(struct zfcp_erp_action *act) ...@@ -888,7 +887,7 @@ static int zfcp_erp_port_strategy_open_common(struct zfcp_erp_action *act)
case ZFCP_ERP_STEP_PORT_OPENING: case ZFCP_ERP_STEP_PORT_OPENING:
/* D_ID might have changed during open */ /* D_ID might have changed during open */
if (p_status & ZFCP_STATUS_COMMON_OPEN) { if (p_status & ZFCP_STATUS_COMMON_OPEN) {
if (p_status & ZFCP_STATUS_PORT_DID_DID) if (port->d_id)
return ZFCP_ERP_SUCCEEDED; return ZFCP_ERP_SUCCEEDED;
else { else {
act->step = ZFCP_ERP_STEP_PORT_CLOSING; act->step = ZFCP_ERP_STEP_PORT_CLOSING;
......
...@@ -265,7 +265,6 @@ static void zfcp_fc_ns_gid_pn_eval(unsigned long data) ...@@ -265,7 +265,6 @@ static void zfcp_fc_ns_gid_pn_eval(unsigned long data)
return; return;
/* looks like a valid d_id */ /* looks like a valid d_id */
port->d_id = ct_iu_resp->d_id & ZFCP_DID_MASK; port->d_id = ct_iu_resp->d_id & ZFCP_DID_MASK;
atomic_set_mask(ZFCP_STATUS_PORT_DID_DID, &port->status);
} }
int static zfcp_fc_ns_gid_pn_request(struct zfcp_erp_action *erp_action, int static zfcp_fc_ns_gid_pn_request(struct zfcp_erp_action *erp_action,
...@@ -588,7 +587,6 @@ static int zfcp_scan_eval_gpn_ft(struct zfcp_gpn_ft *gpn_ft) ...@@ -588,7 +587,6 @@ static int zfcp_scan_eval_gpn_ft(struct zfcp_gpn_ft *gpn_ft)
} }
port = zfcp_port_enqueue(adapter, acc->wwpn, port = zfcp_port_enqueue(adapter, acc->wwpn,
ZFCP_STATUS_PORT_DID_DID |
ZFCP_STATUS_COMMON_NOESC, d_id); ZFCP_STATUS_COMMON_NOESC, d_id);
if (IS_ERR(port)) if (IS_ERR(port))
ret = PTR_ERR(port); ret = PTR_ERR(port);
......
...@@ -1442,8 +1442,7 @@ static void zfcp_fsf_open_port_handler(struct zfcp_fsf_req *req) ...@@ -1442,8 +1442,7 @@ static void zfcp_fsf_open_port_handler(struct zfcp_fsf_req *req)
plogi = (struct fsf_plogi *) req->qtcb->bottom.support.els; plogi = (struct fsf_plogi *) req->qtcb->bottom.support.els;
if (req->qtcb->bottom.support.els1_length >= sizeof(*plogi)) { if (req->qtcb->bottom.support.els1_length >= sizeof(*plogi)) {
if (plogi->serv_param.wwpn != port->wwpn) if (plogi->serv_param.wwpn != port->wwpn)
atomic_clear_mask(ZFCP_STATUS_PORT_DID_DID, port->d_id = 0;
&port->status);
else { else {
port->wwnn = plogi->serv_param.wwnn; port->wwnn = plogi->serv_param.wwnn;
zfcp_fc_plogi_evaluate(port, plogi); zfcp_fc_plogi_evaluate(port, plogi);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment