libnvme(2)

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

okay so you opened a man page from libnvme and it's giving very specific, very niche, very iconic. we're talking the raw API layer here. sit down, grab a boba, let's go πŸ§‹βœ¨


✨ NAME ✨

enum nvme_id_ctrl_trattr β€” Tracking Attributes

like… the tracking attributes, bestie. it's right there in the name. πŸ’…


🌸 SYNOPSIS 🌸

enum nvme_id_ctrl_trattr {
    NVME_CTRL_TRATTR_THMCS_SHIFT ,
    NVME_CTRL_TRATTR_TUDCS_SHIFT ,
    NVME_CTRL_TRATTR_MRTLL_SHIFT ,
    NVME_CTRL_TRATTR_THMCS_MASK ,
    NVME_CTRL_TRATTR_TUDCS_MASK ,
    NVME_CTRL_TRATTR_MRTLL_MASK

};

no cap, that's the whole enum. six members, zero drama, all vibes. πŸ¦‹


πŸ‘‘ Constants πŸ‘‘

🌈 the SHIFTs

  • NVME_CTRL_TRATTR_THMCS_SHIFT β€” this is the shift amount you use to pull the Track Host Memory Changes Support out of the struct nvme_id_ctrl.trattr field. shifting is the whole move here, fr fr. 🫢
  • NVME_CTRL_TRATTR_TUDCS_SHIFT β€” shift amount for getting the Track User Data Changes Support out of that same struct nvme_id_ctrl.trattr field. yes, same field, different little slice. it's giving "sharing is caring". πŸ’œ
  • NVME_CTRL_TRATTR_MRTLL_SHIFT β€” shift amount to grab the Memory Range Tracking Length Limit from struct nvme_id_ctrl.trattr. the limit!! the range!! the tracking!! 😭

πŸ’… the MASKs

  • NVME_CTRL_TRATTR_THMCS_MASK β€” a mask that gets you the Track Host Memory Changes Support from the struct nvme_id_ctrl.trattr field. mask + shift = the classic duo, they ate. ⭐
  • NVME_CTRL_TRATTR_TUDCS_MASK β€” mask for pulling the Track User Data Changes Support out of struct nvme_id_ctrl.trattr. apply it, get the bits, main character energy. πŸ”₯
  • NVME_CTRL_TRATTR_MRTLL_MASK β€” the mask that gets you the Memory Range Tracking Length Limit from struct nvme_id_ctrl.trattr. last one, but definitely not least. πŸ’–

vibe check: every single one of these constants is reading out of the exact same field β€” struct nvme_id_ctrl.trattr β€” just different slices of it. shifts move you there, masks isolate the bits. iykyk. πŸ™ˆ

and that's the whole page, bestie β€” you understood it, you slayed it, periodt. πŸŽ€

this little gem is from the libnvme API Manual, and it's dated July 2026 β€” page libnvme(2), section enum nvme_id_ctrl_trattr. obsessed with her honestly. πŸŒΈπŸ¦‹βœ¨

πŸ“¦ where this page comes from