---
name: "scsi_alloc_sdev"
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_alloc_sdev"
---

# scsi\_alloc\_sdev(9)

allocate and setup a scsi\_Device

## NAME

scsi\_alloc\_sdev - allocate and setup a scsi\_Device

## SYNOPSIS

**struct scsi\_device \* scsi\_alloc\_sdev(struct scsi\_target \*** *starget***, u64** *lun***, void \*** *hostdata***);**

## ARGUMENTS

*starget*

which target to allocate a scsi\_device for

*lun*

which lun

*hostdata*

usually NULL and set by -\>slave\_alloc instead

## DESCRIPTION

Allocate, initialize for io, and return a pointer to a scsi\_Device. Stores the *shost*, *channel*, *id*, and *lun* in the scsi\_Device, and adds scsi\_Device to the appropriate list.

Return value: scsi\_Device pointer, or NULL on failure.

## AUTHORS

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

Author.

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

Author.

## COPYRIGHT
