Lines Matching refs:sleb
512 * @sleb: scanned LEB information
515 static int fix_unclean_leb(struct ubifs_info *c, struct ubifs_scan_leb *sleb, int start)
517 int lnum = sleb->lnum, endpt = start;
520 if (!list_empty(&sleb->nodes)) {
523 snod = list_entry(sleb->nodes.prev, struct ubifs_scan_node, list);
531 dbg_rcvry("need to fix LEB %d start %d endpt %d", lnum, start, sleb->endpt);
543 dbg_rcvry("fixing LEB %d start %d endpt %d", lnum, start, sleb->endpt);
553 err = ubifs_leb_read(c, lnum, sleb->buf, 0, start, 1);
562 void *buf = sleb->buf + len - pad_len;
567 err = ubifs_leb_change(c, lnum, sleb->buf, len);
578 * @sleb: scanned LEB information
584 static void drop_last_group(struct ubifs_scan_leb *sleb, int *offs)
586 while (!list_empty(&sleb->nodes)) {
590 snod = list_entry(sleb->nodes.prev, struct ubifs_scan_node, list);
596 dbg_rcvry("dropping grouped node at %d:%d", sleb->lnum, snod->offs);
600 sleb->nodes_cnt -= 1;
606 * @sleb: scanned LEB information
612 static void drop_last_node(struct ubifs_scan_leb *sleb, int *offs)
616 if (!list_empty(&sleb->nodes)) {
617 snod = list_entry(sleb->nodes.prev, struct ubifs_scan_node, list);
619 dbg_rcvry("dropping last node at %d:%d", sleb->lnum, snod->offs);
623 sleb->nodes_cnt -= 1;
645 struct ubifs_scan_leb *sleb;
650 sleb = ubifs_start_scan(c, lnum, offs, sbuf);
651 if (IS_ERR(sleb)) {
652 return sleb;
671 err = ubifs_add_snod(c, sleb, buf, offs);
757 drop_last_group(sleb, &offs);
812 drop_last_node(sleb, &offs);
820 ubifs_end_scan(c, sleb, lnum, offs);
822 err = fix_unclean_leb(c, sleb, start);
827 return sleb;
838 ubifs_scan_destroy(sleb);
910 struct ubifs_scan_leb *sleb;
923 sleb = ubifs_scan(c, next_lnum, 0, sbuf, 0);
924 if (IS_ERR(sleb)) {
925 return sleb;
927 if (sleb->nodes_cnt) {
931 snod = list_entry(sleb->nodes.next, struct ubifs_scan_node, list);
937 ubifs_scan_destroy(sleb);
943 ubifs_scan_destroy(sleb);
947 ubifs_scan_destroy(sleb);