Lines Matching refs:act

64 static int zfcp_erp_action_exists(struct zfcp_erp_action *act)  in zfcp_erp_action_exists()  argument
68 list_for_each_entry(curr_act, &act->adapter->erp_running_head, list) in zfcp_erp_action_exists()
69 if (act == curr_act) in zfcp_erp_action_exists()
74 static void zfcp_erp_action_ready(struct zfcp_erp_action *act) in zfcp_erp_action_ready() argument
76 struct zfcp_adapter *adapter = act->adapter; in zfcp_erp_action_ready()
78 list_move(&act->list, &act->adapter->erp_ready_head); in zfcp_erp_action_ready()
79 zfcp_dbf_rec_run("erardy1", act); in zfcp_erp_action_ready()
81 zfcp_dbf_rec_run("erardy2", act); in zfcp_erp_action_ready()
84 static void zfcp_erp_action_dismiss(struct zfcp_erp_action *act) in zfcp_erp_action_dismiss() argument
86 act->status |= ZFCP_STATUS_ERP_DISMISSED; in zfcp_erp_action_dismiss()
87 if (zfcp_erp_action_exists(act) == ZFCP_ERP_ACTION_RUNNING) in zfcp_erp_action_dismiss()
88 zfcp_erp_action_ready(act); in zfcp_erp_action_dismiss()
245 struct zfcp_erp_action *act; in zfcp_erp_action_enqueue() local
254 act = zfcp_erp_setup_act(need, act_status, adapter, port, sdev); in zfcp_erp_action_enqueue()
255 if (!act) in zfcp_erp_action_enqueue()
259 list_add_tail(&act->list, &adapter->erp_ready_head); in zfcp_erp_action_enqueue()
514 static void zfcp_erp_strategy_check_fsfreq(struct zfcp_erp_action *act) in zfcp_erp_strategy_check_fsfreq() argument
516 struct zfcp_adapter *adapter = act->adapter; in zfcp_erp_strategy_check_fsfreq()
519 if (!act->fsf_req_id) in zfcp_erp_strategy_check_fsfreq()
523 req = _zfcp_reqlist_find(adapter->req_list, act->fsf_req_id); in zfcp_erp_strategy_check_fsfreq()
524 if (req && req->erp_action == act) { in zfcp_erp_strategy_check_fsfreq()
525 if (act->status & (ZFCP_STATUS_ERP_DISMISSED | in zfcp_erp_strategy_check_fsfreq()
528 zfcp_dbf_rec_run("erscf_1", act); in zfcp_erp_strategy_check_fsfreq()
531 if (act->status & ZFCP_STATUS_ERP_TIMEDOUT) in zfcp_erp_strategy_check_fsfreq()
532 zfcp_dbf_rec_run("erscf_2", act); in zfcp_erp_strategy_check_fsfreq()
534 act->fsf_req_id = 0; in zfcp_erp_strategy_check_fsfreq()
536 act->fsf_req_id = 0; in zfcp_erp_strategy_check_fsfreq()
564 struct zfcp_erp_action *act = (struct zfcp_erp_action *) data; in zfcp_erp_timeout_handler() local
565 zfcp_erp_notify(act, ZFCP_STATUS_ERP_TIMEDOUT); in zfcp_erp_timeout_handler()
605 static void zfcp_erp_strategy_followup_failed(struct zfcp_erp_action *act) in zfcp_erp_strategy_followup_failed() argument
607 switch (act->action) { in zfcp_erp_strategy_followup_failed()
609 _zfcp_erp_adapter_reopen(act->adapter, 0, "ersff_1"); in zfcp_erp_strategy_followup_failed()
612 _zfcp_erp_port_forced_reopen(act->port, 0, "ersff_2"); in zfcp_erp_strategy_followup_failed()
615 _zfcp_erp_port_reopen(act->port, 0, "ersff_3"); in zfcp_erp_strategy_followup_failed()
618 _zfcp_erp_lun_reopen(act->sdev, 0, "ersff_4", 0); in zfcp_erp_strategy_followup_failed()
623 static void zfcp_erp_strategy_followup_success(struct zfcp_erp_action *act) in zfcp_erp_strategy_followup_success() argument
625 switch (act->action) { in zfcp_erp_strategy_followup_success()
627 _zfcp_erp_port_reopen_all(act->adapter, 0, "ersfs_1"); in zfcp_erp_strategy_followup_success()
630 _zfcp_erp_port_reopen(act->port, 0, "ersfs_2"); in zfcp_erp_strategy_followup_success()
633 _zfcp_erp_lun_reopen_all(act->port, 0, "ersfs_3"); in zfcp_erp_strategy_followup_success()
707 static int zfcp_erp_adapter_strategy_open_fsf_xport(struct zfcp_erp_action *act) in zfcp_erp_adapter_strategy_open_fsf_xport() argument
710 struct zfcp_adapter *adapter = act->adapter; in zfcp_erp_adapter_strategy_open_fsf_xport()
713 zfcp_erp_action_to_running(act); in zfcp_erp_adapter_strategy_open_fsf_xport()
716 ret = zfcp_fsf_exchange_port_data(act); in zfcp_erp_adapter_strategy_open_fsf_xport()
722 zfcp_dbf_rec_run("erasox1", act); in zfcp_erp_adapter_strategy_open_fsf_xport()
725 zfcp_dbf_rec_run("erasox2", act); in zfcp_erp_adapter_strategy_open_fsf_xport()
726 if (act->status & ZFCP_STATUS_ERP_TIMEDOUT) in zfcp_erp_adapter_strategy_open_fsf_xport()
732 static int zfcp_erp_adapter_strategy_open_fsf(struct zfcp_erp_action *act) in zfcp_erp_adapter_strategy_open_fsf() argument
734 if (zfcp_erp_adapter_strat_fsf_xconf(act) == ZFCP_ERP_FAILED) in zfcp_erp_adapter_strategy_open_fsf()
737 if (zfcp_erp_adapter_strategy_open_fsf_xport(act) == ZFCP_ERP_FAILED) in zfcp_erp_adapter_strategy_open_fsf()
740 if (mempool_resize(act->adapter->pool.sr_data, in zfcp_erp_adapter_strategy_open_fsf()
741 act->adapter->stat_read_buf_num)) in zfcp_erp_adapter_strategy_open_fsf()
744 if (mempool_resize(act->adapter->pool.status_read_req, in zfcp_erp_adapter_strategy_open_fsf()
745 act->adapter->stat_read_buf_num)) in zfcp_erp_adapter_strategy_open_fsf()
748 atomic_set(&act->adapter->stat_miss, act->adapter->stat_read_buf_num); in zfcp_erp_adapter_strategy_open_fsf()
749 if (zfcp_status_read_refill(act->adapter)) in zfcp_erp_adapter_strategy_open_fsf()
755 static void zfcp_erp_adapter_strategy_close(struct zfcp_erp_action *act) in zfcp_erp_adapter_strategy_close() argument
757 struct zfcp_adapter *adapter = act->adapter; in zfcp_erp_adapter_strategy_close()
771 static int zfcp_erp_adapter_strategy_open(struct zfcp_erp_action *act) in zfcp_erp_adapter_strategy_open() argument
773 struct zfcp_adapter *adapter = act->adapter; in zfcp_erp_adapter_strategy_open()
782 if (zfcp_erp_adapter_strategy_open_fsf(act)) { in zfcp_erp_adapter_strategy_open()
783 zfcp_erp_adapter_strategy_close(act); in zfcp_erp_adapter_strategy_open()
792 static int zfcp_erp_adapter_strategy(struct zfcp_erp_action *act) in zfcp_erp_adapter_strategy() argument
794 struct zfcp_adapter *adapter = act->adapter; in zfcp_erp_adapter_strategy()
797 zfcp_erp_adapter_strategy_close(act); in zfcp_erp_adapter_strategy()
798 if (act->status & ZFCP_STATUS_ERP_CLOSE_ONLY) in zfcp_erp_adapter_strategy()
802 if (zfcp_erp_adapter_strategy_open(act)) { in zfcp_erp_adapter_strategy()
810 static int zfcp_erp_port_forced_strategy_close(struct zfcp_erp_action *act) in zfcp_erp_port_forced_strategy_close() argument
814 retval = zfcp_fsf_close_physical_port(act); in zfcp_erp_port_forced_strategy_close()
817 act->step = ZFCP_ERP_STEP_PHYS_PORT_CLOSING; in zfcp_erp_port_forced_strategy_close()
870 static int zfcp_erp_open_ptp_port(struct zfcp_erp_action *act) in zfcp_erp_open_ptp_port() argument
872 struct zfcp_adapter *adapter = act->adapter; in zfcp_erp_open_ptp_port()
873 struct zfcp_port *port = act->port; in zfcp_erp_open_ptp_port()
880 return zfcp_erp_port_strategy_open_port(act); in zfcp_erp_open_ptp_port()
883 static int zfcp_erp_port_strategy_open_common(struct zfcp_erp_action *act) in zfcp_erp_port_strategy_open_common() argument
885 struct zfcp_adapter *adapter = act->adapter; in zfcp_erp_port_strategy_open_common()
886 struct zfcp_port *port = act->port; in zfcp_erp_port_strategy_open_common()
889 switch (act->step) { in zfcp_erp_port_strategy_open_common()
894 return zfcp_erp_open_ptp_port(act); in zfcp_erp_port_strategy_open_common()
899 return zfcp_erp_port_strategy_open_port(act); in zfcp_erp_port_strategy_open_common()
1131 static int zfcp_erp_strategy_statechange(struct zfcp_erp_action *act, int ret) in zfcp_erp_strategy_statechange() argument
1133 int action = act->action; in zfcp_erp_strategy_statechange()
1134 struct zfcp_adapter *adapter = act->adapter; in zfcp_erp_strategy_statechange()
1135 struct zfcp_port *port = act->port; in zfcp_erp_strategy_statechange()
1136 struct scsi_device *sdev = act->sdev; in zfcp_erp_strategy_statechange()
1138 u32 erp_status = act->status; in zfcp_erp_strategy_statechange()
1207 static void zfcp_erp_action_cleanup(struct zfcp_erp_action *act, int result) in zfcp_erp_action_cleanup() argument
1209 struct zfcp_adapter *adapter = act->adapter; in zfcp_erp_action_cleanup()
1210 struct zfcp_port *port = act->port; in zfcp_erp_action_cleanup()
1211 struct scsi_device *sdev = act->sdev; in zfcp_erp_action_cleanup()
1213 switch (act->action) { in zfcp_erp_action_cleanup()
1215 if (!(act->status & ZFCP_STATUS_ERP_NO_REF)) in zfcp_erp_action_cleanup()
1334 struct zfcp_erp_action *act; in zfcp_erp_thread() local
1350 act = list_entry(next, struct zfcp_erp_action, list); in zfcp_erp_thread()
1353 if (zfcp_erp_strategy(act) != ZFCP_ERP_DISMISSED) in zfcp_erp_thread()