__gfs2_log_reserve(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– __gfs2_log_reserve β€” the Kernel API Manual, but make it make sense πŸ’–

okay bestie, so this is a page out of the Kernel API Manual (Linux kernel docs, we love her) and it's all about __gfs2_log_reserve β€” the little function that goes "yeah sure, you can have some log space, hold on" 🌸


✨ NAME ✨

__gfs2_log_reserve β€” Make a log reservation. That's it, that's the whole job. A reservation. For the log. Slay πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

void __gfs2_log_reserve (struct gfs2_sbd *sdp , unsigned int blks ,
       unsigned int taboo_blks );

it returns void, so like… it gives you nothing back. it just does the thing. main character energy tbh πŸ‘‘


πŸŽ€ ARGUMENTS πŸŽ€

  • sdp β€” The GFS2 superblock. the big boss struct, the one everything hangs off of 🫢
  • blks β€” The number of blocks to reserve. this is how much you're asking for. be reasonable.
  • taboo_blks β€” The number of blocks to leave free. the taboo blocks, the untouchables, the ones you do not spend πŸ™ˆ

⭐ DESCRIPTION ⭐

so here's the vibe check: taboo_blks is set to 0 for logd, and it's set to GFS2_LOG_FLUSH_MIN_BLOCKS for all other processes. why? because when the log is almost full, logd still needs to be able to call gfs2_log_flush one more time without blocking β€” and that flush advances the tail and frees up more log space for everyone. it's giving teamwork πŸ’–βœ¨

we no longer flush the log here, ngl. instead we wake up logd and let it do that for us. and to avoid the thundering herd 😭 (yes that's the real term, iconic) and to make sure we deal fairly with queued waiters, we use an exclusive wait.

which means: when we get woken with enough journal space to grab our reservation, we then need to wake the next waiter on the list. pass it on, bestie 🎁 literally paying it forward but for kernel locks.


πŸ”₯ SEE ALSO πŸ”₯

like, that's the whole friend group right there 🌈 go read all of them, iykyk πŸ’œ


lowkey a reminder: this page lives under ./fs/gfs2 in the kernel tree, from October 2026, and it's version-tagged __gfs2_log_reserve(9) β€” so if you're citing it, that's the receipt πŸ§ΎπŸ’…

mwah, go reserve some log blocks responsibly, bestie πŸ“πŸ§šπŸ’–

πŸ“¦ where this page comes from