libnvme(9)
π libnvme(9) β the API Manual, bestie edition β¨
Okay so listen. This is a page straight out of libnvme (that's the API Manual, iykyk), and today we're doing a deep dive on one very specific little enum. Grab your iced coffee π, because she's niche but she matters.
π NAME π
enum nvme_sanitize_sstat β the Sanitize Status, aka SSTAT. That's it. That's her. π
β¨ SYNOPSIS β¨
Here's the whole squad, exactly as declared, no edits, no cap:
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_PROGRESS ,
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 ,
NVME_SANITIZE_SSTAT_PRGD_SHIFT ,
NVME_SANITIZE_SSTAT_PRGD_MASK ,
NVME_SANITIZE_SSTAT_PRGD
};
πΈ Constants πΈ
Every single one of these, coming right up. No skips, no shortcuts, we don't do that here π
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. Like, that's literally its whole job.NVME_SANITIZE_SSTAT_STATUS_MASKβ the mask π that gets you the status value of the most recent sanitize operation.NVME_SANITIZE_SSTAT_STATUS_NEVER_SANITIZEDβ okay so this one means the NVM subsystem has never been sanitized. Never ever. Not once. Fresh out the box energy πΌNVME_SANITIZE_SSTAT_STATUS_COMPLETE_SUCCESSβ the most recent sanitize operation completed successfully π including any additional media modification. She ate and left no crumbs.NVME_SANITIZE_SSTAT_STATUS_IN_PROGRESSβ a sanitize operation is currently in progress. It's happening. Right now. Main character moment, we're mid-scene β³NVME_SANITIZE_SSTAT_STATUS_COMPLETED_FAILEDβ the most recent sanitize operation failed π. It's giving flop era. We don't talk about it.NVME_SANITIZE_SSTAT_STATUS_ND_COMPLETE_SUCCESSβ the most recent sanitize operation for which No-Deallocate After Sanitize was requested has completed successfully, with deallocation of all user data β . Extremely thorough, we love a queen who finishes the job.NVME_SANITIZE_SSTAT_COMPLETED_PASSES_SHIFTβ shift amount π« to get the number of completed passes if the most recent sanitize operation was an Overwrite. Heads up though: this value shall be cleared to0hif the most recent sanitize operation was not an Overwrite. Not optional, bestie, that's just the rule.NVME_SANITIZE_SSTAT_COMPLETED_PASSES_MASKβ the mask for getting the number of completed passes π―NVME_SANITIZE_SSTAT_GLOBAL_DATA_ERASED_SHIFTβ 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 that gets you 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, since being manufactured and the NVM subsystem has never been sanitized; or since the most recent successful sanitize operation. Read that one twice, it's a whole sentence π Basically: pristine or freshly cleansed, nothing in between.NVME_SANITIZE_SSTAT_MVCNCLD_SHIFTβ shift amount to get the value of the Media Verification Canceled bit of the Sanitize status field π«NVME_SANITIZE_SSTAT_MVCNCLD_MASKβ mask to get the value of the Media Verification Canceled bit of the Sanitize status field.NVME_SANITIZE_SSTAT_PRGD_SHIFTβ shift amount to get the Purged (PRGD) bit of the Sanitize status field π§ΉNVME_SANITIZE_SSTAT_PRGD_MASKβ mask to get the Purged (PRGD) bit of the Sanitize status field.NVME_SANITIZE_SSTAT_PRGDβ Purged: if this is set, then the most recent sanitize operation purged user data, as defined by IEEE Std 2883, because the Purge Required (PREQ) bit was set to sanitize operation. Iconic. Certified clean π
Heads up bestie π«Ά β these are bit-level*_SHIFT/*_MASKpairs, so always shift-then-mask on the actualsstatfield. Don't freestyle it, the manual says what it says and we're not adding lore that isn't there π
π Sign-off π
That's the whole page, babes! This little beauty is the enum nvme_sanitize_sstat page from the libnvme API Manual, dated October 2026 β go forth, mask your bits, and slay β¨π¦π
π¦ 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