Lines Matching refs:rsv

202 	struct ext2_reserve_window_node *rsv, *prev;  in __rsv_window_dump()  local
212 rsv = rb_entry(n, struct ext2_reserve_window_node, rsv_node); in __rsv_window_dump()
216 rsv, rsv->rsv_start, rsv->rsv_end); in __rsv_window_dump()
217 if (rsv->rsv_start && rsv->rsv_start >= rsv->rsv_end) { in __rsv_window_dump()
219 rsv); in __rsv_window_dump()
222 if (prev && prev->rsv_end >= rsv->rsv_start) { in __rsv_window_dump()
224 rsv); in __rsv_window_dump()
235 prev = rsv; in __rsv_window_dump()
263 goal_in_my_reservation(struct ext2_reserve_window *rsv, ext2_grpblk_t grp_goal, in goal_in_my_reservation() argument
271 if ((rsv->_rsv_start > group_last_block) || in goal_in_my_reservation()
272 (rsv->_rsv_end < group_first_block)) in goal_in_my_reservation()
274 if ((grp_goal >= 0) && ((grp_goal + group_first_block < rsv->_rsv_start) in goal_in_my_reservation()
275 || (grp_goal + group_first_block > rsv->_rsv_end))) in goal_in_my_reservation()
293 struct ext2_reserve_window_node *rsv; in search_reserve_window() local
299 rsv = rb_entry(n, struct ext2_reserve_window_node, rsv_node); in search_reserve_window()
301 if (goal < rsv->rsv_start) in search_reserve_window()
303 else if (goal > rsv->rsv_end) in search_reserve_window()
306 return rsv; in search_reserve_window()
314 if (rsv->rsv_start > goal) { in search_reserve_window()
315 n = rb_prev(&rsv->rsv_node); in search_reserve_window()
316 rsv = rb_entry(n, struct ext2_reserve_window_node, rsv_node); in search_reserve_window()
318 return rsv; in search_reserve_window()
329 struct ext2_reserve_window_node *rsv) in ext2_rsv_window_add() argument
332 struct rb_node *node = &rsv->rsv_node; in ext2_rsv_window_add()
333 ext2_fsblk_t start = rsv->rsv_start; in ext2_rsv_window_add()
368 struct ext2_reserve_window_node *rsv) in rsv_window_remove() argument
370 rsv->rsv_start = EXT2_RESERVE_WINDOW_NOT_ALLOCATED; in rsv_window_remove()
371 rsv->rsv_end = EXT2_RESERVE_WINDOW_NOT_ALLOCATED; in rsv_window_remove()
372 rsv->rsv_alloc_hit = 0; in rsv_window_remove()
373 rb_erase(&rsv->rsv_node, &EXT2_SB(sb)->s_rsv_window_root); in rsv_window_remove()
382 static inline int rsv_is_empty(struct ext2_reserve_window *rsv) in rsv_is_empty() argument
385 return (rsv->_rsv_end == EXT2_RESERVE_WINDOW_NOT_ALLOCATED); in rsv_is_empty()
417 struct ext2_reserve_window_node *rsv = &block_i->rsv_window_node; in ext2_init_block_alloc_info() local
419 rsv->rsv_start = EXT2_RESERVE_WINDOW_NOT_ALLOCATED; in ext2_init_block_alloc_info()
420 rsv->rsv_end = EXT2_RESERVE_WINDOW_NOT_ALLOCATED; in ext2_init_block_alloc_info()
428 rsv->rsv_goal_size = 0; in ext2_init_block_alloc_info()
430 rsv->rsv_goal_size = EXT2_DEFAULT_RESERVE_BLOCKS; in ext2_init_block_alloc_info()
431 rsv->rsv_alloc_hit = 0; in ext2_init_block_alloc_info()
454 struct ext2_reserve_window_node *rsv; in ext2_discard_reservation() local
460 rsv = &block_i->rsv_window_node; in ext2_discard_reservation()
461 if (!rsv_is_empty(&rsv->rsv_window)) { in ext2_discard_reservation()
463 if (!rsv_is_empty(&rsv->rsv_window)) in ext2_discard_reservation()
464 rsv_window_remove(inode->i_sb, rsv); in ext2_discard_reservation()
756 struct ext2_reserve_window_node *rsv, *prev; in find_next_reservable_window() local
763 rsv = search_head; in find_next_reservable_window()
764 if (!rsv) in find_next_reservable_window()
768 if (cur <= rsv->rsv_end) in find_next_reservable_window()
769 cur = rsv->rsv_end + 1; in find_next_reservable_window()
783 prev = rsv; in find_next_reservable_window()
784 next = rb_next(&rsv->rsv_node); in find_next_reservable_window()
785 rsv = rb_entry(next,struct ext2_reserve_window_node,rsv_node); in find_next_reservable_window()
794 if (cur + size <= rsv->rsv_start) { in find_next_reservable_window()