mtree_store(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… mtree_store β€” store an entry at a given index, bestie ✨

okay so this is a page from the Kernel API Manual (section 9, the kernel-functions girlies 🌸), and it's literally about dropping one single entry into a maple tree at a specific index. short page, but she matters. let's get into it 🫢


✨ SYNOPSIS ✨

int mtree_store (struct maple_tree *mt , unsigned long index , void
*entry , gfp_t gfp );

that's the whole vibe: returns an int, takes four things. slay. πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • mt β€” the maple tree 🌳 like, the actual struct maple_tree you're messing with. main character energy fr.
  • index β€” the index where the value goes. this is where the thing lives, bestie, choose wisely ✨
  • entry β€” the entry you're storing. the payload. the moment. πŸ‘‘
  • gfp β€” the GFP_FLAGS used for allocations 🧚 if you don't know what those are, that's a whole other manpage, iykyk.

πŸ’– RETURN πŸ’–

  • 0 β€” on success πŸŽ‰ slay, it worked, we love a zero.
  • -EINVAL β€” on an invalid request πŸ™ˆ not me passing something the tree can't handle.
  • -ENOMEM β€” if memory could not be allocated πŸ’€ the allocator said no and honestly same.

πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./lib/maple_tree.c πŸ“ and like... her entire extended friend group:

like, that's the whole group chat right there 😭 go read them, they're iconic, periodt. πŸ’œ


ngl the whole node lives in ./lib, and it's dated October 2026 ⭐ so if you're reading this from the future: hi bestie, hope the maple tree is thriving 🌈

stay hydrated, preallocate responsibly, and remember: every entry deserves its own index πŸŽ€πŸ’–βœ¨

πŸ“¦ where this page comes from