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
674 (!ubi->used.rb_node && !ubi->scrub.rb_node)) {
680 * No used physical eraseblocks? They must be temporarily
682 * @ubi->used tree later and the wear-leveling will be
685 dbg_wl("cancel WL, a list is empty: free %d, used %d",
686 !ubi->free.rb_node, !ubi->used.rb_node);
691 e1 = find_anchor_wl_entry(&ubi->used);
712 self_check_in_wl_tree(ubi, e1, &ubi->used);
713 rb_erase(&e1->u.rb, &ubi->used);
721 * Now pick the least worn-out used physical eraseblock and a
725 e1 = rb_entry(rb_first(&ubi->used), struct ubi_wl_entry, u.rb);
731 dbg_wl("no WL needed: min used EC %d, max free EC %d",
739 self_check_in_wl_tree(ubi, e1, &ubi->used);
740 rb_erase(&e1->u.rb, &ubi->used);
880 wl_tree_add(e2, &ubi->used);
935 wl_tree_add(e1, &ubi->used);
1023 if (!ubi->used.rb_node || !ubi->free.rb_node)
1029 * lowest erase counter of used physical eraseblocks and a high
1033 e1 = rb_entry(rb_first(&ubi->used), struct ubi_wl_entry, u.rb);
1186 ubi_warn(ubi, "no PEBs in the reserved pool, used an available PEB");
1191 ubi_warn(ubi, "last PEB from the reserve was used");
1228 * @vol_id: the volume ID that last used this PEB
1229 * @lnum: the last used logical eraseblock number for the PEB
1283 * but the WL sub-system has not put the PEB to the "used" tree
1295 if (in_wl_tree(e, &ubi->used)) {
1296 self_check_in_wl_tree(ubi, e, &ubi->used);
1297 rb_erase(&e->u.rb, &ubi->used);
1324 wl_tree_add(e, &ubi->used);
1359 * This physical eraseblock was used to move data to. The data
1370 if (in_wl_tree(e, &ubi->used)) {
1371 self_check_in_wl_tree(ubi, e, &ubi->used);
1372 rb_erase(&e->u.rb, &ubi->used);
1485 * %ENOENT, PEB is no longer used by UBI
1567 } else if (in_wl_tree(e, &ubi->used)) {
1568 rb_erase(&e->u.rb, &ubi->used);
1778 ubi->used = ubi->erroneous = ubi->free = ubi->scrub = RB_ROOT;
1843 dbg_wl("add PEB %d EC %d to the used tree",
1845 wl_tree_add(e, &ubi->used);
1907 ubi_err(ubi, "%d PEBs are corrupted and not used",
1928 tree_destroy(ubi, &ubi->used);
1962 tree_destroy(ubi, &ubi->used);