xa_store_range(9)
π xa_store_range β like, the kernel API manual, but make it make sense
okay so bestie, we're in the Kernel API Manual today and the star of the show is xa_store_range(9). Buckle up. π
β¨ NAME β¨
xa_store_range β store this entry at a whole range of indices in the XArray. yeah. a range. not one index. a whole squad of them. π
πΈ SYNOPSIS πΈ
void * xa_store_range (struct xarray *xa , unsigned long first ,
unsigned long last , void *entry , gfp_t gfp );
look at her. five arguments. she's doing the most and honestly? she ate. π₯
π¦ ARGUMENTS π¦
xaβ the XArray. that's the thing we're storing into, bestie, keep up π«Άfirstβ the first index to affect. the beginning of the era, if you will.lastβ the last index to affect. the end of the era. it is inclusive, iykyk.entryβ the new entry. the moment. the main character.gfpβ memory allocation flags. basically the vibe check for how we're allowed to allocate memory π
π DESCRIPTION π
okay so here's the tea β β after this function returns, loads from any index between first and last, inclusive, will return entry. every single one. no cap. literally all of them. β¨
and if you store into an existing multi-index entry? it updates the entry of every index. the way that it just goes and updates all of them... iconic. π
one thing though β the marks associated with the index are unaffected, unless entry is NULL. so if you're passing NULL in there, bestie, the marks are catching strays. just so you know. π
π§ CONTEXT π§
- Process context. π«§
- It takes and releases the
xa_lock. she's responsible like that. - It may sleep if the
gfpflags permit. so like... she can nap, but only if you said it was okay π΄
β RETURN β
NULLon success πxa_err(-EINVAL)ifentrycannot be stored in an XArray πxa_err(-ENOMEM)if memory allocation failed π
fr fr check your return value. don't just assume it slayed.
π SEE ALSO π
Kernel file ./lib/xarray.c, plus the whole friend group:
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_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),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 extended family showed up to the function. we love a supportive cast π«Άπ
and that's the whole page, bestie β¨ this one lives in ./lib and it's dated October 2026 β so yeah, go off, see you in the future ππ
π
π¦ 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