STRUCT XA_LIMIT(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct xa_limit(9) β€” like, the whole manual, bestie

okay so first things first: this is a page out of the Kernel API Manual, and the star of the show is struct xa_limit. it lives in the kernel, it's fancy, it's giving "ID bouncer at the club" energy. let's get into it 🫢


✨ NAME ✨

struct xa_limit β€” literally just represents a range of IDs. that's it. that's the whole vibe. πŸŽ€


🌸 SYNOPSIS 🌸

struct xa_limit {
    u32 max;
    u32 min;
 };

yes bestie, that's the entire struct. two little u32s and a dream. πŸ’–


πŸ¦‹ Members πŸ¦‹

  • max β€” the maximum ID you're allowed to allocate, and it's inclusive (so like, max itself gets an invite to the party too, no cap).
  • min β€” the lowest ID you're allowed to allocate, also inclusive (yes min is invited as well, it's only fair ✨).

πŸ‘‘ DESCRIPTION πŸ‘‘

so the way this works: this structure gets used either directly or via the XA_LIMIT macro to communicate the range of IDs that are valid for allocation. that's its whole job and it does it slayfully. πŸ’…

and here's the good part β€” three common ranges are already predefined for you, no assembly required:

  • xa_limit_32b β€” [0 - UINT_MAX]
  • xa_limit_31b β€” [0 - INT_MAX]
  • xa_limit_16b β€” [0 - USHRT_MAX]

three little presets, all iconic, all just sitting there waiting for you. πŸ”₯


πŸ” SEE ALSO πŸ”

okay this next part is a lot but we don't skip, we don't scroll past, we read every single one. it's all in the kernel file ./include/linux/xarray.h, and honestly the whole xarray friend group showed up:

like I said. everyone came. 🧚


ngl bestie, remember the inclusive thing on min and max β€” both endpoints get allocated, that's the whole point of the range πŸ“

and that's the page!! sourced from ./include/linux, dated October 2026, and published under the struct xa_limit(9) banner in the Kernel API Manual πŸ’œ go read your xarray docs, ily, bye!! 🌈⭐

πŸ“¦ where this page comes from