xa_store_range(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 gfp flags permit. so like... she can nap, but only if you said it was okay 😴

⭐ RETURN ⭐

  • NULL on success πŸŽ‰
  • xa_err(-EINVAL) if entry cannot 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:

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