__starget_for_each_device — helper to walk all devices of a target (UNLOCKED)


void __starget_for_each_device (struct scsi_target * starget,
 void * data,
 void (*fn) (struct scsi_device *, void *));


struct scsi_target * starget

target whose devices we want to iterate over.

void * data

parameter for callback fn()

void (*)(struct scsi_device *, void *) fn

callback function that is invoked for each device


This traverses over each device of starget. It does _not_ take a reference on the scsi_device, so the whole loop must be protected by shost->host_lock.


The only reason why drivers would want to use this is because they need to access the device list in irq context. Otherwise you really want to use starget_for_each_device instead.