__xa_store(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ __xa_store(9) β€” the Kernel API Manual glow-up ✨

okay so bestie, welcome to the __xa_store(9) page from the Kernel API Manual πŸ’… this is the one that literally puts your entry into the XArray, and yes she has rules. buckle up πŸŽ€


🌸 NAME 🌸

__xa_store β€” Store this entry in the XArray. periodt ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

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

πŸ’– ARGUMENTS πŸ’–

  • xa β€” your XArray. the main character fr 🌈
  • index β€” the index into that array. like, where in the array, yk? πŸ‘‘
  • entry β€” the new entry. the newbie. the fresh face ✨
  • gfp β€” memory allocation flags. lowkey important, don't skip her πŸ™ˆ

🌼 DESCRIPTION 🌼

okay so HARD REQUIREMENT first: you must already be holding the xa_lock when you call this function. no cap, that's the deal πŸ’€

and then β€” plot twist β€” she will drop the lock if she needs to allocate memory, and then reacquire it afterwards. so yeah, she's a little dramatic, but she comes back 🫢


🧚 CONTEXT 🧚

Any context, bestie. any. πŸ’«

she expects xa_lock to be held on entry, and she may release and reacquire xa_lock if the gfp flags permit. that's the whole vibe check βœ…


⭐ RETURN ⭐

she hands you back the old entry at this index, or xa_err if something went wrong 😭 (so like, check for the error, bestie, please πŸ™)


πŸ’œ SEE ALSO πŸ’œ

all her friends, in the kernel file ./lib/xarray.c β€” icon behavior only πŸ‘‘


πŸ’€ reminder bestie: hold xa_lock before you call her, she's not doing the lock acquisition for you, and she might drop it and grab it again mid-call. plan accordingly 🫢

and that's the whole page, slay πŸ’… this came out of ./lib and she's dated October 2026 β€” stay hydrated, lock your xarray, and go store some entries, bestie πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from