libnvme(2)

πŸ’– libnvme(2) β€” API Manual πŸ’–

okay so bestie, welcome to libnvme section 2, the API manual, and today's main character is enum nvme_id_ctrl_fna. it's giving "controller attributes, but make it FNA" ✨


✨ NAME ✨

enum nvme_id_ctrl_fna β€” this field tells you the attributes for the Format NVM command πŸŽ€

(yeah that's it. that's the whole name. short king.)


🌸 SYNOPSIS 🌸

enum nvme_id_ctrl_fna {
    NVME_CTRL_FNA_FMT_ALL_NS_SHIFT ,
    NVME_CTRL_FNA_SEC_ALL_NS_SHIFT ,
    NVME_CTRL_FNA_CES_SHIFT ,
    NVME_CTRL_FNA_NSID_ALL_F_SHIFT ,
    NVME_CTRL_FNA_FMT_ALL_NS_MASK ,
    NVME_CTRL_FNA_SEC_ALL_NS_MASK ,
    NVME_CTRL_FNA_CES_MASK ,
    NVME_CTRL_FNA_NSID_ALL_F_MASK ,
    NVME_CTRL_FNA_FMT_ALL_NAMESPACES ,
    NVME_CTRL_FNA_SEC_ALL_NAMESPACES ,
    NVME_CTRL_FNA_CRYPTO_ERASE ,
    NVME_CTRL_FNA_NSID_FFFFFFFF

};

like, look at her. twelve members. absolutely iconic. no cap, she's just a lil enum holding a whole bunch of bit knowledge πŸ’…


πŸ¦‹ Constants πŸ¦‹

  • NVME_CTRL_FNA_FMT_ALL_NS_SHIFT β€” the shift amount you use to get the format applied to all namespaces 🫢
  • NVME_CTRL_FNA_SEC_ALL_NS_SHIFT β€” the shift amount you use to get the secure erase applied to all namespaces ✨
  • NVME_CTRL_FNA_CES_SHIFT β€” the shift amount you use to get the cryptographic erase supported thing πŸ”
  • NVME_CTRL_FNA_NSID_ALL_F_SHIFT β€” the shift amount you use to get the format supported an NSID FFFFFFFFh bit πŸ‘€
  • NVME_CTRL_FNA_FMT_ALL_NS_MASK β€” the mask that gets you the format applied to all namespaces πŸŽ€
  • NVME_CTRL_FNA_SEC_ALL_NS_MASK β€” the mask that gets you the secure erase applied to all namespaces πŸ’–
  • NVME_CTRL_FNA_CES_MASK β€” the mask that gets you the cryptographic erase supported πŸ’«
  • NVME_CTRL_FNA_NSID_ALL_F_MASK β€” the mask that gets you the format supported an NSID FFFFFFFFh bit 🌈

🌟 and now the actual bit definitions, bestie 🌟

  • NVME_CTRL_FNA_FMT_ALL_NAMESPACES β€” if this is set, then all namespaces in an NVM subsystem shall be configured with the same attributes, and a format (excluding secure erase) of any namespace results in a format of all namespaces in the NVM subsystem πŸ”₯ if it's cleared, then the controller supports format on a per namespace basis. it's giving "all for one" energy fr fr
  • NVME_CTRL_FNA_SEC_ALL_NAMESPACES β€” if this is set, then any secure erase performed as part of a format operation results in a secure erase of all namespaces in the NVM subsystem 🧹πŸ’₯ if it's cleared, then any secure erase performed as part of a format results in a secure erase of the particular namespace specified. so like, targeted destruction vs. group project. pick your fighter.
  • NVME_CTRL_FNA_CRYPTO_ERASE β€” if this is set, then cryptographic erase is supported βœ… if it's cleared, then cryptographic erase is not supported ❌ that's it. that's the whole vibe check.
  • NVME_CTRL_FNA_NSID_FFFFFFFF β€” if this is set, then format does not support nsid value set to FFFFFFFFh 😭 if it's cleared, format does support nsid value set to FFFFFFFFh πŸ™Œ yes the polarity is backwards from what your brain wants. no, we don't make the rules. the spec makes the rules. πŸ’€

🫢 gentle reminder bestie: these are bit fields in the Format NVM attributes field of the Identify Controller data structure β€” set vs. cleared genuinely flips the meaning on NVME_CTRL_FNA_NSID_FFFFFFFF, so read twice, ship once. you got this, queen πŸ‘‘

🌈 SEE ALSO 🌈

literally the rest of the libnvme(2) API manual, because this enum does not exist in a vacuum, bestie πŸ¦‹


and that's the whole page, my love πŸ’– this was enum nvme_id_ctrl_fna from the libnvme API manual, dated July 2026, and yeah β€” footer says the same thing, because of course it does. slay, go format something responsibly πŸ‘‘βœ¨

πŸ“¦ where this page comes from