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, iykyk
  • NVME_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