---
name: "nvme_init_write-libnvme3"
section: "2"
platform: "linux"
package: "nvme-cli"
version: "3.2-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/nvme_init_write-libnvme3"
---

# nvme\_init\_write-libnvme3(2)

Initialize passthru command for a user write command

## NAME

nvme\_init\_write - Initialize passthru command for a user write command

## SYNOPSIS

**void nvme\_init\_write** **(struct libnvme\_passthru\_cmd \*cmd** *,* **\_\_u32 nsid** *,* **\_\_u64 slba** *,* **\_\_u16 nlb** *,* **\_\_u16 control** *,* **\_\_u16 dspec** *,* **\_\_u8 dsm** *,* **\_\_u8 cev** *,* **void \*data** *,* **\_\_u32 data\_len** *,* **void \*metadata** *,* **\_\_u32 metadata\_len** *);*

## ARGUMENTS

- cmd

  Passthru command to use

- nsid

  Namespace ID

- slba

  Starting logical block

- nlb

  Number of logical blocks (0-based)

- control

  Upper 16 bits of cdw12

- dspec

  Directive specific value

- dsm

  Data set management attributes (CETYPE is zero), see *enum nvme\_io\_dsm\_flags*

- cev

  Command Extension Value (CETYPE is non-zero)

- data

  Pointer to user address of the data buffer

- data\_len

  Length of user buffer, *data*, in bytes

- metadata

  Pointer to user address of the metadata buffer

- metadata\_len

  Length of user buffer, *metadata*, in bytes

## DESCRIPTION

Initializes the passthru command buffer for the Write command.
