libnvme(2)

πŸ’– libnvme(2) πŸ’–

okay bestie, sit down, we're doing API manual time ✨ this one is from the libnvme API manual, and today's main character is an enum. yes. an enum. and honestly? she ate.


🌸 NAME 🌸

enum nvme_sanitize_sstat β€” Sanitize Status, aka SSTAT, aka the receipts for what your drive did last time you told it to wipe itself 🧼


πŸ¦‹ SYNOPSIS πŸ¦‹

enum nvme_sanitize_sstat {
    NVME_SANITIZE_SSTAT_STATUS_SHIFT ,
    NVME_SANITIZE_SSTAT_STATUS_MASK ,
    NVME_SANITIZE_SSTAT_STATUS_NEVER_SANITIZED ,
    NVME_SANITIZE_SSTAT_STATUS_COMPLETE_SUCCESS ,
    NVME_SANITIZE_SSTAT_STATUS_IN_PROGESS ,
    NVME_SANITIZE_SSTAT_STATUS_COMPLETED_FAILED ,
    NVME_SANITIZE_SSTAT_STATUS_ND_COMPLETE_SUCCESS ,
    NVME_SANITIZE_SSTAT_COMPLETED_PASSES_SHIFT ,
    NVME_SANITIZE_SSTAT_COMPLETED_PASSES_MASK ,
    NVME_SANITIZE_SSTAT_GLOBAL_DATA_ERASED_SHIFT ,
    NVME_SANITIZE_SSTAT_GLOBAL_DATA_ERASED_MASK ,
    NVME_SANITIZE_SSTAT_GLOBAL_DATA_ERASED ,
    NVME_SANITIZE_SSTAT_MVCNCLD_SHIFT ,
    NVME_SANITIZE_SSTAT_MVCNCLD_MASK

};

look at her. fourteen members, all vibes, zero filler πŸ‘‘


✨ Constants ✨

kk so every single one of these little legends, in order, no skipping, I promise πŸ’…

  • NVME_SANITIZE_SSTAT_STATUS_SHIFT β€” the shift amount you use to pull the status value of the most recent sanitize operation out of the struct nvme_sanitize_log_page.sstat field. shifting, bestie, it's giving bit manipulation 😌
  • NVME_SANITIZE_SSTAT_STATUS_MASK β€” the mask that gets you the status value of the most recent sanitize operation. mask on, mystery off πŸ’–
  • NVME_SANITIZE_SSTAT_STATUS_NEVER_SANITIZED β€” literally says it: the NVM subsystem has never been sanitized. brand new, untouched, innocent πŸŽ€
  • NVME_SANITIZE_SSTAT_STATUS_COMPLETE_SUCCESS β€” the most recent sanitize operation completed successfully, and yes that includes any additional media modification. she finished AND she did the extra credit 🌟
  • NVME_SANITIZE_SSTAT_STATUS_IN_PROGESS β€” a sanitize operation is currently in progress. (yes the constant is spelled that way, no I will not be the one to tell her, we support her 🫢) it's happening right now, do not unplug anything
  • NVME_SANITIZE_SSTAT_STATUS_COMPLETED_FAILED β€” the most recent sanitize operation failed. πŸ’€ awkward. deeply awkward
  • NVME_SANITIZE_SSTAT_STATUS_ND_COMPLETE_SUCCESS β€” the most recent sanitize operation where No-Deallocate After Sanitize was requested has completed successfully, with deallocation of all user data. all of it. bye πŸ‘‹
  • NVME_SANITIZE_SSTAT_COMPLETED_PASSES_SHIFT β€” the shift amount to get the number of completed passes, but only if the most recent sanitize operation was an Overwrite. and listen: this value shall be cleared to 0h if the most recent sanitize operation was not an Overwrite. that's a shall, she's serious ⚠️
  • NVME_SANITIZE_SSTAT_COMPLETED_PASSES_MASK β€” the mask to get the number of completed passes. same deal, number of passes, masked up πŸ’…
  • NVME_SANITIZE_SSTAT_GLOBAL_DATA_ERASED_SHIFT β€” the shift amount to get the Global Data Erased value out of the struct nvme_sanitize_log_page.sstat field.
  • NVME_SANITIZE_SSTAT_GLOBAL_DATA_ERASED_MASK β€” the mask to get the Global Data Erased value. ✨
  • NVME_SANITIZE_SSTAT_GLOBAL_DATA_ERASED β€” Global Data Erased: if this is set, then no namespace user data in the NVM subsystem has been written to, and no Persistent Memory Region in the NVM subsystem has been enabled β€” either since being manufactured and the NVM subsystem has never been sanitized, or since the most recent successful sanitize operation. basically the cleanest possible slate, no notes, iconic 🌈
  • NVME_SANITIZE_SSTAT_MVCNCLD_SHIFT β€” the shift amount to get the value of the Media Verification Canceled bit of the Sanitize status field.
  • NVME_SANITIZE_SSTAT_MVCNCLD_MASK β€” the mask to get the value of the Media Verification Canceled bit of the Sanitize status field. MVCNCLD said what she said πŸ™ˆ

lowkey everything here is about reading one field with the right shift and the right mask, and highkey that's the whole assignment. no cap 🧚

and that's the page, bestie!! this lil cutie is from the libnvme API manual, page enum nvme_sanitize_sstat, dated July 2026 πŸ’œ go forth and mask responsibly, ily, bye!! πŸŽ€πŸ’–βœ¨

πŸ“¦ where this page comes from