nvme_subsys...each_ns_safe(2)
β¨ NAME β¨
nvme_subsystem_for_each_ns_safe β the little macro bestie that walks you through your namespaces π¦ safely, no cap
This one lives in the libnvme API manual, section 2, so you know it's a real one π
π SYNOPSIS π
nvme_subsystem_for_each_ns_safe (s , n , _n );
like... that's it. that's the whole vibe. three lil things go in, namespaces come out β¨
π ARGUMENTS π
sβ annvme_subsystem_tobject. the main character π the subsystem you're iterating over.nβ annvme_ns_tobject. this is your namespace, the one you're looking at right now, one at a time πΈ_nβ anvme_ns_t_nodeto use as temporary storage. ikykyk β it's the scratch space so the loop can keep its footing and not eat itself. literally the seatbelt of this whole operation π«Ά
heads up bestie: _n is doing real work behind the scenes, so don't go touching it or reusing it for something cute. it's temp storage, that's its whole job, periodt π
π A LIL NOTE ON THE NAME π
notice the _safe at the end? that's the whole point, fr fr β it's the "plain" variant's glow-up so you can bail out mid-loop without the iterator tripping over itself. very demure, very mindful, very safe π
that's the whole page, gorgeous π nothing hidden, nothing skipped.
libnvme API manual Β· July 2026 β stay slay, keep your iterators safe, and go traverse those namespaces ππ¦β¨
π¦ 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