Lines Matching refs:sleb
200 * @sleb: describes nodes to sort and contains the result on exit
206 * @sleb->nodes and @nondata lists correspondingly.
224 static int sort_nodes(struct ubifs_info *c, struct ubifs_scan_leb *sleb,
232 list_for_each_entry_safe(snod, tmp, &sleb->nodes, list) {
239 err = ubifs_tnc_has_node(c, &snod->key, 0, sleb->lnum,
259 list_sort(c, &sleb->nodes, &data_nodes_cmp);
267 * @sleb: describes the LEB to move nodes from
275 static int move_node(struct ubifs_info *c, struct ubifs_scan_leb *sleb,
285 err = ubifs_tnc_replace(c, &snod->key, sleb->lnum,
296 * @sleb: describes the LEB to move nodes from
298 * This function moves valid nodes from data LEB described by @sleb to the GC
303 static int move_nodes(struct ubifs_info *c, struct ubifs_scan_leb *sleb)
319 err = sort_nodes(c, sleb, &nondata, &min);
329 list_for_each_entry_safe(snod, tmp, &sleb->nodes, list) {
338 err = move_node(c, sleb, snod, wbuf);
363 err = move_node(c, sleb, snod, wbuf);
368 if (list_empty(&sleb->nodes) && list_empty(&nondata))
383 list_splice_tail(&nondata, &sleb->nodes);
425 struct ubifs_scan_leb *sleb;
439 sleb = ubifs_scan(c, lnum, 0, c->sbuf, 0);
440 if (IS_ERR(sleb))
441 return PTR_ERR(sleb);
443 ubifs_assert(!list_empty(&sleb->nodes));
444 snod = list_entry(sleb->nodes.next, struct ubifs_scan_node, list);
451 list_for_each_entry(snod, &sleb->nodes, list) {
488 err = move_nodes(c, sleb);
523 ubifs_scan_destroy(sleb);