Lines Matching refs:sleb

497 static int fix_unclean_leb(struct ubifs_info *c, struct ubifs_scan_leb *sleb,  in fix_unclean_leb()  argument
500 int lnum = sleb->lnum, endpt = start; in fix_unclean_leb()
503 if (!list_empty(&sleb->nodes)) { in fix_unclean_leb()
506 snod = list_entry(sleb->nodes.prev, in fix_unclean_leb()
516 lnum, start, sleb->endpt); in fix_unclean_leb()
529 lnum, start, sleb->endpt); in fix_unclean_leb()
538 err = ubifs_leb_read(c, lnum, sleb->buf, 0, in fix_unclean_leb()
548 void *buf = sleb->buf + len - pad_len; in fix_unclean_leb()
553 err = ubifs_leb_change(c, lnum, sleb->buf, len); in fix_unclean_leb()
570 static void drop_last_group(struct ubifs_scan_leb *sleb, int *offs) in drop_last_group() argument
572 while (!list_empty(&sleb->nodes)) { in drop_last_group()
576 snod = list_entry(sleb->nodes.prev, struct ubifs_scan_node, in drop_last_group()
583 sleb->lnum, snod->offs); in drop_last_group()
587 sleb->nodes_cnt -= 1; in drop_last_group()
599 static void drop_last_node(struct ubifs_scan_leb *sleb, int *offs) in drop_last_node() argument
603 if (!list_empty(&sleb->nodes)) { in drop_last_node()
604 snod = list_entry(sleb->nodes.prev, struct ubifs_scan_node, in drop_last_node()
608 sleb->lnum, snod->offs); in drop_last_node()
612 sleb->nodes_cnt -= 1; in drop_last_node()
635 struct ubifs_scan_leb *sleb; in ubifs_recover_leb() local
640 sleb = ubifs_start_scan(c, lnum, offs, sbuf); in ubifs_recover_leb()
641 if (IS_ERR(sleb)) in ubifs_recover_leb()
642 return sleb; in ubifs_recover_leb()
661 err = ubifs_add_snod(c, sleb, buf, offs); in ubifs_recover_leb()
716 drop_last_group(sleb, &offs); in ubifs_recover_leb()
770 drop_last_node(sleb, &offs); in ubifs_recover_leb()
777 ubifs_end_scan(c, sleb, lnum, offs); in ubifs_recover_leb()
779 err = fix_unclean_leb(c, sleb, start); in ubifs_recover_leb()
783 return sleb; in ubifs_recover_leb()
794 ubifs_scan_destroy(sleb); in ubifs_recover_leb()
867 struct ubifs_scan_leb *sleb; in ubifs_recover_log_leb() local
879 sleb = ubifs_scan(c, next_lnum, 0, sbuf, 0); in ubifs_recover_log_leb()
880 if (IS_ERR(sleb)) in ubifs_recover_log_leb()
881 return sleb; in ubifs_recover_log_leb()
882 if (sleb->nodes_cnt) { in ubifs_recover_log_leb()
886 snod = list_entry(sleb->nodes.next, in ubifs_recover_log_leb()
893 ubifs_scan_destroy(sleb); in ubifs_recover_log_leb()
900 ubifs_scan_destroy(sleb); in ubifs_recover_log_leb()
904 ubifs_scan_destroy(sleb); in ubifs_recover_log_leb()