---
name: "__starget_for_each_device"
section: "9"
platform: "linux"
package: "linux-manual-4.9"
version: "4.9.228-1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/__starget_for_each_device"
---

# \_\_starget\_for\_each\_device(9)

helper to walk all devices of a target (UNLOCKED)

## NAME

\_\_starget\_for\_each\_device - helper to walk all devices of a target (UNLOCKED)

## SYNOPSIS

**void \_\_starget\_for\_each\_device(struct scsi\_target \*** *starget***, void \*** *data***, void (\****fn***) (struct scsi\_device \*, void \*));**

## ARGUMENTS

*starget*

target whose devices we want to iterate over.

*data*

parameter for callback *fn*()

*fn*

callback function that is invoked for each device

## DESCRIPTION

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.

## NOTE

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.

## AUTHORS

**James Bottomley** \<James.Bottomley@hansenpartnership.com\>

Author.

**Rob Landley** \<rob@landley.net\>

Author.

## COPYRIGHT
