libnvme(2)
π libnvme(2) β the API Manual, bestie edition π
okay so welcome to libnvme, section 2 of the API Manual, and today's main character is literally one enum. yes. one. and it's carrying the entire Sanitize State Information (SSI) situation on its back. no cap. let's go π«Ά
β¨ NAME β¨
enum nvme_sanitize_ssi β Sanitize State Information (SSI), aka the enum that tells you what your sanitize op is actually doing rn π
π¦ SYNOPSIS π¦
here's the whole vibe, verbatim, do not touch:
enum nvme_sanitize_ssi {
NVME_SANITIZE_SSI_SANS_SHIFT ,
NVME_SANITIZE_SSI_SANS_MASK ,
NVME_SANITIZE_SSI_FAILS_SHIFT ,
NVME_SANITIZE_SSI_FAILS_MASK ,
NVME_SANITIZE_SSI_IDLE ,
NVME_SANITIZE_SSI_RESTRICT_PROCESSING ,
NVME_SANITIZE_SSI_RESTRICT_FAILURE ,
NVME_SANITIZE_SSI_UNRESTRICT_PROCESSING ,
NVME_SANITIZE_SSI_UNRESTRICT_FAILURE ,
NVME_SANITIZE_SSI_MEDIA_VERIFICATION ,
NVME_SANITIZE_SSI_POST_VERIF_DEALLOC
};
πΈ Constants πΈ
okay so this is the part where we meet every single member, one by one, no skipping, no gatekeeping π
NVME_SANITIZE_SSI_SANS_SHIFTβ this is the shift amount you use to pull the Sanitize State value out of the Sanitize State Information (SSI) field. math girlies rise π§NVME_SANITIZE_SSI_SANS_MASKβ and this is the mask for getting that same Sanitize State value out of the Sanitize State Information (SSI) field. shift + mask = the classic duo, obsessed πNVME_SANITIZE_SSI_FAILS_SHIFTβ the shift amount to get the Failure State value out of the Sanitize State Information (SSI) field β¨NVME_SANITIZE_SSI_FAILS_MASKβ the mask to get the Failure State value out of the Sanitize State Information (SSI) field. yes this is the same pattern again, it's consistent, that's the point, periodt πNVME_SANITIZE_SSI_IDLEβ literally nothing is happening. no sanitize operation is in process. it's giving "nothing to see here" energy πNVME_SANITIZE_SSI_RESTRICT_PROCESSINGβ the Sanitize operation is in Restricted Processing State. it's working, just, yk, on a leash π₯NVME_SANITIZE_SSI_RESTRICT_FAILUREβ the Sanitize operation is in Restricted Failure State. π this state gets entered if sanitize processing was performed in the Restricted Processing state AND sanitize processing failed, OR a failure occurred during deallocation of media allocated for user data in the Post-Verification Deallocation</> state. so yeah, double the ways to get here, sorry bestie πNVME_SANITIZE_SSI_UNRESTRICT_PROCESSINGβ the Sanitize operation is in Unrestricted Processing State. no leash. full send πNVME_SANITIZE_SSI_UNRESTRICT_FAILUREβ the Sanitize operation is in Unrestricted Failure State. π this one gets entered if sanitize processing was performed in the Unrestricted Processing state AND sanitize processing failed, OR a failure occurred during deallocation of media allocated for user data in the Post-Verification</>. same energy as its restricted sibling, different context, iykykNVME_SANITIZE_SSI_MEDIA_VERIFICATIONβ the Sanitize operation is in Media Verification State β¨ in this state the sanitize processing completed successfully, and all media allocated for user data in the sanitization target is readable by the host, for purposes of verifying sanitization. we ate. this is the good ending πNVME_SANITIZE_SSI_POST_VERIF_DEALLOCβ the Sanitize operation is in Post-Verification Deallocation State. in this state, the controller shall deallocate all media allocated for user data in the sanitization target. no notes, it's mandatory, it's the law, the controller is doing it fr fr π
lowkey reminder bestie: those two *_FAILURE states are failure states. they are not cute. if you land in one, something failed or something failed during dealloc. don't romanticize them, just read the docs and handle it π
okay that's the whole enum, every single constant accounted for, nobody left behind, we love an exhaustive list π
and that's a wrap on this little corner of the libnvme API Manual β page libnvme(2), page enum nvme_sanitize_ssi, dated July 2026. stan the sanitize state machine, take care of ur media, and hydrate before you dealloc π¦β¨π
π¦ 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