Lines Matching full:free

45 	wl_tree_add(e, &ubi->free);  in return_unused_peb()
50 * return_unused_pool_pebs - returns unused PEB to the free tree.
79 if (!ubi->free.rb_node) in ubi_wl_get_fm_peb()
83 e = find_anchor_wl_entry(&ubi->free); in ubi_wl_get_fm_peb()
85 e = find_mean_wl_entry(ubi, &ubi->free); in ubi_wl_get_fm_peb()
90 self_check_in_wl_tree(ubi, e, &ubi->free); in ubi_wl_get_fm_peb()
92 /* remove it from the free list, in ubi_wl_get_fm_peb()
94 rb_erase(&e->u.rb, &ubi->free); in ubi_wl_get_fm_peb()
101 * wait_free_pebs_for_pool - wait until there enough free pebs
104 * Wait and execute do_work until there are enough free pebs, fill pool
112 int free, expect_free, executed; in wait_free_pebs_for_pool() local
114 * There are at least following free pebs which reserved by UBI: in wait_free_pebs_for_pool()
125 free = ubi->free_count; in wait_free_pebs_for_pool()
126 free += pool->size - pool->used + wl_pool->size - wl_pool->used; in wait_free_pebs_for_pool()
137 } while (free < expect_free); in wait_free_pebs_for_pool()
141 * left_free_count - returns the number of free pebs to fill fm pools
144 * This helper function returns the number of free pebs (deducted
151 if (!ubi->free.rb_node) in left_free_count()
161 * can_fill_pools - whether free PEBs will be left after filling pools
163 * @free: current number of free PEBs
165 * Return %1 if there are still left free PEBs after filling pools,
168 static int can_fill_pools(struct ubi_device *ubi, int free) in can_fill_pools() argument
175 if (free - pool_need < 1) in can_fill_pools()
208 wl_tree_add(ubi->fm_anchor, &ubi->free); in ubi_refill_pools_and_lock()
215 * All available PEBs are in ubi->free, now is the time to get in ubi_refill_pools_and_lock()
241 e = find_wl_entry(ubi, &ubi->free, WL_FREE_MAX_DIFF, in ubi_refill_pools_and_lock()
243 self_check_in_wl_tree(ubi, e, &ubi->free); in ubi_refill_pools_and_lock()
244 rb_erase(&e->u.rb, &ubi->free); in ubi_refill_pools_and_lock()
263 * produce_free_peb - produce a free physical eraseblock.
266 * This function tries to make a free PEB by means of synchronous execution of
275 while (!ubi->free.rb_node && ubi->works_count) { in produce_free_peb()
323 ubi_err(ubi, "Unable to get a free PEB from user WL pool"); in ubi_wl_get_peb()
364 * UBI fetches free PEB from wl_pool, we check free PEBs from both 'wl_pool'
365 * and 'ubi->free', because free PEB in 'ubi->free' tree maybe moved into
380 if (!ubi->free.rb_node) in need_wear_leveling()
382 e = find_wl_entry(ubi, &ubi->free, WL_FREE_MAX_DIFF, 0); in need_wear_leveling()
386 if (ubi->free.rb_node) { in need_wear_leveling()
387 e = find_wl_entry(ubi, &ubi->free, WL_FREE_MAX_DIFF, 0); in need_wear_leveling()
439 /* See if we can find an anchor PEB on the list of free PEBs */ in ubi_ensure_anchor_pebs()