'\" t .\" Title: __starget_for_each_device .\" Author: .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: January 2017 .\" Manual: SCSI mid layer .\" Source: Kernel Hackers Manual 4.8.15 .\" Language: English .\" .TH "__STARGET_FOR_EACH_D" "9" "January 2017" "Kernel Hackers Manual 4\&.8\&." "SCSI mid layer" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" __starget_for_each_device \- helper to walk all devices of a target (UNLOCKED) .SH "SYNOPSIS" .HP \w'void\ __starget_for_each_device('u .BI "void __starget_for_each_device(struct\ scsi_target\ *\ " "starget" ", void\ *\ " "data" ", void\ (*" "fn" ")\ (struct\ scsi_device\ *,\ void\ *));" .SH "ARGUMENTS" .PP \fIstarget\fR .RS 4 target whose devices we want to iterate over\&. .RE .PP \fIdata\fR .RS 4 parameter for callback \fIfn\fR() .RE .PP \fIfn\fR .RS 4 callback function that is invoked for each device .RE .SH "DESCRIPTION" .PP This traverses over each device of \fIstarget\fR\&. It does _not_ take a reference on the scsi_device, so the whole loop must be protected by shost\->host_lock\&. .SH "NOTE" .PP 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\&. .SH "AUTHORS" .PP \fBJames Bottomley\fR <\&James.Bottomley@hansenpartnership.com\&> .RS 4 Author. .RE .PP \fBRob Landley\fR <\&rob@landley.net\&> .RS 4 Author. .RE .SH "COPYRIGHT" .br