find_inode_rcu(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– find_inode_rcu(9) β€” Kernel API Manual πŸ’–

hey bestie 🫢 welcome to the Kernel API Manual page for find_inode_rcu(9). this is the inode-cache search function, and yes, it’s giving β€œfind the matching inode and don’t do anything cursed” energy. let’s go. ✨

✨ NAME ✨

find_inode_rcu β€” find an inode in the inode cache. that’s it, that’s the assignment, and it ate. πŸ’…

🌸 SYNOPSIS 🌸

struct inode * find_inode_rcu (struct super_block *sb , u64 hashval ,
       int (*test)(struct inode *, void *) , void *data );

πŸŽ€ ARGUMENTS πŸŽ€

okay so here’s who’s who in this function’s group chat:

  • sb β€” Super block of file system to search. it’s the super block of the file system you’re searching, bestie. πŸ¦‹
  • hashval β€” Key to hash. the hash key for the search. πŸ”‘
  • test β€” Function to test match on an inode. this is the matchmaker. πŸ’…
  • data β€” Data for test function. the lil extra data that gets handed to test. πŸŽ€

πŸ’œ DESCRIPTION πŸ’œ

Search for the inode specified by hashval and data in the inode cache, where the helper function test will return 0 if the inode does not match and 1 if it does. so test is basically doing the vibe check: 0 = nope, 1 = yes bestie. πŸ’…

the test function must be responsible for taking the i_lock spin_lock and checking i_state for an inode being freed or being initialized. that responsibility is literally on test, no cap. 🫢

If successful, this will return the inode for which the test function returned 1 and NULL otherwise. no extra little treats, just the matching inode or NULL. ✨

The test function is not permitted to take a ref on any inode presented. It is also not permitted to sleep. and the caller must hold the RCU read lock. this is highkey not optional, bestie. 🚨

πŸ”Ž SEE ALSO πŸ”Ž

Kernel file ./fs/inode.c β€” plus the whole friend group:


made with πŸ’– by ./fs, October 2026 β€” find_inode_rcu(9), out. mwah πŸ’‹

πŸ“¦ where this page comes from