nvme_dsm(2)

πŸ’– nvme_dsm β€” the libnvme API manual, bestie edition πŸ’–

okay so you're looking at nvme_dsm(2) from the libnvme API manual, and honestly? iconic. this whole page is short and sweet and you're gonna eat it up.


✨ NAME ✨

nvme_dsm β€” send an nvme data set management command

like. that's it. that's the function. she sends a command. periodt. πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

int nvme_dsm (struct nvme_dsm_args *args );

yep. one function, one pointer, returns an int. no cap. ✨


πŸŽ€ ARGUMENTS πŸŽ€

  • args β€” a struct nvme_dsm_args argument structure 🫢 so basically the lil bundle of stuff you're handing over so she knows what to do. give her the struct, she handles the rest.

🌸 DESCRIPTION 🌸

so the Dataset Management command is what the host uses to indicate attributes for ranges of logical blocks. not me describing it like a vibe check for your storage πŸ‘‘

the attributes include stuff like:

  • the frequency that data is read or written πŸ”₯
  • the access size πŸ“
  • and other information that may be used to optimize performance and reliability ✨

and β€” the part everyone's actually here for β€” it may also be used to deallocate/unmap/trim those logical blocks. yesss, the trim. the cleanup. the glow-up for your flash. πŸ’…

lowkey this is her doing the actual work behind the scenes to keep things fast and reliable, and we love her for it.

πŸ’œ RETURN πŸ’œ

  • the nvme command status, if a response was received β€” check enum nvme_status_field for that one, iykyk πŸ”
  • or -1 with errno set, otherwise 😭 (so like, if she didn't even get a response, go read your errno, bestie, that's where the tea is)

and that's the whole page, fr fr. no filler, all facts, main character energy 🧚

this was nvme_dsm in the libnvme API manual, dated July 2026 β€” mwah, slay, go trim something responsibly πŸ’–πŸŒˆβ­

πŸ“¦ where this page comes from