int alloc_new_reservation (struct ext3_reserve_window_node * my_rsv, int goal, struct super_block * sb, unsigned int group, struct buffer_head * bitmap_bh);
To make a new reservation, we search part of the filesystem reservation list (the list that inside the group). We try to allocate a new reservation window near the allocation goal, or the beginning of the group, if there is no goal.
We first find a reservable space after the goal, then from there, we check the bitmap for the first free block after it. If there is no free block until the end of group, then the whole group is full, we failed. Otherwise, check if the free block is inside the expected reservable space, if so, we succeed. If the first free block is outside the reservable space, then start from the first free block, we search for next available space, and go on.
on succeed, a new reservation will be found and inserted into the list It contains at least one free block, and it does not overlap with other reservation windows.
we failed to find a reservation window in this group