---
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

## NAME

shost\_for\_each\_device - iterate over all devices of a host

## 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*. This loop takes a reference on each device and releases it at the end. If you break out of the loop, you must call scsi\_device\_put(sdev).

## AUTHORS

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

Author.

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

Author.

## COPYRIGHT
