---
name: "__shost_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/__shost_for_each_device"
---

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

iterate over all devices of a host (UNLOCKED)

## NAME

\_\_shost\_for\_each\_device - iterate over all devices of a host (UNLOCKED)

## SYNOPSIS

**\_\_shost\_for\_each\_device(***sdev***,** *shost***);**

## ARGUMENTS

*sdev*

the struct scsi\_device to use as a cursor

*shost*

the struct scsi\_host to iterate over

## DESCRIPTION

Iterator that returns each device attached to *shost*. 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 to use this is because you need to access the device list in interrupt context. Otherwise you really want to use shost\_for\_each\_device instead.

## AUTHORS

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

Author.

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

Author.

## COPYRIGHT
