xa_find_after(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… xa_find_after β€” like, the whole vibe πŸ’…

okay so bestie, welcome to the Kernel API Manual page for xa_find_after(9) β€” yes it's a section 9 manpage, yes it's about XArrays, and yes you're gonna slay this. πŸ¦‹


✨ NAME ✨

xa_find_after β€” Search the XArray for a present entry. That's it, that's the whole job. πŸ’–


πŸŽ€ SYNOPSIS πŸŽ€

void * xa_find_after (struct xarray *xa , unsigned long *indexp ,
       unsigned long max , xa_mark_t filter );

no cap, that's the whole signature. copy it exactly, don't be cute with it. πŸ™ˆ


🌸 ARGUMENTS 🌸

  • xa β€” the XArray. the main character. everything happens in here. πŸ‘‘
  • indexp β€” a pointer to an index. like, a pointer pointer. it gets updated, so pay attention. ✨
  • max β€” the maximum index to search to. that's your ceiling, do not exceed. πŸ’…
  • filter β€” the selection criterion. it's giving "what are we even looking for" energy. 🎯

πŸ’œ DESCRIPTION πŸ’œ

so what it does: it finds the entry in xa which matches the filter and has the lowest index that is above indexp and no more than max. lowkey a whole little search algorithm, highkey iconic. πŸ”₯

and when it finds one? indexp gets updated to be the index of that entry. slay. so your pointer walks forward with you. 🫢

⚠️ okay important caveat, don't skip this: this function is protected by the RCU read lock, so it may miss entries which are being simultaneously added. so like, it's fast, but it can ghost you mid-scan. not its fault. 😭

also β€” and this matters β€” it will not return an XA_RETRY_ENTRY. if you need to see retry entries, use xas_find. periodt. πŸ’€


⭐ CONTEXT ⭐

Any context. literally any. it takes and releases the RCU lock, so it's polite like that. 🧚


🌈 RETURN 🌈

The pointer, if found, otherwise NULL. that's the whole deal. found = pointer, not found = NULL, no in-between, no dramatic reveal. πŸ’–


πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./lib/xarray.c β€” and honestly the whole friend group, go say hi:

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), 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_extract(9), xa_delete_node(9), xa_destroy(9)


and that's the page!! πŸ’…βœ¨ this little gem lives in ./lib and it's dated October 2026 β€” so yeah, mark your calendar bestie, go read xa_find_after(9) and thrive. πŸ“πŸ¦‹πŸ’–

πŸ“¦ where this page comes from