cache_subtree_search(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ cache_subtree_search(9) ✨

okay bestie so we're diving into the Kernel API Manual today β€” this one's cache_subtree_search(9) and it's literally the little function that goes hunting through the cache tree for your key πŸ”πŸ’–


🌸 NAME 🌸

cache_subtree_search β€” Search for a key in the cache tree.

like... it searches, babes. that's the whole gig πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

struct rb_node * cache_subtree_search (struct pcache_cache_subtree
*cache_subtree , struct pcache_cache_key *key , struct rb_node **parentp
, struct rb_node ***newp , struct list_head *delete_key_list );

not me presenting you with five parameters, but honestly she ate πŸŽ€


πŸŽ€ ARGUMENTS πŸŽ€

  • cache_subtree β€” Pointer to the cache tree structure. your main character tree, the one we're searching ✨
  • key β€” Pointer to the cache key to search for. the thing we're looking for, bestie, like when you can't find your airpods but they're literally in your pocket πŸ™ˆ
  • parentp β€” Pointer to store the parent node of the found node. this is where the parent of the found node goes πŸ’–
  • newp β€” Pointer to store the location where the new node should be inserted. yes it's a triple pointer. yes we're both going through it 😭 but she's storing where the new node should be inserted, slay
  • delete_key_list β€” List to collect invalid keys for deletion. the ✨cleanup committee✨ β€” anything invalid found along the way gets tossed in here

πŸ’… DESCRIPTION πŸ’…

so here's the vibe 🌈 this function searches the cache tree for a specific key and returns the node that is the predecessor of the key β€” or the first node if the key is less than all keys in the tree. lowkey iconic behavior honestly πŸ‘‘

and if any invalid keys are found during the search, they get added to the delete_key_list for later cleanup. no cap, we clean as we go 🧹✨

and like, the whole point: it returns a pointer to the previous node. struct rb_node * out the door, periodt πŸ’€

πŸ”₯ SEE ALSO πŸ”₯

iykyk, go read all of them, they're a whole friend group fr fr πŸ«ΆπŸ¦‹


πŸ’œ okay that's the page!! this little manual lives in ./drivers/md/dm-pcache and it's dated October 2026 β€” shoutout to the kernel docs from the future, we love to see it ⭐🌸 mwah, go search some trees bestie πŸŽ€πŸ’–

πŸ“¦ where this page comes from