xas_try_split(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… xas_try_split β€” the xas_try_split(9) glow-up πŸ¦‹

okay so bestie, welcome to the kernel API manual ✨ this one's a <pink>function<//pink>page, bestie β€”xas_try_split`, part of the whole XArray situation. buckle up, it's short but it's mighty. πŸŽ€


🌸 NAME 🌸

xas_try_split β€” try to split a multi-index entry. that's it. that's the vibe. πŸ’…


✨ SYNOPSIS ✨

void xas_try_split (struct xa_state *xas , void *entry , unsigned int
order );

like, the whole signature, no notes. πŸ‘‘


🫢 ARGUMENTS 🫢

  • xas β€” the XArray operation state. the main character of this whole thing, lowkey.
  • entry β€” the new entry you're storing in the array. the new kid. πŸ“
  • order β€” the current entry order. yes it matters. no you can't skip it.

πŸ’– DESCRIPTION πŸ’–

okay so here's the tea β˜•: the size of the new entries is set in xas. then the value in entry gets copied to all the replacement entries β€” every single one, no cap. 🫑

and here's the specific bit, listen up: if and only if exactly one new xa_node is needed, the function will use GFP_NOWAIT to get one, but only if xas->xa_alloc is NULL. if more new xa_nodes are needed than that? the function gives an EINVAL error. literally just says no. πŸ’€


🧚 NOTE 🧚

use xas_try_split_min_order to get the next split order instead of order - 1 if you want to minimize xas_try_split calls. like, fewer calls, fewer problems, iykyk. ✨


🌈 CONTEXT 🌈

Any context. but the caller should hold the xa_lock. πŸ”’ so like, hold it. don't be weird about it. πŸ™ˆ


⭐ SEE ALSO ⭐

Kernel file ./lib/xarray.c β€” and the whole friend group, fr fr:

that's the whole roster, every last one. πŸŒΈπŸ¦‹


okay that's the page!! πŸ’œ this little angel lives in ./lib, and the version/date sitch is October 2026 β€” so yeah, mark your calendar bestie, it's giving future icon. πŸ‘‘βœ¨ periodt. πŸŽ€

πŸ“¦ where this page comes from