/* Called by fc_user_scan to locate an rport on the shost that matches the channel and target id, and invoke scsi_scan_target() on the rport.  */
static void fc_user_scan_tgt(struct Scsi_Host *shost, uint channel, uint id, uint lun)
/* Called by fc_user_scan to locate an rport on the shost that matches the channel and target id, and invoke scsi_scan_target() on the rport.  */
static void fc_user_scan_tgt(struct Scsi_Host *shost, uint channel, uint id, uint lun)
{
	struct fc_rport *rport;
	unsigned long flags;
	spin_lock_irqsave(shost->host_lock, flags);
	list_for_each_entry(rport, &fc_host_rports(shost), peers) {
		if (rport->scsi_target_id == -1)
			continue;
		if (rport->port_state != FC_PORTSTATE_ONLINE)
			continue;
		if ((channel == rport->channel) &&
		    (id == rport->scsi_target_id)) {
			spin_unlock_irqrestore(shost->host_lock, flags);
			scsi_scan_target(&rport->dev, channel, id, lun, 1);
			return;
		}
	}
	spin_unlock_irqrestore(shost->host_lock, flags);
}