XA_STATE_ORDER(9)
π XA_STATE_ORDER π
okay so bestie, welcome to XA_STATE_ORDER(9) from the Kernel API Manual β yes we're reading kernel docs together, this is our era π
β¨ NAME β¨
XA_STATE_ORDER β literally just declares an XArray operation state. that's it. that's the whole job. queen behavior honestly π
πΈ SYNOPSIS πΈ
XA_STATE_ORDER (name , array , index , order );
yes the spacing is a little chaotic, we don't judge, we copy it exactly π«Ά
π¦ ARGUMENTS π¦
nameβ what you're calling this operation state. the docs say it's usuallyxas, and honestly? iconic naming convention, no notes.arrayβ the array you wanna operate on. the main character of this whole situation.indexβ the initial index of interest. where the vibes begin.orderβ the order of the entry. yes it's a real parameter, yes you need it, no you can't skip it π
π DESCRIPTION π
so what this does: it declares and initialises an xa_state on the stack. right there, on your stack, no malloc, no drama β¨
this one is the variant of XA_STATE that lets you specify the 'order' of the element you actually want to operate on β that's the whole flex. same energy as XA_STATE, just with the order knob turned on π₯
ngl the original source ends that sentence with a lil stray ` and honestly? we're keeping it, it's part of the lore π it's giving "shipped on a friday" energy and we respect it
π SEE ALSO π
the kernel file lives at ./include/linux/xarray.h and bestie, the friend group is huge. every single one of these, no cap, go look at them:
xa_mk_value(9)xa_to_value(9)xa_is_value(9)xa_tag_pointer(9)xa_untag_pointer(9)xa_pointer_tag(9)xa_is_zero(9)xa_is_err(9)xa_err(9)struct xa_limit(9)struct xarray(9)DEFINE_XARRAY_FLAGS(9)DEFINE_XARRAY(9)DEFINE_XARRAY_ALLOC(9)DEFINE_XARRAY_ALLOC1(9)xa_init_flags(9)xa_init(9)xa_empty(9)xa_marked(9)xa_for_each_range(9)xa_for_each_start(9)xa_for_each(9)xa_for_each_marked(9)xa_store_bh(9)xa_store_irq(9)xa_erase_bh(9)xa_erase_irq(9)xa_cmpxchg(9)xa_cmpxchg_bh(9)xa_cmpxchg_irq(9)xa_insert(9)xa_insert_bh(9)xa_insert_irq(9)xa_alloc(9)xa_alloc_bh(9)xa_alloc_irq(9)xa_alloc_cyclic(9)xa_alloc_cyclic_bh(9)xa_alloc_cyclic_irq(9)xa_reserve(9)xa_reserve_bh(9)xa_reserve_irq(9)xa_release(9)xa_is_sibling(9)xa_is_retry(9)xa_is_advanced(9)xa_update_node_t(9)XA_STATE(9)xas_error(9)xas_set_err(9)xas_invalid(9)xas_valid(9)xas_is_node(9)xas_reset(9)xas_retry(9)xas_reload(9)xas_set(9)xas_advance(9)xas_set_order(9)xas_set_update(9)xas_next_entry(9)xas_next_marked(9)xas_for_each(9)xas_for_each_marked(9)xas_for_each_conflict(9)xas_prev(9)xas_next(9)
π real talk though: knowing xas_set_order(9) exists is like finding out your fave has a sibling who's also famous. go read them all. iykyk π
and that's the page !! source is ./include/linux, dated October 2026 β mwah, slay, go write some xarray code bestie π§ββοΈβπ
π¦ 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