xa_store(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ xa_store(9) ✨

okay so this is a page from the Kernel API Manual β€” yes, the Kernel API Manual, we're in the big leagues now bestie πŸ’…


πŸ’– NAME πŸ’–

xa_store β€” store this entry in the XArray. that's it. that's the whole vibe. one job, and it does it πŸŽ€


🌸 SYNOPSIS 🌸

void * xa_store (struct xarray *xa , unsigned long index , void *entry ,
gfp_t gfp );

look at her. four little arguments. iconic behavior fr fr ✨


πŸ¦‹ ARGUMENTS πŸ¦‹

  • xa β€” the XArray. your main character. the whole point 🫢
  • index β€” index into array. like, where in the array we're talking about, yk?
  • entry β€” new entry. the thing you're putting in there. slay πŸ’–
  • gfp β€” memory allocation flags. the rules of the game for grabbing memory 😌

πŸ‘‘ DESCRIPTION πŸ‘‘

so after this function returns, loads from this index will return entry. no cap, that's the guarantee β€” you put it there, you get it back ✨

storing into an existing multi-index entry updates the entry of every index. like, all of them. not just one. every single one, bestie 😭

the marks associated with index are unaffected β€” unless entry is NULL. that's the one exception, and it's lowkey important, so don't come for me when i say it twice: unaffected unless entry is NULL πŸ’€


πŸ”₯ CONTEXT πŸ”₯

any context. literally any. takes and releases the xa_lock πŸ”’ β€” yes she locks, she's responsible like that.

may sleep if the gfp flags permit 😴 so like, know your flags, iykyk.


⭐ RETURN ⭐

here's what you get back:

  • the old entry at this index on success πŸŽ‰
  • xa_err(-EINVAL) if entry cannot be stored in an XArray πŸ™ˆ
  • xa_err(-ENOMEM) if memory allocation failed πŸ’€

wrap those last two in xa_err() before you check them, alright? that's not me being extra, that's just how it is 🧚


🌈 SEE ALSO 🌈

okay this list is long and honestly kind of a flex πŸ‘‘

kernel file ./lib/xarray.c

then, in order, because we do not skip:

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_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 i said. she has friends πŸ’œ


and that's the whole page, bestie 🫢 go forth and store your entries responsibly ✨

this lil masterpiece lives in ./lib, it's dated October 2026, and it's filed under xa_store(9) πŸŽ€ mwah πŸ’‹

πŸ“¦ where this page comes from