gfs2_evict_inodes(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… gfs2_evict_inodes(9) β€” like, the Kernel API Manual page, bestie

okay so this is a page from the Kernel API Manual and it's about gfs2_evict_inodes(9), and honestly? it's giving "teamwork makes the dream work" in kernel form. let's get into it 🫢


🌸 NAME 🌸

gfs2_evict_inodes β€” evict inodes cooperatively, bestie. together. as a unit. no lone wolves 🐺


✨ SYNOPSIS ✨

void gfs2_evict_inodes (struct super_block *sb );

πŸŽ€ ARGUMENTS πŸŽ€

  • sb β€” the superblock. that's it, that's the whole argument. iconic minimalism πŸ’…

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so picture this: you're evicting an inode with a zero link count, right? and to figure out whether we can actually delete this inode, we're trying to upgrade the inode's iopen glock from SH mode to EX mode. glow-up time πŸ”₯

and here's the thing β€” the other nodes are supposed to evict the inode from their caches if they can, and to poke the inode's inode glock if they can't. either one of those behaviors lets gfs2_upgrade_iopen_glock proceed quickly. but if the other nodes are not cooperating? 😭 the lock upgrading attempt will time out. and since inodes are evicted sequentially, that timeout can add up quickly. like, embarrassingly quickly. no cap.

so here's the drama: the function evict_inodes tries to keep the s_inode_list_lock list locked over a long time, which prevents other inodes from being evicted concurrently. which sounds fine until you realize it precludes the cooperative behavior we're actually looking for. πŸ’€ so rude. so this special version of evict_inodes avoids that. it's the nicer sibling. it shares.

modeled after drop_pagecache_sb. periodt. πŸ‘‘

ngl, the whole point here is cooperation β€” if you're holding that s_inode_list_lock forever, nobody else gets to play and everything times out. this version doesn't do that. 🧚

πŸ’œ SEE ALSO πŸ’œ

kernel file ./fs/gfs2/ops_fstype.c β€” plus the whole friend group:


and that's the page!! πŸ’– sourced from ./fs/gfs2, dated October 2026, and yes it's gfs2_evict_inodes(9) β€” go be cooperative out there, bestie 🌈⭐

πŸ“¦ where this page comes from