ilookup5_nowait(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… ilookup5_nowait(9) β€” like, the inode-cache search girlie

okay so this is a page from the Kernel API Manual (9 section, kernel girlies know) and it's all about ilookup5_nowait β€” searching for an inode in the inode cache, but make it unbothered ✨


πŸŽ€ NAME πŸŽ€

ilookup5_nowait β€” search for an inode in the inode cache. that's it, that's the vibe πŸ¦‹


✨ SYNOPSIS ✨

struct inode * ilookup5_nowait (struct super_block *sb , u64 hashval ,
int (*test)(struct inode *, void *) , void *data , bool *isnew );

like, look at her. five args, no waiting, main character energy πŸ‘‘


🌸 ARGUMENTS 🌸

  • sb β€” the super block of the file system you're searching, bestie. that's your whole search domain πŸ’–
  • hashval β€” the hash value (usually the inode number) you're looking for ✨
  • test β€” the callback used for comparisons between inodes. it's the little matchmaker doing the "are you the one" check 🫢
  • data β€” an opaque data pointer you pass along to test. it's giving wingman 🌈
  • isnew β€” return argument telling whether I_NEW was set when the inode was found in hash β€” and heads up, the caller needs to wait for I_NEW to clear 😭

πŸ’œ DESCRIPTION πŸ’œ

So you search for the inode specified by hashval and data in the inode cache. literally that's the job πŸ’…

and if the inode is in the cache? it gets returned with an incremented reference count πŸ”₯ iconic behaviour, no notes.


πŸ’€ NOTE πŸ’€

okay this is the part where I need you to focus bestie:

I_NEW is not waited upon, so you have to be very careful what you do with the returned inode. you probably should be using ilookup5 instead πŸ‘€

likeβ€”the function just hands you the inode and dips. no gatekeeping, no waiting. so be careful, fr fr πŸ™ˆ

Note2: test is called with the inode_hash_lock held, so it can't sleep 😴🚫 β€” do not try it, do not pass go, do not collect a hundred dollars.


πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./fs/inode.c and honestly the whole inode friend group came through:


and that's the whole page, bestie πŸ’– mwah. this one lives in ./fs, stamped October 2026, and it's ilookup5_nowait(9) β€” go be careful with your reference counts, ily πŸŽ€πŸ«Ά

πŸ“¦ where this page comes from