libnvme(9)
π
libnvme(9) β the enum nvme_id_ctrl_nwpc moment
okay bestie, so this page comes to you straight out of the API Manual for libnvme(9) β section 9, kernel-adjacent, very much giving "I read specs for fun" energy. Today we're decoding one enum and likeβ¦ it's about which write-protection vibes your NVMe controller can actually pull off. π
β¨ NAME β¨
enum nvme_id_ctrl_nwpc β bestie, this field is literally the controller telling you which optional namespace write protection capabilities it supports. no cap, that's the whole plot. π¦
π SYNOPSIS π
enum nvme_id_ctrl_nwpc {
NVME_CTRL_NWPC_WRITE_PROTECT ,
NVME_CTRL_NWPC_WRITE_PROTECT_POWER_CYCLE ,
NVME_CTRL_NWPC_WRITE_PROTECT_PERMANENT
};
three constants, one enum, zero notes of hesitation. iconic behavior honestly. β¨
π Constants π
NVME_CTRL_NWPC_WRITE_PROTECTβ if this bit is set, then the controller shall support theNo Write ProtectandWrite Protectnamespace write protection states π and it may support theWrite Protect Until Power Cyclestate and thePermanent Write Protectnamespace write protection states. so like, "shall" for two of them, "may" for the other two β the wording is doing a lot of work here, bestie, don't skip it. π«ΆNVME_CTRL_NWPC_WRITE_PROTECT_POWER_CYCLEβ if this bit is set, then the controller supports theWrite Protect Until Power Cyclestate. that's it. that's the whole bit. lowkey elegant. βNVME_CTRL_NWPC_WRITE_PROTECT_PERMANENTβ if this bit is set, then the controller supports thePermanent Write Protectstate. permanent. periodt. ππ₯
fr fr, everything in here is conditional on "if set" β you're checking capability bits, not commanding the controller to do anything. read the bits, respect the bits. π
and that's the page, bestie β full send, no details left behind π
mwah π β this has been API Manual, enum nvme_id_ctrl_nwpc, tagged libnvme(9), dated October 2026. go forth and write-protect responsibly. π§πΈ
π¦ where this page comes from
- arch rolling: nvme-cli 3.2-1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms