Lines Matching refs:sleb

491 static int fix_unclean_leb(struct ubifs_info *c, struct ubifs_scan_leb *sleb,  in fix_unclean_leb()  argument
494 int lnum = sleb->lnum, endpt = start; in fix_unclean_leb()
497 if (!list_empty(&sleb->nodes)) { in fix_unclean_leb()
500 snod = list_entry(sleb->nodes.prev, in fix_unclean_leb()
510 lnum, start, sleb->endpt); in fix_unclean_leb()
522 lnum, start, sleb->endpt); in fix_unclean_leb()
531 err = ubifs_leb_read(c, lnum, sleb->buf, 0, in fix_unclean_leb()
541 void *buf = sleb->buf + len - pad_len; in fix_unclean_leb()
546 err = ubifs_leb_change(c, lnum, sleb->buf, len); in fix_unclean_leb()
562 static void drop_last_group(struct ubifs_scan_leb *sleb, int *offs) in drop_last_group() argument
564 while (!list_empty(&sleb->nodes)) { in drop_last_group()
568 snod = list_entry(sleb->nodes.prev, struct ubifs_scan_node, in drop_last_group()
575 sleb->lnum, snod->offs); in drop_last_group()
579 sleb->nodes_cnt -= 1; in drop_last_group()
591 static void drop_last_node(struct ubifs_scan_leb *sleb, int *offs) in drop_last_node() argument
595 if (!list_empty(&sleb->nodes)) { in drop_last_node()
596 snod = list_entry(sleb->nodes.prev, struct ubifs_scan_node, in drop_last_node()
600 sleb->lnum, snod->offs); in drop_last_node()
604 sleb->nodes_cnt -= 1; in drop_last_node()
627 struct ubifs_scan_leb *sleb; in ubifs_recover_leb() local
632 sleb = ubifs_start_scan(c, lnum, offs, sbuf); in ubifs_recover_leb()
633 if (IS_ERR(sleb)) in ubifs_recover_leb()
634 return sleb; in ubifs_recover_leb()
653 err = ubifs_add_snod(c, sleb, buf, offs); in ubifs_recover_leb()
708 drop_last_group(sleb, &offs); in ubifs_recover_leb()
762 drop_last_node(sleb, &offs); in ubifs_recover_leb()
769 ubifs_end_scan(c, sleb, lnum, offs); in ubifs_recover_leb()
771 err = fix_unclean_leb(c, sleb, start); in ubifs_recover_leb()
775 return sleb; in ubifs_recover_leb()
786 ubifs_scan_destroy(sleb); in ubifs_recover_leb()
859 struct ubifs_scan_leb *sleb; in ubifs_recover_log_leb() local
871 sleb = ubifs_scan(c, next_lnum, 0, sbuf, 0); in ubifs_recover_log_leb()
872 if (IS_ERR(sleb)) in ubifs_recover_log_leb()
873 return sleb; in ubifs_recover_log_leb()
874 if (sleb->nodes_cnt) { in ubifs_recover_log_leb()
878 snod = list_entry(sleb->nodes.next, in ubifs_recover_log_leb()
885 ubifs_scan_destroy(sleb); in ubifs_recover_log_leb()
892 ubifs_scan_destroy(sleb); in ubifs_recover_log_leb()
896 ubifs_scan_destroy(sleb); in ubifs_recover_log_leb()