xas_load(9)
β¨ 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:
xas_nomem(9),xas_free_nodes(9),xas_create_range(9),xas_store(9)xas_get_mark(9),xas_set_mark(9),xas_clear_mark(9),xas_init_marks(9)xas_split_alloc(9),xas_split(9),xas_try_split_min_order(9),xas_try_split(9)xas_pause(9),xas_find(9),xas_find_marked(9),xas_find_conflict(9)xa_load(9),__xa_erase(9),xa_erase(9)__xa_store(9),xa_store(9),__xa_cmpxchg(9),__xa_insert(9),xa_store_range(9)xas_get_order(9),xa_get_order(9)__xa_alloc(9),__xa_alloc_cyclic(9)__xa_set_mark(9),__xa_clear_mark(9),xa_get_mark(9),xa_set_mark(9),xa_clear_mark(9)xa_find(9),xa_find_after(9),xa_extract(9),xa_delete_node(9),xa_destroy(9)
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms