clear_nlink(9)
π clear_nlink β Kernel API Manual
ok so the page header says clear_nlink(9) and the manual name is Kernel API Manual β consider that folded in, bestie, we're not copying that line verbatim π
β¨ NAME β¨
clear_nlink β directly zero an inode's link count. like, directly directly. no middleman. π
πΈ SYNOPSIS πΈ
void clear_nlink (struct inode *inode );
that's it. that's the whole vibe. returns nothing, takes one thing. β
π¦ ARGUMENTS π¦
inodeβ the inode. yes, that's genuinely what the original says: "inode". so here's your inode. hand it over. π«Ά
π DESCRIPTION π
okay so this is a low-level filesystem helper, and its whole job is to replace any place where a filesystem was just... reaching in and messing with i_nlink by hand π. that's the iconique behavior β do the thing through the helper instead of rawdogging the struct.
and why do we even care? because i_nlink hitting zero is kind of a big deal β but the manpage doesn't spill that tea here, it points you at drop_nlink for that whole story. so go read drop_nlink if you wanna know why zero is the main character πβ¨
ngl, this is the kind of function where the description is short but the consequences are real. read the cross-references, bestie. π
β SEE ALSO β
everything is connected, iykyk. the original lists them under Kernel file ./fs/inode.c and here's every single one, no skips, no cap π₯:
inode_init_always_gfp(9)alloc_inode(9)drop_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_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)
ok so the footer of this page credits the source directory ./fs and dates it October 2026, and it signs off with clear_nlink(9) β so there's your cute little sign-off: from ./fs, October 2026, with love, clear_nlink(9) ππ§
π¦ 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