find_next_reservable_window(9)
π NAME π
find_next_reservable_window β find a reservable space within the given range. This is the Kernel API Manual entry, bestie, and it's literally about finding a spot for a reservation window. π
β¨ SYNOPSIS β¨
okay so the function signature is giving kernel-core, no cap:
int find_next_reservable_window (struct ext2_reserve_window_node
*search_head , struct ext2_reserve_window_node *my_rsv , struct
super_block * sb , ext2_fsblk_t start_block , ext2_fsblk_t last_block );
π ARGUMENTS π
search_headβ the list to search. Like, the list we're scrolling through.my_rsvβ the reservation we're currently using. Our current fave reservation.sbβ the super block. Yep, that's the whole flex.start_blockβ the first block we consider to start the real search from. Real search starts here, bestie.last_blockβ the maximum block number that our goal reservable space could start from. It's the ceiling for where our dream spot can begin.
π DESCRIPTION π
Okay so here's the tea: it does not allocate the reservation window β alloc_new_reservation will do the work later. Not this function's job, periodt.
We search the given range, rather than the whole reservation double linked list, (start_block, last_block) to find a free region that is of my size and has not been reserved. Yes, we're being picky: my size, not reserved.
search_head is not necessarily the list head of the whole filesystem. We have both head and start_block to assist the search for the reservable space. The list starts from head, but we will shift to the place where start_block is, then start from there, when looking for a reservable space. Lowkey a smart lil shortcut.
last_block is normally the last block in this group. The search will end when we found the start of next possible reservable space is out of this boundary. This could handle the cross boundary reservation window request. Careful, this is the boundary tea β it's meant to handle the cross-boundary request.
π RETURN π
-1if we could not find a range of sufficient size. Sad girl hours.- If we could, return
0and fill inmy_rsvwith the range information. Slay, we found it.
π¦ SEE ALSO π¦
Kernel file ./fs/ext2/balloc.c β go bestie, read more:
__rsv_window_dump(9)goal_in_my_reservation(9)search_reserve_window(9)rsv_window_remove(9)ext2_init_block_alloc_info(9)ext2_discard_reservation(9)ext2_free_blocks(9)bitmap_search_next_usable_block(9)find_next_usable_block(9)ext2_try_to_allocate(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)
okay that's the whole page, bestie β source/version is ./fs/ext2, date is October 2026, and it's all find_next_reservable_window(9) energy. mwah ππβ¨
π¦ 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