nvme_identi..._ns_list_csi(2)

✨ nvme_identi..._ns_list_csi(2) ✨

okay bestie, come sit with me πŸ’– this one lives in the libnvme API manual, and it's genuinely so useful once it clicks. full name's a mouthful so we're abbreviating: nvme_identi..._ns_list_csi. the way that the linker and the man page writer both gave up on this name… iconic πŸ’…


πŸŽ€ NAME πŸŽ€

nvme_identify_allocated_ns_list_csi β€” allocated namespace ID list, but like… associated with a specified I/O command set πŸ¦‹


🫢 SYNOPSIS 🫢

int nvme_identify_allocated_ns_list_csi (int fd , __u32 nsid , enum
nvme_csi csi , struct nvme_ns_list *ns_list );

four things in, one int out, no cap πŸ“


πŸ‘‘ ARGUMENTS πŸ‘‘

  • fd β€” file descriptor of the nvme device ✨ the little handle you got when you opened the thing
  • nsid β€” return namespaces greater than this identifier. yes literally, strictly greater, we don't do equal here
  • csi β€” the Command Set Identifier πŸŽ€ (she's the one deciding which I/O command set we're matching against)
  • ns_list β€” user space destination address where we transfer the data 🌸 like, you hand her a place to put stuff, that's the vibe

🌈 DESCRIPTION 🌈

so here's the tea, bestie β˜• a list of 1024 namespace IDs gets returned to the host, containing allocated NSIDs in increasing order that are:

  1. greater than the value you specified in the nsid field of the command, and
  2. matching the I/O Command Set specified in the csi argument πŸ’–

both conditions. no shortcuts. sorted ascending, allocated only, filtered by command set. obsessed with a well-behaved API fr fr ✨

peep struct nvme_ns_list for the definition of the returned structure πŸ‘€ that's where the shape of what you get back is written down.

πŸ’€ RETURN πŸ’€

  • the nvme command status if a response was received (go look at enum nvme_status_field for what those mean, iykyk)
  • or -1 with errno set otherwise 😭

and that's literally it. one call, one list, up to 1024 icon namespaces, main character energy only πŸ‘‘


mwah, that's the whole page babes πŸ§šπŸ’œ this was nvme_identi..._ns_list_csi(2) from the libnvme API manual, dated July 2026. go write something that slays, and remember: strictly greater than, always πŸŽ€βœ¨

πŸ“¦ where this page comes from