ext2_discard_reservation(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… ext2_discard_reservation(9) πŸ’…

okay so this one's straight out of the Kernel API Manual, and it's giving "quiet little cleanup function that nobody claps for but everyone needs" ✨


🌸 NAME 🌸

ext2_discard_reservation β€” (yeah bestie, the original leaves this blank too, no description, it's mysterious like that πŸŽ€)


✨ SYNOPSIS ✨

void ext2_discard_reservation (struct inode *inode );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • inode β€” an inode. that's it. that's the whole description. an inode. iconically minimal πŸ’…

πŸ”₯ DESCRIPTION πŸ”₯

So what it does: it discards (frees) the block reservation window on the last file close, or on truncate, or at the last iput. literally just tidying up the reservation window when it's not needed anymore 🧹✨

It gets called in three cases, and here they are, no gatekeeping:

  • ext2_release_file β€” when the last writer closes the file πŸ‘‹
  • ext2_clear_inode β€” when it's the last iput, i.e. when nobody links to this file anymore 😭
  • ext2_truncate β€” when the block indirect map is about to change πŸŒ€

πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./fs/ext2/balloc.c plus the whole friend group 🫢:


ngl if you got here you're probably already deep in balloc.c and honestly? respect. 🫑

and that's the whole page bestie!! from ./fs/ext2, dated October 2026 β€” mwah, periodt, bookmark it πŸ’–πŸŒ·

πŸ“¦ where this page comes from