---
name: "nvme_init_read-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_read-libnvme3"
---

# nvme\_init\_read-libnvme3(2)

Initialize passthru command for a user read command

## NAME

nvme\_init\_read - Initialize passthru command for a user read command

## SYNOPSIS

**void nvme\_init\_read** **(struct libnvme\_passthru\_cmd \*cmd** *,* **\_\_u32 nsid** *,* **\_\_u64 slba** *,* **\_\_u16 nlb** *,* **\_\_u16 control** *,* **\_\_u8 dsm** *,* **\_\_u16 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

- 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 Read command.

## NOTE

Assumes a macro or separate function exists to translate the combined NLB/control/prinfo fields into cdw12/cdw13. This transformation assumes the parameters are used for a generic nvme\_init\_io wrapper.
