gfs2_evict_inode(9)
π gfs2_evict_inode(9) β like, the whole Kernel API Manual page but make it make sense
okay so bestie, this is gfs2_evict_inode, straight out of the Kernel API Manual, and it's literally about yeeting an inode out of the cache. yes. removing it. gone. bye. π«Ά
β¨ NAME β¨
gfs2_evict_inode β Remove an inode from cache. that's it, that's the vibe. it's giving eviction notice energy π
πΈ SYNOPSIS πΈ
void gfs2_evict_inode (struct inode *inode );
literally one function, one pointer, zero drama (well, ok, a little drama, see the description) π
π¦ ARGUMENTS π¦
inodeβ the inode to evict. the main character of this whole operation, ngl. it's the one getting removed from cache π
π DESCRIPTION π
so there are three cases to consider, and no you cannot skip any of them, this is the whole plot:
i_nlink == 0, and we are the final opener β which means we must deallocate π₯i_nlink == 0, but we are not the final opener β so we cannot deallocate πi_nlink > 0β case closed, that's it, that's the third one π
okay but here's the twist: if the fs is read only, then we have to treat all cases as per case #3, because we are literally unable to do any deallocation. periodt. the inode will be deallocated by the next read/write node to attempt an allocation in the same resource group. iykyk π
and then there's the lock situation, which the author is honestly so real about: we have to (at the moment) hold the inode's main lock to cover the gap between unlocking the shared lock on the iopen lock and taking the exclusive lock. the author would rather do a shared -> exclusive conversion on the iopen lock, but like, we can change that later. it's safe, just less efficient. no cap. β
fr fr: the "less efficient" part is a real note from the original β safe, but slower. don't come for me, I'm just the messenger π§
π₯ SEE ALSO π₯
kernel file ./fs/gfs2/super.c and honestly a whole friend group of functions, all linked here, all iconic in their own right:
gfs2_jindex_free(9)gfs2_make_fs_rw(9)gfs2_lock_fs_check_clean(9)gfs2_write_inode(9)gfs2_dirty_inode(9)gfs2_make_fs_ro(9)gfs2_put_super(9)gfs2_sync_fs(9)gfs2_freeze_super(9)gfs2_thaw_super(9)statfs_slow_fill(9)gfs2_statfs_slow(9)gfs2_statfs_i(9)gfs2_statfs(9)gfs2_drop_inode(9)gfs2_show_options(9)gfs2_glock_put_eventually(9)evict_should_delete(9)evict_unlinked_inode(9)
like, go read them, they're literally right there π
okay that's the page!! it lives in ./fs/gfs2 and this particular version is dated October 2026 β so yeah, future girlie energy πΈβ¨ tysm for reading, mwah, go evict some inodes responsibly π«Άππ¦
π¦ 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