xas_load(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ xas_load(9) ✨

okay so this is a page from the Kernel API Manual, and today's main character is xas_load(9) β€” the advanced XArray entry-loader. yes bestie, we're going advanced. buckle up πŸŽ€


🌸 NAME 🌸

xas_load β€” load an entry from the XArray, but like, the advanced version πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

void * xas_load (struct xa_state *xas );

πŸ“ ARGUMENTS πŸ“

  • xas β€” the XArray operation state. that's the whole vibe, she carries the context ✨

πŸ’– DESCRIPTION πŸ’–

Usually this function walks the xas to the appropriate state so it can load the entry stored at xa_index. so far so normal, right?

BUT β€” plot twist 🫒 β€” it will do nothing and return NULL if xas is in an error state. like, she sees the error flag and goes "not today," respectfully.

Also important: xas_load will never expand the tree. no new branches, no growth spurt, nothing. she just looks at what's already there, no cap 🚫🌱

And if the xa_state is set up to operate on a multi-index entry, xas_load may return NULL or an internal entry β€” even if there are actual entries present within the range specified by xas. yeah. it's giving "it's complicated." 😭 so don't come for her when the multi-index case does multi-index things.


πŸ”₯ CONTEXT πŸ”₯

Any context at all β€” she's flexible like that πŸ’β€β™€οΈ BUT the caller should hold the xa_lock or the RCU lock. that part is not optional, bestie, hold the lock πŸ™


⭐ RETURN ⭐

Usually an entry in the XArray πŸŽ‰ β€” but peep the description for the exceptions, because there totally are exceptions and we don't gatekeep. πŸ‘‘


🌈 SEE ALSO 🌈

Kernel file ./lib/xarray.c, plus the whole friend group:

like, the entire XArray extended universe. she knows everybody 🫢


lowkey reminder: error state β†’ NULL, and no tree expansion, ever. write that down πŸ“

and that's the page!! brought to you by the fine folks under ./lib, stamped October 2026, and signed xas_load(9) πŸ’œ stay locked (xa_lock or RCU, you know the drill), stay slay, and may all your entries load on the first try πŸ§šβœ¨πŸŽ€

πŸ“¦ where this page comes from