Lines Matching refs:used

14  * eraseblocks are of two types - used and free. Used physical eraseblocks are
26 * The wear-leveling is ensured by means of moving the contents of used
38 * "free" or "used". Free eraseblock are kept in the @wl->free RB-tree, while
39 * used eraseblocks are kept in @wl->used, @wl->erroneous, or @wl->scrub
45 * @wl->used tree. There is a protection queue in between where this
63 * used. The former state corresponds to the @wl->free tree. The latter state
65 * o the WL movement is allowed (@wl->used tree);
71 * Depending on the sub-state, wear-leveling entries of the used physical
100 * exceeded, the WL sub-system starts moving data from used physical
137 * the @ubi->used and @ubi->free RB-trees.
196 * @ubi->work_sem is used to synchronize with the workers. Workers take
364 /* If no fastmap has been written and this WL entry can be used
375 * wl_get_wle - get a mean wl entry to be used by ubi_wl_get_peb() or
496 * and should be moved to the used tree.
511 dbg_wl("PEB %d EC %d protection over, move to used tree",
515 wl_tree_add(e, &ubi->used);
540 * list. Can only be used if ubi->work_sem is already held in read mode!
575 * @vol_id: the volume ID that last used this PEB
576 * @lnum: the last used logical eraseblock number for the PEB
615 * @vol_id: the volume ID that last used this PEB
616 * @lnum: the last used logical eraseblock number for the PEB
678 (!ubi->used.rb_node && !ubi->scrub.rb_node)) {
684 * No used physical eraseblocks? They must be temporarily
686 * @ubi->used tree later and the wear-leveling will be
689 dbg_wl("cancel WL, a list is empty: free %d, used %d",
690 !ubi->free.rb_node, !ubi->used.rb_node);
695 e1 = find_anchor_wl_entry(&ubi->used);
716 self_check_in_wl_tree(ubi, e1, &ubi->used);
717 rb_erase(&e1->u.rb, &ubi->used);
725 * Now pick the least worn-out used physical eraseblock and a
729 e1 = rb_entry(rb_first(&ubi->used), struct ubi_wl_entry, u.rb);
735 dbg_wl("no WL needed: min used EC %d, max free EC %d",
743 self_check_in_wl_tree(ubi, e1, &ubi->used);
744 rb_erase(&e1->u.rb, &ubi->used);
884 wl_tree_add(e2, &ubi->used);
939 wl_tree_add(e1, &ubi->used);
1032 if (!ubi->used.rb_node || !ubi->free.rb_node)
1038 * lowest erase counter of used physical eraseblocks and a high
1042 e1 = rb_entry(rb_first(&ubi->used), struct ubi_wl_entry, u.rb);
1196 ubi_warn(ubi, "no PEBs in the reserved pool, used an available PEB");
1201 ubi_warn(ubi, "last PEB from the reserve was used");
1238 * @vol_id: the volume ID that last used this PEB
1239 * @lnum: the last used logical eraseblock number for the PEB
1293 * but the WL sub-system has not put the PEB to the "used" tree
1305 if (in_wl_tree(e, &ubi->used)) {
1306 self_check_in_wl_tree(ubi, e, &ubi->used);
1307 rb_erase(&e->u.rb, &ubi->used);
1334 wl_tree_add(e, &ubi->used);
1369 * This physical eraseblock was used to move data to. The data
1380 if (in_wl_tree(e, &ubi->used)) {
1381 self_check_in_wl_tree(ubi, e, &ubi->used);
1382 rb_erase(&e->u.rb, &ubi->used);
1495 * %ENOENT, PEB is no longer used by UBI
1577 } else if (in_wl_tree(e, &ubi->used)) {
1578 rb_erase(&e->u.rb, &ubi->used);
1788 ubi->used = ubi->erroneous = ubi->free = ubi->scrub = RB_ROOT;
1853 dbg_wl("add PEB %d EC %d to the used tree",
1855 wl_tree_add(e, &ubi->used);
1917 ubi_err(ubi, "%d PEBs are corrupted and not used",
1938 tree_destroy(ubi, &ubi->used);
1972 tree_destroy(ubi, &ubi->used);