libnvme(2)

πŸ‘‘ libnvme β€” API Manual, section 2 πŸŽ€

okay bestie, welcome to libnvme's manual page, section 2, and today's main character is literally one little enum. yes, an enum. and no, I'm not being dramatic β€” it's giving "quietly runs your entire NVMe format situation" energy. let's get into it πŸ’…


✨ NAME ✨

enum nvme_flbas β€” this field indicates the formatted LBA size πŸ¦‹

like. that's the whole vibe. the FLBAS field. it's the one telling you what LBA size you're formatted to. iconic behavior fr fr.


🌸 SYNOPSIS 🌸

enum nvme_flbas {
    NVME_FLBAS_LOWER_SHIFT ,
    NVME_FLBAS_META_EXT_SHIFT ,
    NVME_FLBAS_HIGHER_SHIFT ,
    NVME_FLBAS_LOWER_MASK ,
    NVME_FLBAS_META_EXT_MASK ,
    NVME_FLBAS_HIGHER_MASK

};

six entries. three shifts, three masks. that's it, that's the whole enum, and honestly? slay. 🌈


⭐ Constants ⭐

bestie, this is where the lore lives. each one of these is a shift amount or a mask for pulling apart the FLBAS field, so let me break them down one by one like the devoted bestie I am 🫢

  • NVME_FLBAS_LOWER_SHIFT β€” the shift amount you use to get the format index's least significant 4 bits πŸ’–
  • NVME_FLBAS_META_EXT_SHIFT β€” the shift amount to get the metadata transferred ✨
  • NVME_FLBAS_HIGHER_SHIFT β€” the shift amount to get the format index's most significant 2 bits πŸ‘‘
  • NVME_FLBAS_LOWER_MASK β€” the mask to get the format index's least significant 4 bits πŸŽ€
  • NVME_FLBAS_META_EXT_MASK β€” the mask to get the metadata transferred 🌸
  • NVME_FLBAS_HIGHER_MASK β€” the mask to get the format index's most significant 2 bits πŸ’œ
so if you ever forget: the format index is literally split across two spots β€” LOWER (the bottom 4 bits) and HIGHER (the top 2 bits) β€” and META_EXT is doing its own little thing about metadata transferred. mask it, shift it, boom, you're done. no cap. πŸ”₯

and that's the page!! thanks for reading my little enum TED talk, bestie πŸ§šπŸ’– this was enum nvme_flbas out of libnvme(2), and this cutie dropped back in July 2026. go format something responsibly, mwah πŸ’…βœ¨

πŸ“¦ where this page comes from