libnvme(9)

πŸ“¦ version 3.2, in arch rolling

πŸ’… 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 the struct nvme_sanitize_log_page.sstat field. 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 to 0h if 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 the struct nvme_sanitize_log_page.sstat field.
  • 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 / *_MASK pairs, so always shift-then-mask on the actual sstat field. 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