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 frNVME_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 toFFFFFFFFhπ if it's cleared, format does support nsid value set toFFFFFFFFhπ 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
- 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