Lines Matching full:free
54 if (lprops->free + lprops->dirty >= c->dark_wm) in valuable()
97 if (lprops->free + lprops->dirty < data->min_space) in scan_for_dirty_cb()
103 if (lprops->free + lprops->dirty == c->leb_size) { in scan_for_dirty_cb()
115 * scan_for_dirty - find a data LEB with free space.
117 * @min_space: minimum amount free plus dirty space the returned LEB has to
119 * @pick_free: if it is OK to return a free or freeable LEB
134 /* There may be an LEB with enough dirty space on the free heap */ in scan_for_dirty()
138 if (lprops->free + lprops->dirty < min_space) in scan_for_dirty()
154 if (lprops->free + lprops->dirty < min_space) in scan_for_dirty()
180 ubifs_assert(c, lprops->free + lprops->dirty >= min_space); in scan_for_dirty()
183 lprops->free + lprops->dirty == c->leb_size)); in scan_for_dirty()
193 * @min_space: minimum amount free plus dirty space the returned LEB has to
198 * @min_space free and dirty space. It prefers to take an LEB from the dirty or
202 * Note, LEBs which have less than dead watermark of free + dirty space are
206 * free or freeable LEB if one is present. For example, GC must to set it to %1,
208 * appearance of free space may coincide with the loss of enough dirty space
212 * just make free space, not return LEBs which are already free or freeable.
249 /* Check if there are enough free LEBs for the index */ in ubifs_find_dirty_leb()
262 * We cannot pick free/freeable LEBs in the below code. in ubifs_find_dirty_leb()
277 sum = idx_lp->free + idx_lp->dirty; in ubifs_find_dirty_leb()
294 if (lp->dirty + lp->free < min_space) in ubifs_find_dirty_leb()
300 if (idx_lp->free + idx_lp->dirty >= lp->free + lp->dirty) in ubifs_find_dirty_leb()
306 ubifs_assert(c, lp->free + lp->dirty >= c->dead_wm); in ubifs_find_dirty_leb()
318 (pick_free && lp->free + lp->dirty == c->leb_size)); in ubifs_find_dirty_leb()
321 dbg_find("found LEB %d, free %d, dirty %d, flags %#x", in ubifs_find_dirty_leb()
322 lp->lnum, lp->free, lp->dirty, lp->flags); in ubifs_find_dirty_leb()
339 * scan_for_free_cb - free space scan callback.
367 if (lprops->free < data->min_space) in scan_for_free_cb()
370 if (!data->pick_free && lprops->free == c->leb_size) in scan_for_free_cb()
373 * LEBs that have only free and dirty space must not be allocated in scan_for_free_cb()
378 if (lprops->free + lprops->dirty == c->leb_size && lprops->dirty > 0) in scan_for_free_cb()
386 * do_find_free_space - find a data LEB with free space.
388 * @min_space: minimum amount of free space required
407 if (lprops && lprops->free >= min_space) in do_find_free_space()
417 if (lprops && lprops->free >= min_space) in do_find_free_space()
420 /* There may be an LEB with enough free space on the dirty heap */ in do_find_free_space()
424 if (lprops->free >= min_space) in do_find_free_space()
428 * A LEB may have fallen off of the bottom of the free heap, and ended in do_find_free_space()
429 * up as uncategorized even though it has enough free space for us now, in do_find_free_space()
439 if (lprops->free >= min_space) in do_find_free_space()
460 ubifs_assert(c, lprops->free >= min_space); in do_find_free_space()
467 * ubifs_find_free_space - find a data LEB with free space.
469 * @min_space: minimum amount of required free space
470 * @offs: contains offset of where free space starts on exit
473 * This function looks for an LEB with at least @min_space bytes of free space.
479 * failed to find a LEB with @min_space bytes of free space and other a negative
550 *offs = c->leb_size - lprops->free; in ubifs_find_free_space()
557 * LEBs that were freeable LEBs (free + dirty == leb_size) will in ubifs_find_free_space()
565 dbg_find("found LEB %d, free %d", lnum, c->leb_size - *offs); in ubifs_find_free_space()
580 * scan_for_idx_cb - callback used by the scan for a free LEB for the index.
608 if (lprops->free + lprops->dirty != c->leb_size) in scan_for_idx_cb()
612 * only free and dirty space, because write buffers are sync'd at commit in scan_for_idx_cb()
620 * scan_for_leb_for_idx - scan for a free LEB for the index.
640 ubifs_assert(c, lprops->free + lprops->dirty == c->leb_size); in scan_for_leb_for_idx()
647 * ubifs_find_free_leb_for_idx - find a free LEB for the index.
650 * This function looks for a free LEB and returns that LEB number. The returned
655 * will be empty. Secondly, free space at the end of an index LEB is not
699 dbg_find("found LEB %d, free %d, dirty %d, flags %#x", in ubifs_find_free_leb_for_idx()
700 lnum, lprops->free, lprops->dirty, lprops->flags); in ubifs_find_free_leb_for_idx()
714 * freeable LEBs (free + dirty == leb_size) will not have been unmapped. in ubifs_find_free_leb_for_idx()
735 return lpa->dirty + lpa->free - lpb->dirty - lpb->free; in cmp_dirty_idx()
743 * dirty index LEBs sorted in order of dirty and free space. This is used by
760 dbg_find("dirtiest index LEB is %d with dirty %d and free %d", in ubifs_save_dirty_idx_lnums()
763 c->dirty_idx.arr[c->dirty_idx.cnt - 1]->free); in ubifs_save_dirty_idx_lnums()
800 if (lprops->free + lprops->dirty < c->min_idx_node_sz) in scan_dirty_idx_cb()
857 ubifs_assert(c, lprops->free + lprops->dirty >= c->min_idx_node_sz); in find_dirty_idx_leb()
861 dbg_find("found dirty LEB %d, free %d, dirty %d, flags %#x", in find_dirty_idx_leb()
862 lprops->lnum, lprops->free, lprops->dirty, lprops->flags); in find_dirty_idx_leb()
896 dbg_find("LEB %d, dirty %d and free %d flags %#x", in get_idx_gc_leb()
897 lp->lnum, lp->dirty, lp->free, lp->flags); in get_idx_gc_leb()
926 dbg_find("LEB %d, dirty %d and free %d flags %#x", lp->lnum, lp->dirty, in find_dirtiest_idx_leb()
927 lp->free, lp->flags); in find_dirtiest_idx_leb()
937 * This function attempts to find an untaken index LEB with the most free and