---
name: "scsi_alloc_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_alloc_target"
---

# scsi\_alloc\_target(9)

allocate a new or find an existing target

## NAME

scsi\_alloc\_target - allocate a new or find an existing target

## SYNOPSIS

**struct scsi\_target \* scsi\_alloc\_target(struct device \*** *parent***, int** *channel***, uint** *id***);**

## ARGUMENTS

*parent*

parent of the target (need not be a scsi host)

*channel*

target channel number (zero if no channels)

*id*

target id number

## DESCRIPTION

Return an existing target if one exists, provided it hasn't already gone into STARGET\_DEL state, otherwise allocate a new target.

The target is returned with an incremented reference, so the caller is responsible for both reaping and doing a last put

## AUTHORS

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

Author.

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

Author.

## COPYRIGHT
