Lines Matching full:free
54 if (lprops->free + lprops->dirty >= c->dark_wm) in valuable()
96 if (lprops->free + lprops->dirty < data->min_space) in scan_for_dirty_cb()
102 if (lprops->free + lprops->dirty == c->leb_size) { in scan_for_dirty_cb()
114 * scan_for_dirty - find a data LEB with free space.
116 * @min_space: minimum amount free plus dirty space the returned LEB has to
118 * @pick_free: if it is OK to return a free or freeable LEB
133 /* There may be an LEB with enough dirty space on the free heap */ in scan_for_dirty()
137 if (lprops->free + lprops->dirty < min_space) in scan_for_dirty()
153 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.
366 if (lprops->free < data->min_space) in scan_for_free_cb()
369 if (!data->pick_free && lprops->free == c->leb_size) in scan_for_free_cb()
372 * LEBs that have only free and dirty space must not be allocated in scan_for_free_cb()
377 if (lprops->free + lprops->dirty == c->leb_size && lprops->dirty > 0) in scan_for_free_cb()
385 * do_find_free_space - find a data LEB with free space.
387 * @min_space: minimum amount of free space required
406 if (lprops && lprops->free >= min_space) in do_find_free_space()
416 if (lprops && lprops->free >= min_space) in do_find_free_space()
419 /* There may be an LEB with enough free space on the dirty heap */ in do_find_free_space()
423 if (lprops->free >= min_space) in do_find_free_space()
427 * A LEB may have fallen off of the bottom of the free heap, and ended in do_find_free_space()
428 * up as uncategorized even though it has enough free space for us now, in do_find_free_space()
438 if (lprops->free >= min_space) in do_find_free_space()
459 ubifs_assert(c, lprops->free >= min_space); in do_find_free_space()
466 * ubifs_find_free_space - find a data LEB with free space.
468 * @min_space: minimum amount of required free space
469 * @offs: contains offset of where free space starts on exit
472 * This function looks for an LEB with at least @min_space bytes of free space.
478 * failed to find a LEB with @min_space bytes of free space and other a negative
549 *offs = c->leb_size - lprops->free; in ubifs_find_free_space()
556 * LEBs that were freeable LEBs (free + dirty == leb_size) will in ubifs_find_free_space()
564 dbg_find("found LEB %d, free %d", lnum, c->leb_size - *offs); in ubifs_find_free_space()
579 * scan_for_idx_cb - callback used by the scan for a free LEB for the index.
606 if (lprops->free + lprops->dirty != c->leb_size) in scan_for_idx_cb()
610 * only free and dirty space, because write buffers are sync'd at commit in scan_for_idx_cb()
618 * scan_for_leb_for_idx - scan for a free LEB for the index.
639 ubifs_assert(c, lprops->free + lprops->dirty == c->leb_size); in scan_for_leb_for_idx()
646 * ubifs_find_free_leb_for_idx - find a free LEB for the index.
649 * This function looks for a free LEB and returns that LEB number. The returned
654 * will be empty. Secondly, free space at the end of an index LEB is not
698 dbg_find("found LEB %d, free %d, dirty %d, flags %#x", in ubifs_find_free_leb_for_idx()
699 lnum, lprops->free, lprops->dirty, lprops->flags); in ubifs_find_free_leb_for_idx()
713 * 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()
799 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