nvme_ns_detach_ctrls(2)
β¨ nvme_ns_detach_ctrls β¨
okay so bestie, we're in the libnvme API manual today and this one is called nvme_ns_detach_ctrls π
it's a function, it's a whole vibe, and it does exactly one thing but it does it iconically.
πΈ NAME πΈ
nvme_ns_detach_ctrls β detach a namespace from controllers, no cap π«Ά
like literally, it unhooks an nsid from the controllers you hand it. it's giving "we are no longer associated, periodt" π
π SYNOPSIS π
int nvme_ns_detach_ctrls (int fd , __u32 nsid , struct nvme_ctrl_list
*ctrlist );
three args, one int coming back at you, that's the whole story β¨
π¦ ARGUMENTS π¦
fdβ the file descriptor of the nvme device, bestie. your golden ticket π« it's anint, it's the door, walk through it.nsidβ the Namespace ID you wanna detach. it's a__u32and it's the main character of this whole operation, honestly πctrlistβ astruct nvme_ctrl_list *, aka the controller list whose attachment state fornsidis getting modified. this is the guest list and you're the bouncer πͺβ¨
π RETURN π
here's the tea β this function gives you back the nvme command status if a response was received β check enum nvme_status_field for the deets, iykyk.
but if it did not get a response? you get -1 and errno is set. so like, always check your errno, bestie, don't be that girl π
β οΈ real talk:-1witherrnoset means the call itself flubbed before a proper command status could come back. don't go reading the return value as a status field when it's literally-1. vibe check your error path first π
and that's the whole page, mwah π no extra lore, no secret options, just these exact three args and that return value.
libnvme API manual energy, dated July 2026, and yeah the function shares its name with the page twice because manpages are extra like that π slay, go detach some namespaces responsibly, ily π«Άβ¨π
π¦ where this page comes from
- ubuntu stonking: libnvme-dev 1.16.2-1build1 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms