Lines Matching refs:sleb
237 static int sort_nodes(struct ubifs_info *c, struct ubifs_scan_leb *sleb, in sort_nodes() argument
246 list_for_each_entry_safe(snod, tmp, &sleb->nodes, list) { in sort_nodes()
268 err = ubifs_tnc_has_node(c, &snod->key, 0, sleb->lnum, in sort_nodes()
288 list_sort(c, &sleb->nodes, &data_nodes_cmp); in sort_nodes()
291 err = dbg_check_data_nodes_order(c, &sleb->nodes); in sort_nodes()
311 static int move_node(struct ubifs_info *c, struct ubifs_scan_leb *sleb, in move_node() argument
321 err = ubifs_tnc_replace(c, &snod->key, sleb->lnum, in move_node()
339 static int move_nodes(struct ubifs_info *c, struct ubifs_scan_leb *sleb) in move_nodes() argument
355 err = sort_nodes(c, sleb, &nondata, &min); in move_nodes()
365 list_for_each_entry_safe(snod, tmp, &sleb->nodes, list) { in move_nodes()
374 err = move_node(c, sleb, snod, wbuf); in move_nodes()
399 err = move_node(c, sleb, snod, wbuf); in move_nodes()
404 if (list_empty(&sleb->nodes) && list_empty(&nondata)) in move_nodes()
419 list_splice_tail(&nondata, &sleb->nodes); in move_nodes()
461 struct ubifs_scan_leb *sleb; in ubifs_garbage_collect_leb() local
506 sleb = ubifs_scan(c, lnum, 0, c->sbuf, 0); in ubifs_garbage_collect_leb()
507 if (IS_ERR(sleb)) in ubifs_garbage_collect_leb()
508 return PTR_ERR(sleb); in ubifs_garbage_collect_leb()
510 ubifs_assert(!list_empty(&sleb->nodes)); in ubifs_garbage_collect_leb()
511 snod = list_entry(sleb->nodes.next, struct ubifs_scan_node, list); in ubifs_garbage_collect_leb()
518 list_for_each_entry(snod, &sleb->nodes, list) { in ubifs_garbage_collect_leb()
555 err = move_nodes(c, sleb); in ubifs_garbage_collect_leb()
590 ubifs_scan_destroy(sleb); in ubifs_garbage_collect_leb()