ilookup5_nowait(9)
π 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 totest. it's giving wingman πisnewβ return argument telling whetherI_NEWwas set when the inode was found in hash β and heads up, the caller needs to wait forI_NEWto 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_NEWis not waited upon, so you have to be very careful what you do with the returned inode. you probably should be usingilookup5instead π
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:
inode_init_always_gfp(9)alloc_inode(9)drop_nlink(9)clear_nlink(9)set_nlink(9)inc_nlink(9)inode_sb_list_add(9)__insert_inode_hash(9)__remove_inode_hash(9)evict_inodes(9)new_inode(9)unlock_new_inode(9)lock_two_nondirectories(9)unlock_two_nondirectories(9)inode_insert5(9)iget5_locked(9)iget5_locked_rcu(9)iget_locked(9)iunique(9)ihold(9)ilookup5(9)ilookup(9)find_inode_nowait(9)find_inode_rcu(9)find_inode_by_ino_rcu(9)iput(9)iput_not_last(9)bmap(9)inode_update_time(9)generic_update_time(9)atime_needs_update(9)file_remove_privs(9)current_time(9)file_update_time(9)file_modified_flags(9)file_modified(9)kiocb_modified(9)inode_init_owner(9)inode_owner_or_capable(9)inode_dio_wait(9)timestamp_truncate(9)inode_set_ctime_current(9)inode_set_ctime_deleg(9)in_group_or_capable(9)mode_strip_sgid(9)dump_inode(9)
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms