ext2_discard_reservation(9)
π 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 lastiput, 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 π«Ά:
__rsv_window_dump(9)goal_in_my_reservation(9)search_reserve_window(9)rsv_window_remove(9)ext2_init_block_alloc_info(9)ext2_free_blocks(9)bitmap_search_next_usable_block(9)find_next_usable_block(9)ext2_try_to_allocate(9)find_next_reservable_window(9)alloc_new_reservation(9)try_to_extend_reservation(9)ext2_try_to_allocate_with_rsv(9)ext2_has_free_blocks(9)ext2_bg_has_super(9)ext2_bg_num_gdb(9)
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
- 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