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 thestruct nvme_sanitize_log_page.sstatfield. 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 anythingNVME_SANITIZE_SSTAT_STATUS_COMPLETED_FAILEDβ the most recent sanitize operation failed. π awkward. deeply awkwardNVME_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 thestruct nvme_sanitize_log_page.sstatfield.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
- 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