Home
last modified time | relevance | path

Searched refs:sleb (Results 1 – 24 of 24) sorted by relevance

/OK3568_Linux_fs/kernel/fs/ubifs/
H A Dscan.c128 struct ubifs_scan_leb *sleb; in ubifs_start_scan() local
133 sleb = kzalloc(sizeof(struct ubifs_scan_leb), GFP_NOFS); in ubifs_start_scan()
134 if (!sleb) in ubifs_start_scan()
137 sleb->lnum = lnum; in ubifs_start_scan()
138 INIT_LIST_HEAD(&sleb->nodes); in ubifs_start_scan()
139 sleb->buf = sbuf; in ubifs_start_scan()
145 kfree(sleb); in ubifs_start_scan()
153 return sleb; in ubifs_start_scan()
163 void ubifs_end_scan(const struct ubifs_info *c, struct ubifs_scan_leb *sleb, in ubifs_end_scan() argument
169 sleb->endpt = ALIGN(offs, c->min_io_size); in ubifs_end_scan()
[all …]
H A Dreplay.c591 static int authenticate_sleb(struct ubifs_info *c, struct ubifs_scan_leb *sleb, in authenticate_sleb() argument
602 return sleb->nodes_cnt; in authenticate_sleb()
604 list_for_each_entry(snod, &sleb->nodes, list) { in authenticate_sleb()
643 n_not_auth, sleb->lnum); in authenticate_sleb()
647 n_not_auth, sleb->lnum); in authenticate_sleb()
671 struct ubifs_scan_leb *sleb; in replay_bud() local
684 sleb = ubifs_recover_leb(c, lnum, offs, c->sbuf, b->bud->jhead); in replay_bud()
686 sleb = ubifs_scan(c, lnum, offs, c->sbuf, 0); in replay_bud()
687 if (IS_ERR(sleb)) in replay_bud()
688 return PTR_ERR(sleb); in replay_bud()
[all …]
H A Drecovery.c491 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
[all …]
H A Dorphan.c630 static int do_kill_orphans(struct ubifs_info *c, struct ubifs_scan_leb *sleb, in do_kill_orphans() argument
645 list_for_each_entry(snod, &sleb->nodes, list) { in do_kill_orphans()
648 snod->type, sleb->lnum, snod->offs); in do_kill_orphans()
676 cmt_no, sleb->lnum, snod->offs); in do_kill_orphans()
681 dbg_rcvry("out of date LEB %d", sleb->lnum); in do_kill_orphans()
725 cmt_no, sleb->lnum, snod->offs); in do_kill_orphans()
776 struct ubifs_scan_leb *sleb; in kill_orphans() local
779 sleb = ubifs_scan(c, lnum, 0, c->sbuf, 1); in kill_orphans()
780 if (IS_ERR(sleb)) { in kill_orphans()
781 if (PTR_ERR(sleb) == -EUCLEAN) in kill_orphans()
[all …]
H A Dgc.c227 static int sort_nodes(struct ubifs_info *c, struct ubifs_scan_leb *sleb, in sort_nodes() argument
236 list_for_each_entry_safe(snod, tmp, &sleb->nodes, list) { in sort_nodes()
259 err = ubifs_tnc_has_node(c, &snod->key, 0, sleb->lnum, in sort_nodes()
279 list_sort(c, &sleb->nodes, &data_nodes_cmp); in sort_nodes()
282 err = dbg_check_data_nodes_order(c, &sleb->nodes); in sort_nodes()
302 static int move_node(struct ubifs_info *c, struct ubifs_scan_leb *sleb, in move_node() argument
312 err = ubifs_tnc_replace(c, &snod->key, sleb->lnum, in move_node()
330 static int move_nodes(struct ubifs_info *c, struct ubifs_scan_leb *sleb) in move_nodes() argument
346 err = sort_nodes(c, sleb, &nondata, &min); in move_nodes()
356 list_for_each_entry_safe(snod, tmp, &sleb->nodes, list) { in move_nodes()
[all …]
H A Dmaster.c92 struct ubifs_scan_leb *sleb; in scan_for_master() local
98 sleb = ubifs_scan(c, lnum, 0, c->sbuf, 1); in scan_for_master()
99 if (IS_ERR(sleb)) in scan_for_master()
100 return PTR_ERR(sleb); in scan_for_master()
101 nodes_cnt = sleb->nodes_cnt; in scan_for_master()
103 snod = list_entry(sleb->nodes.prev, struct ubifs_scan_node, in scan_for_master()
110 ubifs_scan_destroy(sleb); in scan_for_master()
114 sleb = ubifs_scan(c, lnum, 0, c->sbuf, 1); in scan_for_master()
115 if (IS_ERR(sleb)) in scan_for_master()
116 return PTR_ERR(sleb); in scan_for_master()
[all …]
H A Dauth.c196 struct ubifs_scan_leb *sleb; in ubifs_sb_verify_signature() local
200 sleb = ubifs_scan(c, UBIFS_SB_LNUM, UBIFS_SB_NODE_SZ, c->sbuf, 0); in ubifs_sb_verify_signature()
201 if (IS_ERR(sleb)) { in ubifs_sb_verify_signature()
202 err = PTR_ERR(sleb); in ubifs_sb_verify_signature()
206 if (sleb->nodes_cnt == 0) { in ubifs_sb_verify_signature()
212 snod = list_first_entry(&sleb->nodes, struct ubifs_scan_node, list); in ubifs_sb_verify_signature()
246 ubifs_scan_destroy(sleb); in ubifs_sb_verify_signature()
H A Dlog.c644 struct ubifs_scan_leb *sleb; in ubifs_consolidate_log() local
658 sleb = ubifs_scan(c, lnum, 0, c->sbuf, 0); in ubifs_consolidate_log()
659 if (IS_ERR(sleb)) { in ubifs_consolidate_log()
660 err = PTR_ERR(sleb); in ubifs_consolidate_log()
663 list_for_each_entry(snod, &sleb->nodes, list) { in ubifs_consolidate_log()
691 ubifs_scan_destroy(sleb); in ubifs_consolidate_log()
725 ubifs_scan_destroy(sleb); in ubifs_consolidate_log()
H A Dtnc_commit.c226 struct ubifs_scan_leb *sleb; in layout_leb_in_gaps() local
246 sleb = ubifs_scan(c, lnum, 0, c->ileb_buf, 0); in layout_leb_in_gaps()
248 if (IS_ERR(sleb)) in layout_leb_in_gaps()
249 return PTR_ERR(sleb); in layout_leb_in_gaps()
251 list_for_each_entry(snod, &sleb->nodes, list) { in layout_leb_in_gaps()
263 ubifs_scan_destroy(sleb); in layout_leb_in_gaps()
279 ubifs_scan_destroy(sleb); in layout_leb_in_gaps()
286 ubifs_scan_destroy(sleb); in layout_leb_in_gaps()
H A Dlprops.c1019 struct ubifs_scan_leb *sleb; in scan_check_cb() local
1102 sleb = ubifs_scan(c, lnum, 0, buf, 0); in scan_check_cb()
1103 if (IS_ERR(sleb)) { in scan_check_cb()
1104 ret = PTR_ERR(sleb); in scan_check_cb()
1113 list_for_each_entry(snod, &sleb->nodes, list) { in scan_check_cb()
1143 free = c->leb_size - sleb->endpt; in scan_check_cb()
1144 dirty = sleb->endpt - used; in scan_check_cb()
1225 ubifs_scan_destroy(sleb); in scan_check_cb()
1234 ubifs_scan_destroy(sleb); in scan_check_cb()
H A Ddebug.c795 const struct ubifs_scan_leb *sleb, int offs) in ubifs_dump_sleb() argument
800 current->pid, sleb->lnum, offs); in ubifs_dump_sleb()
802 list_for_each_entry(snod, &sleb->nodes, list) { in ubifs_dump_sleb()
805 sleb->lnum, snod->offs, snod->len); in ubifs_dump_sleb()
812 struct ubifs_scan_leb *sleb; in ubifs_dump_leb() local
824 sleb = ubifs_scan(c, lnum, 0, buf, 0); in ubifs_dump_leb()
825 if (IS_ERR(sleb)) { in ubifs_dump_leb()
826 ubifs_err(c, "scan error %d", (int)PTR_ERR(sleb)); in ubifs_dump_leb()
831 sleb->nodes_cnt, sleb->endpt); in ubifs_dump_leb()
833 list_for_each_entry(snod, &sleb->nodes, list) { in ubifs_dump_leb()
[all …]
H A Ddebug.h255 const struct ubifs_scan_leb *sleb, int offs);
H A Dubifs.h1742 void ubifs_scan_destroy(struct ubifs_scan_leb *sleb);
1747 void ubifs_end_scan(const struct ubifs_info *c, struct ubifs_scan_leb *sleb,
1749 int ubifs_add_snod(const struct ubifs_info *c, struct ubifs_scan_leb *sleb,
/OK3568_Linux_fs/u-boot/fs/ubifs/
H A Dscan.c133 struct ubifs_scan_leb *sleb; in ubifs_start_scan() local
138 sleb = kzalloc(sizeof(struct ubifs_scan_leb), GFP_NOFS); in ubifs_start_scan()
139 if (!sleb) in ubifs_start_scan()
142 sleb->lnum = lnum; in ubifs_start_scan()
143 INIT_LIST_HEAD(&sleb->nodes); in ubifs_start_scan()
144 sleb->buf = sbuf; in ubifs_start_scan()
150 kfree(sleb); in ubifs_start_scan()
158 return sleb; in ubifs_start_scan()
168 void ubifs_end_scan(const struct ubifs_info *c, struct ubifs_scan_leb *sleb, in ubifs_end_scan() argument
175 sleb->endpt = ALIGN(offs, c->min_io_size); in ubifs_end_scan()
[all …]
H A Dreplay.c539 struct ubifs_scan_leb *sleb; in replay_bud() local
552 sleb = ubifs_recover_leb(c, lnum, offs, c->sbuf, b->bud->jhead); in replay_bud()
554 sleb = ubifs_scan(c, lnum, offs, c->sbuf, 0); in replay_bud()
555 if (IS_ERR(sleb)) in replay_bud()
556 return PTR_ERR(sleb); in replay_bud()
580 list_for_each_entry(snod, &sleb->nodes, list) { in replay_bud()
669 ubifs_assert(sleb->endpt - offs >= used); in replay_bud()
670 ubifs_assert(sleb->endpt % c->min_io_size == 0); in replay_bud()
672 b->dirty = sleb->endpt - offs - used; in replay_bud()
673 b->free = c->leb_size - sleb->endpt; in replay_bud()
[all …]
H A Drecovery.c498 static int fix_unclean_leb(struct ubifs_info *c, struct ubifs_scan_leb *sleb, in fix_unclean_leb() argument
501 int lnum = sleb->lnum, endpt = start; in fix_unclean_leb()
504 if (!list_empty(&sleb->nodes)) { in fix_unclean_leb()
507 snod = list_entry(sleb->nodes.prev, in fix_unclean_leb()
517 lnum, start, sleb->endpt); in fix_unclean_leb()
530 lnum, start, sleb->endpt); in fix_unclean_leb()
539 err = ubifs_leb_read(c, lnum, sleb->buf, 0, in fix_unclean_leb()
549 void *buf = sleb->buf + len - pad_len; in fix_unclean_leb()
554 err = ubifs_leb_change(c, lnum, sleb->buf, len); in fix_unclean_leb()
571 static void drop_last_group(struct ubifs_scan_leb *sleb, int *offs) in drop_last_group() argument
[all …]
H A Dorphan.c550 static int do_kill_orphans(struct ubifs_info *c, struct ubifs_scan_leb *sleb, in do_kill_orphans() argument
560 list_for_each_entry(snod, &sleb->nodes, list) { in do_kill_orphans()
563 snod->type, sleb->lnum, snod->offs); in do_kill_orphans()
590 cmt_no, sleb->lnum, snod->offs); in do_kill_orphans()
594 dbg_rcvry("out of date LEB %d", sleb->lnum); in do_kill_orphans()
618 cmt_no, sleb->lnum, snod->offs); in do_kill_orphans()
661 struct ubifs_scan_leb *sleb; in kill_orphans() local
664 sleb = ubifs_scan(c, lnum, 0, c->sbuf, 1); in kill_orphans()
665 if (IS_ERR(sleb)) { in kill_orphans()
666 if (PTR_ERR(sleb) == -EUCLEAN) in kill_orphans()
[all …]
H A Dgc.c238 static int sort_nodes(struct ubifs_info *c, struct ubifs_scan_leb *sleb, in sort_nodes() argument
247 list_for_each_entry_safe(snod, tmp, &sleb->nodes, list) { in sort_nodes()
269 err = ubifs_tnc_has_node(c, &snod->key, 0, sleb->lnum, in sort_nodes()
289 list_sort(c, &sleb->nodes, &data_nodes_cmp); in sort_nodes()
292 err = dbg_check_data_nodes_order(c, &sleb->nodes); in sort_nodes()
312 static int move_node(struct ubifs_info *c, struct ubifs_scan_leb *sleb, in move_node() argument
322 err = ubifs_tnc_replace(c, &snod->key, sleb->lnum, in move_node()
340 static int move_nodes(struct ubifs_info *c, struct ubifs_scan_leb *sleb) in move_nodes() argument
356 err = sort_nodes(c, sleb, &nondata, &min); in move_nodes()
366 list_for_each_entry_safe(snod, tmp, &sleb->nodes, list) { in move_nodes()
[all …]
H A Dmaster.c32 struct ubifs_scan_leb *sleb; in scan_for_master() local
38 sleb = ubifs_scan(c, lnum, 0, c->sbuf, 1); in scan_for_master()
39 if (IS_ERR(sleb)) in scan_for_master()
40 return PTR_ERR(sleb); in scan_for_master()
41 nodes_cnt = sleb->nodes_cnt; in scan_for_master()
43 snod = list_entry(sleb->nodes.prev, struct ubifs_scan_node, in scan_for_master()
50 ubifs_scan_destroy(sleb); in scan_for_master()
54 sleb = ubifs_scan(c, lnum, 0, c->sbuf, 1); in scan_for_master()
55 if (IS_ERR(sleb)) in scan_for_master()
56 return PTR_ERR(sleb); in scan_for_master()
[all …]
H A Dlog.c627 struct ubifs_scan_leb *sleb; in ubifs_consolidate_log() local
641 sleb = ubifs_scan(c, lnum, 0, c->sbuf, 0); in ubifs_consolidate_log()
642 if (IS_ERR(sleb)) { in ubifs_consolidate_log()
643 err = PTR_ERR(sleb); in ubifs_consolidate_log()
646 list_for_each_entry(snod, &sleb->nodes, list) { in ubifs_consolidate_log()
674 ubifs_scan_destroy(sleb); in ubifs_consolidate_log()
708 ubifs_scan_destroy(sleb); in ubifs_consolidate_log()
H A Dlprops.c1025 struct ubifs_scan_leb *sleb; in scan_check_cb() local
1108 sleb = ubifs_scan(c, lnum, 0, buf, 0); in scan_check_cb()
1109 if (IS_ERR(sleb)) { in scan_check_cb()
1110 ret = PTR_ERR(sleb); in scan_check_cb()
1119 list_for_each_entry(snod, &sleb->nodes, list) { in scan_check_cb()
1149 free = c->leb_size - sleb->endpt; in scan_check_cb()
1150 dirty = sleb->endpt - used; in scan_check_cb()
1231 ubifs_scan_destroy(sleb); in scan_check_cb()
1240 ubifs_scan_destroy(sleb); in scan_check_cb()
H A Ddebug.c805 const struct ubifs_scan_leb *sleb, int offs) in ubifs_dump_sleb() argument
810 current->pid, sleb->lnum, offs); in ubifs_dump_sleb()
812 list_for_each_entry(snod, &sleb->nodes, list) { in ubifs_dump_sleb()
815 sleb->lnum, snod->offs, snod->len); in ubifs_dump_sleb()
822 struct ubifs_scan_leb *sleb; in ubifs_dump_leb() local
834 sleb = ubifs_scan(c, lnum, 0, buf, 0); in ubifs_dump_leb()
835 if (IS_ERR(sleb)) { in ubifs_dump_leb()
836 ubifs_err(c, "scan error %d", (int)PTR_ERR(sleb)); in ubifs_dump_leb()
841 sleb->nodes_cnt, sleb->endpt); in ubifs_dump_leb()
843 list_for_each_entry(snod, &sleb->nodes, list) { in ubifs_dump_leb()
[all …]
H A Dubifs.h2117 void ubifs_scan_destroy(struct ubifs_scan_leb *sleb);
2122 void ubifs_end_scan(const struct ubifs_info *c, struct ubifs_scan_leb *sleb,
2124 int ubifs_add_snod(const struct ubifs_info *c, struct ubifs_scan_leb *sleb,
H A Ddebug.h309 const struct ubifs_scan_leb *sleb, int offs);