iunique(9)
π 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:
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)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)π
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
- 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