find_next_reservable_window(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ 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 πŸ“

  • -1 if we could not find a range of sufficient size. Sad girl hours.
  • If we could, return 0 and fill in my_rsv with the range information. Slay, we found it.

πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./fs/ext2/balloc.c β€” go bestie, read more:


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