/kernel/linux/linux-5.10/fs/ubifs/ |
H A D | scan.c | 128 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() 159 * @sleb: scanning information 163 void ubifs_end_scan(const struct ubifs_info *c, struct ubifs_scan_leb *sleb, in ubifs_end_scan() argument 181 ubifs_add_snod(const struct ubifs_info *c, struct ubifs_scan_leb *sleb, void *buf, int offs) ubifs_add_snod() argument 259 struct ubifs_scan_leb *sleb; ubifs_scan() local 354 ubifs_scan_destroy(struct ubifs_scan_leb *sleb) ubifs_scan_destroy() argument [all...] |
H A D | replay.c | 578 * @sleb: the scan LEB to authenticate 591 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() 985 struct ubifs_scan_leb *sleb; replay_log_leb() local [all...] |
H A D | recovery.c | 488 * @sleb: scanned LEB information 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 in fix_unclean_leb() 562 drop_last_group(struct ubifs_scan_leb *sleb, int *offs) drop_last_group() argument 591 drop_last_node(struct ubifs_scan_leb *sleb, int *offs) drop_last_node() argument 627 struct ubifs_scan_leb *sleb; ubifs_recover_leb() local 859 struct ubifs_scan_leb *sleb; ubifs_recover_log_leb() local [all...] |
H A D | orphan.c | 621 * @sleb: scanned LEB 630 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() 677 cmt_no, sleb->lnum, snod->offs); in do_kill_orphans() 683 dbg_rcvry("out of date LEB %d", sleb->lnum); in do_kill_orphans() 727 cmt_no, sleb->lnum, snod->offs); in do_kill_orphans() 778 struct ubifs_scan_leb *sleb; in kill_orphans() local 781 sleb = ubifs_scan(c, lnum, 0, c->sbuf, 1); in kill_orphans() 782 if (IS_ERR(sleb)) { in kill_orphans() 952 dbg_read_orphans(struct check_info *ci, struct ubifs_scan_leb *sleb) dbg_read_orphans() argument 991 struct ubifs_scan_leb *sleb; dbg_scan_orphans() local [all...] |
H A D | master.c | 92 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 D | gc.c | 204 * @sleb: describes nodes to sort and contains the result on exit 210 * @sleb->nodes and @nondata lists correspondingly. 228 static int sort_nodes(struct ubifs_info *c, struct ubifs_scan_leb *sleb, in sort_nodes() argument 237 list_for_each_entry_safe(snod, tmp, &sleb->nodes, list) { in sort_nodes() 260 err = ubifs_tnc_has_node(c, &snod->key, 0, sleb->lnum, in sort_nodes() 280 list_sort(c, &sleb->nodes, &data_nodes_cmp); in sort_nodes() 283 err = dbg_check_data_nodes_order(c, &sleb->nodes); in sort_nodes() 295 * @sleb: describes the LEB to move nodes from 303 static int move_node(struct ubifs_info *c, struct ubifs_scan_leb *sleb, in move_node() argument 313 err = ubifs_tnc_replace(c, &snod->key, sleb in move_node() 331 move_nodes(struct ubifs_info *c, struct ubifs_scan_leb *sleb) move_nodes() argument 493 struct ubifs_scan_leb *sleb; ubifs_garbage_collect_leb() local [all...] |
H A D | auth.c | 196 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 D | log.c | 644 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 D | tnc_commit.c | 226 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 D | lprops.c | 1019 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 D | debug.c | 833 struct ubifs_scan_leb *sleb; in ubifs_dump_leb() local 845 sleb = ubifs_scan(c, lnum, 0, buf, 0); in ubifs_dump_leb() 846 if (IS_ERR(sleb)) { in ubifs_dump_leb() 847 ubifs_err(c, "scan error %d", (int)PTR_ERR(sleb)); in ubifs_dump_leb() 852 sleb->nodes_cnt, sleb->endpt); in ubifs_dump_leb() 854 list_for_each_entry(snod, &sleb->nodes, list) { in ubifs_dump_leb() 862 ubifs_scan_destroy(sleb); in ubifs_dump_leb()
|
H A D | ubifs.h | 1747 void ubifs_scan_destroy(struct ubifs_scan_leb *sleb); 1752 void ubifs_end_scan(const struct ubifs_info *c, struct ubifs_scan_leb *sleb, 1754 int ubifs_add_snod(const struct ubifs_info *c, struct ubifs_scan_leb *sleb,
|
/kernel/linux/linux-6.6/fs/ubifs/ |
H A D | scan.c | 128 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() 159 * @sleb: scanning information 163 void ubifs_end_scan(const struct ubifs_info *c, struct ubifs_scan_leb *sleb, in ubifs_end_scan() argument 181 ubifs_add_snod(const struct ubifs_info *c, struct ubifs_scan_leb *sleb, void *buf, int offs) ubifs_add_snod() argument 259 struct ubifs_scan_leb *sleb; ubifs_scan() local 354 ubifs_scan_destroy(struct ubifs_scan_leb *sleb) ubifs_scan_destroy() argument [all...] |
H A D | replay.c | 578 * @sleb: the scan LEB to authenticate 591 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() 985 struct ubifs_scan_leb *sleb; replay_log_leb() local [all...] |
H A D | recovery.c | 488 * @sleb: scanned LEB information 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 in fix_unclean_leb() 562 drop_last_group(struct ubifs_scan_leb *sleb, int *offs) drop_last_group() argument 591 drop_last_node(struct ubifs_scan_leb *sleb, int *offs) drop_last_node() argument 627 struct ubifs_scan_leb *sleb; ubifs_recover_leb() local 859 struct ubifs_scan_leb *sleb; ubifs_recover_log_leb() local [all...] |
H A D | orphan.c | 621 * @sleb: scanned LEB 630 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() 677 cmt_no, sleb->lnum, snod->offs); in do_kill_orphans() 683 dbg_rcvry("out of date LEB %d", sleb->lnum); in do_kill_orphans() 727 cmt_no, sleb->lnum, snod->offs); in do_kill_orphans() 778 struct ubifs_scan_leb *sleb; in kill_orphans() local 781 sleb = ubifs_scan(c, lnum, 0, c->sbuf, 1); in kill_orphans() 782 if (IS_ERR(sleb)) { in kill_orphans() 952 dbg_read_orphans(struct check_info *ci, struct ubifs_scan_leb *sleb) dbg_read_orphans() argument 991 struct ubifs_scan_leb *sleb; dbg_scan_orphans() local [all...] |
H A D | master.c | 92 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 D | gc.c | 204 * @sleb: describes nodes to sort and contains the result on exit 210 * @sleb->nodes and @nondata lists correspondingly. 228 static int sort_nodes(struct ubifs_info *c, struct ubifs_scan_leb *sleb, in sort_nodes() argument 237 list_for_each_entry_safe(snod, tmp, &sleb->nodes, list) { in sort_nodes() 260 err = ubifs_tnc_has_node(c, &snod->key, 0, sleb->lnum, in sort_nodes() 280 list_sort(c, &sleb->nodes, &data_nodes_cmp); in sort_nodes() 283 err = dbg_check_data_nodes_order(c, &sleb->nodes); in sort_nodes() 295 * @sleb: describes the LEB to move nodes from 303 static int move_node(struct ubifs_info *c, struct ubifs_scan_leb *sleb, in move_node() argument 313 err = ubifs_tnc_replace(c, &snod->key, sleb in move_node() 331 move_nodes(struct ubifs_info *c, struct ubifs_scan_leb *sleb) move_nodes() argument 493 struct ubifs_scan_leb *sleb; ubifs_garbage_collect_leb() local [all...] |
H A D | auth.c | 195 struct ubifs_scan_leb *sleb; in ubifs_sb_verify_signature() local 199 sleb = ubifs_scan(c, UBIFS_SB_LNUM, UBIFS_SB_NODE_SZ, c->sbuf, 0); in ubifs_sb_verify_signature() 200 if (IS_ERR(sleb)) { in ubifs_sb_verify_signature() 201 err = PTR_ERR(sleb); in ubifs_sb_verify_signature() 205 if (sleb->nodes_cnt == 0) { in ubifs_sb_verify_signature() 211 snod = list_first_entry(&sleb->nodes, struct ubifs_scan_node, list); in ubifs_sb_verify_signature() 245 ubifs_scan_destroy(sleb); in ubifs_sb_verify_signature()
|
H A D | log.c | 644 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 D | tnc_commit.c | 226 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 D | lprops.c | 1019 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 D | debug.c | 833 struct ubifs_scan_leb *sleb; in ubifs_dump_leb() local 845 sleb = ubifs_scan(c, lnum, 0, buf, 0); in ubifs_dump_leb() 846 if (IS_ERR(sleb)) { in ubifs_dump_leb() 847 ubifs_err(c, "scan error %d", (int)PTR_ERR(sleb)); in ubifs_dump_leb() 852 sleb->nodes_cnt, sleb->endpt); in ubifs_dump_leb() 854 list_for_each_entry(snod, &sleb->nodes, list) { in ubifs_dump_leb() 862 ubifs_scan_destroy(sleb); in ubifs_dump_leb()
|
H A D | ubifs.h | 1776 void ubifs_scan_destroy(struct ubifs_scan_leb *sleb); 1781 void ubifs_end_scan(const struct ubifs_info *c, struct ubifs_scan_leb *sleb, 1783 int ubifs_add_snod(const struct ubifs_info *c, struct ubifs_scan_leb *sleb,
|