xas_try_split(9)
π
xas_try_split β the xas_try_split(9) glow-up π¦
okay so bestie, welcome to the kernel API manual β¨ this one's a <pink>function<//pink>page, bestie βxas_try_split`, part of the whole XArray situation. buckle up, it's short but it's mighty. π
πΈ NAME πΈ
xas_try_split β try to split a multi-index entry. that's it. that's the vibe. π
β¨ SYNOPSIS β¨
void xas_try_split (struct xa_state *xas , void *entry , unsigned int
order );
like, the whole signature, no notes. π
π«Ά ARGUMENTS π«Ά
xasβ the XArray operation state. the main character of this whole thing, lowkey.entryβ the new entry you're storing in the array. the new kid. πorderβ the current entry order. yes it matters. no you can't skip it.
π DESCRIPTION π
okay so here's the tea β: the size of the new entries is set in xas. then the value in entry gets copied to all the replacement entries β every single one, no cap. π«‘
and here's the specific bit, listen up: if and only if exactly one new xa_node is needed, the function will use GFP_NOWAIT to get one, but only if xas->xa_alloc is NULL. if more new xa_nodes are needed than that? the function gives an EINVAL error. literally just says no. π
π§ NOTE π§
use xas_try_split_min_order to get the next split order instead of order - 1 if you want to minimize xas_try_split calls. like, fewer calls, fewer problems, iykyk. β¨
π CONTEXT π
Any context. but the caller should hold the xa_lock. π so like, hold it. don't be weird about it. π
β SEE ALSO β
Kernel file ./lib/xarray.c β and the whole friend group, fr fr:
xas_load(9),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_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)
that's the whole roster, every last one. πΈπ¦
okay that's the page!! π this little angel lives in ./lib, and the version/date sitch is October 2026 β so yeah, mark your calendar bestie, it's giving future icon. πβ¨ periodt. π
π¦ 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