Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 156300
b: refs/heads/master
c: 85600f7
h: refs/heads/master
v: v3
  • Loading branch information
Christof Schmitt authored and James Bottomley committed Jul 30, 2009
1 parent 6ff8b8d commit 978809a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 27 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: ddb3e0c111fed0a8bf74884dc918274acec2b618
refs/heads/master: 85600f7f8370fe5b4be0debd8b401de7986b52ae
50 changes: 24 additions & 26 deletions trunk/drivers/s390/scsi/zfcp_erp.c
Original file line number Diff line number Diff line change
Expand Up @@ -553,40 +553,35 @@ static void _zfcp_erp_unit_reopen_all(struct zfcp_port *port, int clear,
_zfcp_erp_unit_reopen(unit, clear, id, ref);
}

static void zfcp_erp_strategy_followup_actions(struct zfcp_erp_action *act)
static void zfcp_erp_strategy_followup_failed(struct zfcp_erp_action *act)
{
struct zfcp_adapter *adapter = act->adapter;
struct zfcp_port *port = act->port;
struct zfcp_unit *unit = act->unit;
u32 status = act->status;

/* initiate follow-up actions depending on success of finished action */
switch (act->action) {

case ZFCP_ERP_ACTION_REOPEN_ADAPTER:
if (status == ZFCP_ERP_SUCCEEDED)
_zfcp_erp_port_reopen_all(adapter, 0, "ersfa_1", NULL);
else
_zfcp_erp_adapter_reopen(adapter, 0, "ersfa_2", NULL);
_zfcp_erp_adapter_reopen(act->adapter, 0, "ersff_1", NULL);
break;

case ZFCP_ERP_ACTION_REOPEN_PORT_FORCED:
if (status == ZFCP_ERP_SUCCEEDED)
_zfcp_erp_port_reopen(port, 0, "ersfa_3", NULL);
else
_zfcp_erp_adapter_reopen(adapter, 0, "ersfa_4", NULL);
_zfcp_erp_port_forced_reopen(act->port, 0, "ersff_2", NULL);
break;

case ZFCP_ERP_ACTION_REOPEN_PORT:
if (status == ZFCP_ERP_SUCCEEDED)
_zfcp_erp_unit_reopen_all(port, 0, "ersfa_5", NULL);
else
_zfcp_erp_port_forced_reopen(port, 0, "ersfa_6", NULL);
_zfcp_erp_port_reopen(act->port, 0, "ersff_3", NULL);
break;

case ZFCP_ERP_ACTION_REOPEN_UNIT:
if (status != ZFCP_ERP_SUCCEEDED)
_zfcp_erp_port_reopen(unit->port, 0, "ersfa_7", NULL);
_zfcp_erp_unit_reopen(act->unit, 0, "ersff_4", NULL);
break;
}
}

static void zfcp_erp_strategy_followup_success(struct zfcp_erp_action *act)
{
switch (act->action) {
case ZFCP_ERP_ACTION_REOPEN_ADAPTER:
_zfcp_erp_port_reopen_all(act->adapter, 0, "ersfs_1", NULL);
break;
case ZFCP_ERP_ACTION_REOPEN_PORT_FORCED:
_zfcp_erp_port_reopen(act->port, 0, "ersfs_2", NULL);
break;
case ZFCP_ERP_ACTION_REOPEN_PORT:
_zfcp_erp_unit_reopen_all(act->port, 0, "ersfs_3", NULL);
break;
}
}
Expand Down Expand Up @@ -1289,7 +1284,10 @@ static int zfcp_erp_strategy(struct zfcp_erp_action *erp_action)
retval = zfcp_erp_strategy_statechange(erp_action, retval);
if (retval == ZFCP_ERP_EXIT)
goto unlock;
zfcp_erp_strategy_followup_actions(erp_action);
if (retval == ZFCP_ERP_SUCCEEDED)
zfcp_erp_strategy_followup_success(erp_action);
if (retval == ZFCP_ERP_FAILED)
zfcp_erp_strategy_followup_failed(erp_action);

unlock:
write_unlock(&adapter->erp_lock);
Expand Down

0 comments on commit 978809a

Please sign in to comment.