Beispiel #1
0
static void _zfcp_erp_port_forced_reopen(struct zfcp_port *port,
					 int clear, u8 id, void *ref)
{
	zfcp_erp_port_block(port, clear);

	if (atomic_read(&port->status) & ZFCP_STATUS_COMMON_ERP_FAILED)
		return;

	zfcp_erp_action_enqueue(ZFCP_ERP_ACTION_REOPEN_PORT_FORCED,
				port->adapter, port, NULL, id, ref);
}
Beispiel #2
0
static void _zfcp_erp_unit_reopen(struct zfcp_unit *unit, int clear, char *id,
				  void *ref)
{
	struct zfcp_adapter *adapter = unit->port->adapter;

	zfcp_erp_unit_block(unit, clear);

	if (atomic_read(&unit->status) & ZFCP_STATUS_COMMON_ERP_FAILED)
		return;

	zfcp_erp_action_enqueue(ZFCP_ERP_ACTION_REOPEN_UNIT,
				adapter, unit->port, unit, id, ref);
}
Beispiel #3
0
static int _zfcp_erp_adapter_reopen(struct zfcp_adapter *adapter,
				    int clear_mask, u8 id, void *ref)
{
	zfcp_erp_adapter_block(adapter, clear_mask);

	/* ensure propagation of failed status to new devices */
	if (atomic_read(&adapter->status) & ZFCP_STATUS_COMMON_ERP_FAILED) {
		zfcp_erp_adapter_failed(adapter, 13, NULL);
		return -EIO;
	}
	return zfcp_erp_action_enqueue(ZFCP_ERP_ACTION_REOPEN_ADAPTER,
				       adapter, NULL, NULL, id, ref);
}
static void _zfcp_erp_lun_reopen(struct scsi_device *sdev, int clear, char *id,
                                 u32 act_status)
{
    struct zfcp_scsi_dev *zfcp_sdev = sdev_to_zfcp(sdev);
    struct zfcp_adapter *adapter = zfcp_sdev->port->adapter;

    zfcp_erp_lun_block(sdev, clear);

    if (atomic_read(&zfcp_sdev->status) & ZFCP_STATUS_COMMON_ERP_FAILED)
        return;

    zfcp_erp_action_enqueue(ZFCP_ERP_ACTION_REOPEN_LUN, adapter,
                            zfcp_sdev->port, sdev, id, act_status);
}
static int _zfcp_erp_port_reopen(struct zfcp_port *port, int clear, char *id)
{
    zfcp_erp_port_block(port, clear);
    zfcp_scsi_schedule_rport_block(port);

    if (atomic_read(&port->status) & ZFCP_STATUS_COMMON_ERP_FAILED) {

        zfcp_erp_set_port_status(port, ZFCP_STATUS_COMMON_ERP_FAILED);
        return -EIO;
    }

    return zfcp_erp_action_enqueue(ZFCP_ERP_ACTION_REOPEN_PORT,
                                   port->adapter, port, NULL, id, 0);
}
Beispiel #6
0
static int _zfcp_erp_port_reopen(struct zfcp_port *port, int clear, u8 id,
				 void *ref)
{
	zfcp_erp_port_block(port, clear);

	if (atomic_read(&port->status) & ZFCP_STATUS_COMMON_ERP_FAILED) {
		/* ensure propagation of failed status to new devices */
		zfcp_erp_port_failed(port, 14, NULL);
		return -EIO;
	}

	return zfcp_erp_action_enqueue(ZFCP_ERP_ACTION_REOPEN_PORT,
				       port->adapter, port, NULL, id, ref);
}
static int _zfcp_erp_adapter_reopen(struct zfcp_adapter *adapter,
                                    int clear_mask, char *id)
{
    zfcp_erp_adapter_block(adapter, clear_mask);
    zfcp_scsi_schedule_rports_block(adapter);


    if (atomic_read(&adapter->status) & ZFCP_STATUS_COMMON_ERP_FAILED) {
        zfcp_erp_set_adapter_status(adapter,
                                    ZFCP_STATUS_COMMON_ERP_FAILED);
        return -EIO;
    }
    return zfcp_erp_action_enqueue(ZFCP_ERP_ACTION_REOPEN_ADAPTER,
                                   adapter, NULL, NULL, id, 0);
}
void zfcp_erp_adapter_reopen(struct zfcp_adapter *adapter, int clear, char *id)
{
    unsigned long flags;

    zfcp_erp_adapter_block(adapter, clear);
    zfcp_scsi_schedule_rports_block(adapter);

    write_lock_irqsave(&adapter->erp_lock, flags);
    if (atomic_read(&adapter->status) & ZFCP_STATUS_COMMON_ERP_FAILED)
        zfcp_erp_set_adapter_status(adapter,
                                    ZFCP_STATUS_COMMON_ERP_FAILED);
    else
        zfcp_erp_action_enqueue(ZFCP_ERP_ACTION_REOPEN_ADAPTER, adapter,
                                NULL, NULL, id, 0);
    write_unlock_irqrestore(&adapter->erp_lock, flags);
}