iget_locked(9)
π iget_locked(9) β the Kernel API Manual, bestie edition π
okay so before we even start β this page lives in the Kernel API Manual, section 9, and it's all about iget_locked. buckle up, it's a short one but it's lowkey iconic β¨
πΈ NAME πΈ
iget_locked β go get yourself an inode from a mounted file system, bestie π¦
β¨ SYNOPSIS β¨
struct inode * iget_locked (struct super_block *sb , u64 ino );
that's it. two args, one return value, one little struct inode * pointer. slay π
π«Ά ARGUMENTS π«Ά
sbβ the super block of the file system. like, the whole vibes-holder for the filesystem it lives on πinoβ the inode number you want to get. literally the number. the whole identifying number π₯
π DESCRIPTION π
so what does it do. okay. it searches for the inode specified by ino in the inode cache, and if it's there, it returns it with an increased reference count. that's it, that's the whole first half. this one is for file systems where the inode number alone is enough to uniquely identify an inode β iykyk π§
and if the inode is not in cache? it allocates a new inode and returns it locked, hashed, and with the I_NEW flag set. yes bestie, all three, at once. the file system gets to fill it in before unlocking it via unlock_new_inode. so like β you get the inode, you dress it up with all its data, and then you unlock it. do not skip that step fr fr π
it's giving "here's your new inode, she's locked and flagged, handle her with care" π
π SEE ALSO π
this list is genuinely so long, she ate and left no crumbs. the kernel file ./fs/inode.c is where this all lives, and here's everyone invited to the party π
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)iunique(9)ihold(9)ilookup5_nowait(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, no notes π this one's sourced out of ./fs and dated October 2026 β so like, very much a period piece π bye, love u, go unlock that new inode π¦β¨
π¦ 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