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

# \_\_scsi\_device\_lookup\_by\_target(9)

find a device given the target (UNLOCKED)

## NAME

\_\_scsi\_device\_lookup\_by\_target - find a device given the target (UNLOCKED)

## SYNOPSIS

**struct scsi\_device \* \_\_scsi\_device\_lookup\_by\_target(struct scsi\_target \*** *starget***, u64** *lun***);**

## ARGUMENTS

*starget*

SCSI target pointer

*lun*

SCSI Logical Unit Number

## DESCRIPTION

Looks up the scsi\_device with the specified *lun* for a given *starget*. The returned scsi\_device does not have an additional reference. You must hold the host's host\_lock over this call and any access to the returned scsi\_device. A scsi\_device in state SDEV\_DEL is skipped.

## NOTE

The only reason why drivers should use this is because they need to access the device list in irq context. Otherwise you really want to use scsi\_device\_lookup\_by\_target instead.

## AUTHORS

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

Author.

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

Author.

## COPYRIGHT
