nvme_init_read(9)

πŸ“¦ version 3.2, in arch rolling

πŸ’– 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 of cdw12 πŸŽ€ yep, just the top half, that's her whole job.
  • dsm β€” the Data set management attributes, and CETYPE is zero in this case πŸ‘‘ see enum nvme_io_dsm_flags for the deets.
  • cev β€” the Command Extension Value 🌈 and for this one, CETYPE is non-zero. mutually exclusive vibes with dsm, iykyk.
  • data β€” pointer to the user address of the data buffer πŸ’– where the actual data lives.
  • data_len β€” the length of the user buffer data, 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 buffer metadata, 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