iget_locked(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 πŸŽ€


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