|
@@ -524,6 +524,20 @@ static void zfcp_scsi_terminate_rport_io(struct fc_rport *rport)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+static void zfcp_scsi_queue_unit_register(struct zfcp_port *port)
|
|
|
+{
|
|
|
+ struct zfcp_unit *unit;
|
|
|
+
|
|
|
+ read_lock_irq(&port->unit_list_lock);
|
|
|
+ list_for_each_entry(unit, &port->unit_list, list) {
|
|
|
+ get_device(&unit->dev);
|
|
|
+ if (scsi_queue_work(port->adapter->scsi_host,
|
|
|
+ &unit->scsi_work) <= 0)
|
|
|
+ put_device(&unit->dev);
|
|
|
+ }
|
|
|
+ read_unlock_irq(&port->unit_list_lock);
|
|
|
+}
|
|
|
+
|
|
|
static void zfcp_scsi_rport_register(struct zfcp_port *port)
|
|
|
{
|
|
|
struct fc_rport_identifiers ids;
|
|
@@ -548,6 +562,8 @@ static void zfcp_scsi_rport_register(struct zfcp_port *port)
|
|
|
rport->maxframe_size = port->maxframe_size;
|
|
|
rport->supported_classes = port->supported_classes;
|
|
|
port->rport = rport;
|
|
|
+
|
|
|
+ zfcp_scsi_queue_unit_register(port);
|
|
|
}
|
|
|
|
|
|
static void zfcp_scsi_rport_block(struct zfcp_port *port)
|
|
@@ -610,21 +626,26 @@ void zfcp_scsi_rport_work(struct work_struct *work)
|
|
|
put_device(&port->dev);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-void zfcp_scsi_scan(struct work_struct *work)
|
|
|
+/**
|
|
|
+ * zfcp_scsi_scan - Register LUN with SCSI midlayer
|
|
|
+ * @unit: The LUN/unit to register
|
|
|
+ */
|
|
|
+void zfcp_scsi_scan(struct zfcp_unit *unit)
|
|
|
{
|
|
|
- struct zfcp_unit *unit = container_of(work, struct zfcp_unit,
|
|
|
- scsi_work);
|
|
|
- struct fc_rport *rport;
|
|
|
-
|
|
|
- flush_work(&unit->port->rport_work);
|
|
|
- rport = unit->port->rport;
|
|
|
+ struct fc_rport *rport = unit->port->rport;
|
|
|
|
|
|
if (rport && rport->port_state == FC_PORTSTATE_ONLINE)
|
|
|
scsi_scan_target(&rport->dev, 0, rport->scsi_target_id,
|
|
|
scsilun_to_int((struct scsi_lun *)
|
|
|
&unit->fcp_lun), 0);
|
|
|
+}
|
|
|
+
|
|
|
+void zfcp_scsi_scan_work(struct work_struct *work)
|
|
|
+{
|
|
|
+ struct zfcp_unit *unit = container_of(work, struct zfcp_unit,
|
|
|
+ scsi_work);
|
|
|
|
|
|
+ zfcp_scsi_scan(unit);
|
|
|
put_device(&unit->dev);
|
|
|
}
|
|
|
|