gfs2_unlink_inode(9)
π gfs2_unlink_inode β bestie's guide to yeeting an inode ποΈβ¨
Okay so this is gfs2_unlink_inode(9), a page from the Kernel API Manual, and it's literally about removing an inode from its parent dir and unlinking it. Yes girl, we're doing filesystem surgery today π©Ίπ
β¨ NAME β¨
gfs2_unlink_inode β removes an inode from its parent dir and unlinks it π
π¦ SYNOPSIS π¦
int gfs2_unlink_inode (struct gfs2_inode *dip , const struct dentry
*dentry );
Like, that's the whole signature. Short king. π
πΈ ARGUMENTS πΈ
dipβ the parent directory π that's literally it, that's the vibe.dentryβ the dentry to unlink π«Ά the thing we're sending off into the void.
π§ DESCRIPTION π§
So the way this gets called: it comes in with all the locks and in a transaction πβ¨ β no cap, that's the requirement, and you do not skip it.
And here's the tea β β this will only be called for a directory after it has been checked to ensure it is empty. Not me stressing that again but like, it's important: empty check first, then this. Periodt. π
π RETURN π
0 on success, or an error π β either the slay outcome or the oops outcome, no in-between.
π₯ SEE ALSO π₯
Gathering all the besties, iykyk π Kernel file ./fs/gfs2/inode.c and the whole friend group:
gfs2_set_iop(9)gfs2_inode_lookup(9)gfs2_lookup_by_inum(9)gfs2_lookup_meta(9)gfs2_lookupi(9)create_ok(9)gfs2_init_xattr(9)init_dinode(9)gfs2_trans_da_blks(9)gfs2_create_inode(9)gfs2_create(9)__gfs2_lookup(9)gfs2_link(9)gfs2_unlink(9)gfs2_symlink(9)gfs2_mkdir(9)gfs2_mknod(9)gfs2_atomic_open(9)update_moved_ino(9)gfs2_rename(9)gfs2_exchange(9)gfs2_get_link(9)gfs2_permission(9)gfs2_setattr(9)gfs2_getattr(9)
Okay bye bestie, mwah π π β this one came from ./fs/gfs2, dated October 2026, and it's the gfs2_unlink_inode(9) page. Go unlink something (safely, with locks, in a transaction ππ).
π¦ 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