nvme_init_read(9)
π nvme_init_read(9) π
okay bestie, welcome to the libnvme API manual β¨ this one's about nvme_init_read β she's the lil glow-up artist that gets your passthru command all dressed and ready for a user read command π no cap, she's lowkey just setting up the vibes before the actual I/O happens.
πΈ NAME πΈ
nvme_init_read β initialize the passthru command for a user read command π
like, she preps the whole thing so it's ready to slay.
π¦ 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 );
that's the whole squad of parameters, and yes there's a lot of them π but she handles it, periodt.
π ARGUMENTS π
cmdβ the passthru command you're gonna use π«Ά she's the main character here, everything gets written into her.nsidβ the Namespace ID β¨ which namespace are we talking to, bestie?slbaβ the starting logical block β your starting point on the block map.nlbβ number of logical blocks π₯ and heads up: this is 0-based, so don't be out here off-by-one-ing yourself πcontrolβ the upper 16 bits ofcdw12π yep, just the top half, that's her whole job.dsmβ the Data set management attributes, andCETYPEis zero in this case π seeenum nvme_io_dsm_flagsfor the deets.cevβ the Command Extension Value π and for this one,CETYPEis non-zero. mutually exclusive vibes withdsm, iykyk.dataβ pointer to the user address of the data buffer π where the actual data lives.data_lenβ the length of the user bufferdata, in bytes π§ a number, not a vibe.metadataβ pointer to the user address of the metadata buffer π¦ separate buffer, separate energy.metadata_lenβ the length of the user buffermetadata, in bytes πΈ again, bytes, bestie.
β¨ DESCRIPTION β¨
She initializes the passthru command buffer for the Read command π that's literally it, that's the whole assignment. The buffer gets set up, the fields get filled in, and your read command is ready to go live. iconic behavior tbh.
π NOTE π
okay important, listen up π β this assumes that a macro or a separate function exists to translate the combined NLB/control/prinfo fields into cdw12/cdw13. so like, the actual squishing-together of those fields? not her problem, someone else is handling that.
also, this transformation assumes the parameters are being used for a generic nvme_init_io wrapper π so keep that in mind, no cap.
and that's the whole page, bestie!! π you understood it, you ate, you left no crumbs π
nvme_init_read β straight from the libnvme API manual, dated October 2026 π mwah, go read some blocks π¦β¨
π¦ where this page comes from
- arch rolling: nvme-cli 3.2-1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms