iunique(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… iunique(9) β€” the Kernel API Manual, bestie edition ✨

okay so real talk, this is a page from the Kernel API Manual and it's genuinely so niche but also lowkey iconic? it's giving "the file system's personal hype squad for inode numbers". stay with me, we're gonna get through it together 🫢


🌸 NAME 🌸

iunique β€” get a unique inode number πŸ‘‘

like literally the whole job is "hand me a number that nobody else has". that's it. that's the function.


✨ SYNOPSIS ✨

ino_t iunique (struct super_block *sb , ino_t max_reserved );

look at her. two arguments, one mission. so clean, so demure πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • sb β€” the superblock. yeah, that superblock. bestie brought her own context and we respect it πŸ’–
  • max_reserved β€” the highest reserved inode number. think of it as the velvet rope 🚧 anything at or below this is spoken for, so don't even think about it.

πŸ¦‹ DESCRIPTION πŸ¦‹

so the goal here is simple and also kind of everything: you get back an inode number that is unique on the system for a given superblock. no cap. and it's used by file systems that just... don't have a natural permanent inode numbering system of their own? like they showed up to the party without a name tag and iunique is the friend at the door with a sharpie ✍️

an inode number gets returned that's higher than the reserved limit but unique. both. at the same time. the way that works is genuinely impressive ngl.

⚠️ BUGS: with a large number of inodes live on the file system, this function currently becomes quite slow. 😭 like, painfully slow. so if you've got a gazillion inodes chilling on your fs, she is going to be taking her sweet time. not a vibe, but forewarned is forearmed πŸ’€

🌈 SEE ALSO 🌈

okay this section is a whole friend group and we are NOT leaving anyone out. everyone gets an invite πŸ‘‘ the kernel file ./fs/inode.c and, in absolutely no particular order:

it's giving inode cinematic universe fr fr 🎬


that's the whole page, bestie, you ate it up πŸ’–βœ¨

so yeah β€” this little gem lives in ./fs, it's dated October 2026, and it's literally called iunique(9). see you in the next one, mwah πŸ«ΆπŸŽ€

πŸ“¦ where this page comes from