Lines Matching refs:error
165 int error; in xrep_setup_ag_rmapbt() local
170 error = xrep_setup_xfbtree(sc, descr); in xrep_setup_ag_rmapbt()
172 if (error) in xrep_setup_ag_rmapbt()
173 return error; in xrep_setup_ag_rmapbt()
191 int error; in xrep_rmap_check_mapping() local
197 error = xfs_alloc_has_records(sc->sa.bno_cur, rec->rm_startblock, in xrep_rmap_check_mapping()
199 if (error) in xrep_rmap_check_mapping()
200 return error; in xrep_rmap_check_mapping()
226 int error = 0; in xrep_rmap_stash() local
228 if (xchk_should_terminate(sc, &error)) in xrep_rmap_stash()
229 return error; in xrep_rmap_stash()
238 error = xfs_rmap_map_raw(mcur, &rmap); in xrep_rmap_stash()
239 xfs_btree_del_cursor(mcur, error); in xrep_rmap_stash()
240 if (error) in xrep_rmap_stash()
243 error = xfbtree_trans_commit(&rr->rmap_btree, sc->tp); in xrep_rmap_stash()
244 if (error) in xrep_rmap_stash()
255 return error; in xrep_rmap_stash()
344 int error; in xrep_rmap_visit_bmbt() local
366 error = xrep_rmap_stash_accumulated(rf); in xrep_rmap_visit_bmbt()
367 if (error) in xrep_rmap_visit_bmbt()
368 return error; in xrep_rmap_visit_bmbt()
412 int error; in xrep_rmap_scan_iroot_btree() local
417 error = xfs_btree_visit_blocks(cur, xrep_rmap_visit_iroot_btree_block, in xrep_rmap_scan_iroot_btree()
419 if (error) in xrep_rmap_scan_iroot_btree()
424 error = xrep_rmap_stash_bitmap(rr, &rf->bmbt_blocks, &oinfo); in xrep_rmap_scan_iroot_btree()
425 if (error) in xrep_rmap_scan_iroot_btree()
429 error = xrep_rmap_stash_accumulated(rf); in xrep_rmap_scan_iroot_btree()
432 return error; in xrep_rmap_scan_iroot_btree()
449 int error; in xrep_rmap_scan_bmbt() local
464 error = xfs_bmap_query_all(cur, xrep_rmap_visit_bmbt, rf); in xrep_rmap_scan_bmbt()
465 if (error) in xrep_rmap_scan_bmbt()
472 error = xrep_rmap_scan_iroot_btree(rf, cur); in xrep_rmap_scan_bmbt()
474 xfs_btree_del_cursor(cur, error); in xrep_rmap_scan_bmbt()
475 return error; in xrep_rmap_scan_bmbt()
489 int error; in xrep_rmap_scan_iext() local
494 error = xrep_rmap_visit_bmbt(NULL, &rec, rf); in xrep_rmap_scan_iext()
495 if (error) in xrep_rmap_scan_iext()
496 return error; in xrep_rmap_scan_iext()
515 int error = 0; in xrep_rmap_scan_ifork() local
528 error = xrep_rmap_scan_bmbt(&rf, ip, &mappings_done); in xrep_rmap_scan_ifork()
529 if (error || mappings_done) in xrep_rmap_scan_ifork()
530 return error; in xrep_rmap_scan_ifork()
574 int error; in xrep_rmap_scan_inode() local
577 error = xrep_rmap_scan_ifork(rr, ip, XFS_DATA_FORK); in xrep_rmap_scan_inode()
578 if (error) in xrep_rmap_scan_inode()
582 error = xrep_rmap_scan_ifork(rr, ip, XFS_ATTR_FORK); in xrep_rmap_scan_inode()
583 if (error) in xrep_rmap_scan_inode()
591 return error; in xrep_rmap_scan_inode()
617 int error; in xrep_rmap_walk_inobt() local
620 error = xagb_bitmap_set_btcur_path(&ri->inobt_blocks, cur); in xrep_rmap_walk_inobt()
621 if (error) in xrep_rmap_walk_inobt()
622 return error; in xrep_rmap_walk_inobt()
652 error = xagb_bitmap_set(&ri->ichunk_blocks, agbno, aglen); in xrep_rmap_walk_inobt()
653 if (error) in xrep_rmap_walk_inobt()
654 return error; in xrep_rmap_walk_inobt()
669 int error; in xrep_rmap_find_inode_rmaps() local
678 error = xfs_btree_query_all(sc->sa.ino_cur, xrep_rmap_walk_inobt, &ri); in xrep_rmap_find_inode_rmaps()
679 if (error) in xrep_rmap_find_inode_rmaps()
689 error = xagb_bitmap_set(&ri.inobt_blocks, in xrep_rmap_find_inode_rmaps()
691 if (error) in xrep_rmap_find_inode_rmaps()
697 error = xagb_bitmap_set_btblocks(&ri.inobt_blocks, in xrep_rmap_find_inode_rmaps()
699 if (error) in xrep_rmap_find_inode_rmaps()
704 error = xrep_rmap_stash_bitmap(rr, &ri.inobt_blocks, in xrep_rmap_find_inode_rmaps()
706 if (error) in xrep_rmap_find_inode_rmaps()
708 error = xrep_rmap_stash_bitmap(rr, &ri.ichunk_blocks, in xrep_rmap_find_inode_rmaps()
714 return error; in xrep_rmap_find_inode_rmaps()
752 int error; in xrep_rmap_find_refcount_rmaps() local
761 error = xagb_bitmap_set_btblocks(&refcountbt_blocks, sc->sa.refc_cur); in xrep_rmap_find_refcount_rmaps()
762 if (error) in xrep_rmap_find_refcount_rmaps()
766 error = xfs_refcount_query_range(sc->sa.refc_cur, &low, &high, in xrep_rmap_find_refcount_rmaps()
768 if (error) in xrep_rmap_find_refcount_rmaps()
772 error = xrep_rmap_stash_bitmap(rr, &cow_blocks, &XFS_RMAP_OINFO_COW); in xrep_rmap_find_refcount_rmaps()
773 if (error) in xrep_rmap_find_refcount_rmaps()
775 error = xrep_rmap_stash_bitmap(rr, &refcountbt_blocks, in xrep_rmap_find_refcount_rmaps()
781 return error; in xrep_rmap_find_refcount_rmaps()
820 int error; in xrep_rmap_check_record() local
822 error = xrep_rmap_check_mapping(rr->sc, rec); in xrep_rmap_check_record()
823 if (error) in xrep_rmap_check_record()
824 return error; in xrep_rmap_check_record()
844 int error; in xrep_rmap_find_rmaps() local
849 error = xrep_rmap_find_inode_rmaps(rr); in xrep_rmap_find_rmaps()
850 if (error) in xrep_rmap_find_rmaps()
853 error = xrep_rmap_find_refcount_rmaps(rr); in xrep_rmap_find_rmaps()
854 if (error) in xrep_rmap_find_rmaps()
857 error = xrep_rmap_find_agheader_rmaps(rr); in xrep_rmap_find_rmaps()
858 if (error) in xrep_rmap_find_rmaps()
861 error = xrep_rmap_find_log_rmaps(rr); in xrep_rmap_find_rmaps()
864 if (error) in xrep_rmap_find_rmaps()
865 return error; in xrep_rmap_find_rmaps()
885 error = xchk_trans_alloc_empty(sc); in xrep_rmap_find_rmaps()
886 if (error) in xrep_rmap_find_rmaps()
887 return error; in xrep_rmap_find_rmaps()
890 while ((error = xchk_iscan_iter(&rr->iscan, &ip)) == 1) { in xrep_rmap_find_rmaps()
891 error = xrep_rmap_scan_inode(rr, ip); in xrep_rmap_find_rmaps()
893 if (error) in xrep_rmap_find_rmaps()
896 if (xchk_should_terminate(sc, &error)) in xrep_rmap_find_rmaps()
900 if (error) in xrep_rmap_find_rmaps()
901 return error; in xrep_rmap_find_rmaps()
908 error = xchk_setup_fs(sc); in xrep_rmap_find_rmaps()
909 if (error) in xrep_rmap_find_rmaps()
910 return error; in xrep_rmap_find_rmaps()
911 error = xchk_perag_drain_and_lock(sc); in xrep_rmap_find_rmaps()
912 if (error) in xrep_rmap_find_rmaps()
913 return error; in xrep_rmap_find_rmaps()
934 error = xfs_rmap_query_all(mcur, xrep_rmap_check_record, rr); in xrep_rmap_find_rmaps()
936 xfs_btree_del_cursor(sc->sa.bno_cur, error); in xrep_rmap_find_rmaps()
938 xfs_btree_del_cursor(mcur, error); in xrep_rmap_find_rmaps()
940 return error; in xrep_rmap_find_rmaps()
987 int error; in xrep_rmap_try_reserve() local
1004 error = xrep_newbt_alloc_blocks(&rr->new_btree, in xrep_rmap_try_reserve()
1006 if (error) in xrep_rmap_try_reserve()
1007 return error; in xrep_rmap_try_reserve()
1017 error = xagb_bitmap_set_btblocks(freesp_blocks, sc->sa.bno_cur); in xrep_rmap_try_reserve()
1018 xfs_btree_del_cursor(sc->sa.bno_cur, error); in xrep_rmap_try_reserve()
1020 if (error) in xrep_rmap_try_reserve()
1021 return error; in xrep_rmap_try_reserve()
1026 error = xagb_bitmap_set_btblocks(freesp_blocks, sc->sa.cnt_cur); in xrep_rmap_try_reserve()
1027 xfs_btree_del_cursor(sc->sa.cnt_cur, error); in xrep_rmap_try_reserve()
1029 if (error) in xrep_rmap_try_reserve()
1030 return error; in xrep_rmap_try_reserve()
1037 error = xagb_bitmap_set(freesp_blocks, resv->agbno, resv->len); in xrep_rmap_try_reserve()
1038 if (error) in xrep_rmap_try_reserve()
1039 return error; in xrep_rmap_try_reserve()
1043 error = xfs_alloc_read_agfl(sc->sa.pag, sc->tp, &agfl_bp); in xrep_rmap_try_reserve()
1044 if (error) in xrep_rmap_try_reserve()
1045 return error; in xrep_rmap_try_reserve()
1047 error = xfs_agfl_walk(sc->mp, agf, agfl_bp, xrep_rmap_walk_agfl, &ra); in xrep_rmap_try_reserve()
1048 if (error) in xrep_rmap_try_reserve()
1049 return error; in xrep_rmap_try_reserve()
1055 error = xfs_btree_bload_compute_geometry(rmap_cur, in xrep_rmap_try_reserve()
1057 if (error) in xrep_rmap_try_reserve()
1058 return error; in xrep_rmap_try_reserve()
1077 int error; in xrep_rmap_reserve_space() local
1080 error = xfs_btree_bload_compute_geometry(rmap_cur, in xrep_rmap_reserve_space()
1082 if (error) in xrep_rmap_reserve_space()
1083 return error; in xrep_rmap_reserve_space()
1086 if (xchk_should_terminate(rr->sc, &error)) in xrep_rmap_reserve_space()
1087 return error; in xrep_rmap_reserve_space()
1098 error = xrep_rmap_try_reserve(rr, rmap_cur, &freesp_blocks, in xrep_rmap_reserve_space()
1100 if (error) in xrep_rmap_reserve_space()
1106 error = xrep_rmap_stash_bitmap(rr, &freesp_blocks, &XFS_RMAP_OINFO_AG); in xrep_rmap_reserve_space()
1111 return error; in xrep_rmap_reserve_space()
1163 int error; in xrep_rmap_get_records() local
1168 error = xfs_btree_increment(rr->mcur, 0, &stat); in xrep_rmap_get_records()
1169 if (error) in xrep_rmap_get_records()
1170 return error; in xrep_rmap_get_records()
1174 error = xfs_rmap_get_rec(rr->mcur, &cur->bc_rec.r, &stat); in xrep_rmap_get_records()
1175 if (error) in xrep_rmap_get_records()
1176 return error; in xrep_rmap_get_records()
1206 int error; in xrep_rmap_alloc_vextent() local
1215 error = xrep_fix_freelist(sc, XFS_ALLOC_FLAG_NORMAP); in xrep_rmap_alloc_vextent()
1216 if (error) in xrep_rmap_alloc_vextent()
1217 return error; in xrep_rmap_alloc_vextent()
1246 int error; in xrep_rmap_count_records() local
1250 error = xfs_btree_goto_left_edge(cur); in xrep_rmap_count_records()
1251 if (error) in xrep_rmap_count_records()
1252 return error; in xrep_rmap_count_records()
1254 while (running && !(error = xfs_btree_increment(cur, 0, &running))) { in xrep_rmap_count_records()
1259 return error; in xrep_rmap_count_records()
1276 int error; in xrep_rmap_build_new_tree() local
1306 error = xrep_rmap_reserve_space(rr, rmap_cur); in xrep_rmap_build_new_tree()
1307 if (error) in xrep_rmap_build_new_tree()
1317 error = xrep_rmap_count_records(rr->mcur, &rr->nr_records); in xrep_rmap_build_new_tree()
1318 if (error) in xrep_rmap_build_new_tree()
1333 error = xfs_btree_goto_left_edge(rr->mcur); in xrep_rmap_build_new_tree()
1334 if (error) in xrep_rmap_build_new_tree()
1338 error = xfs_btree_bload(rmap_cur, &rr->new_btree.bload, rr); in xrep_rmap_build_new_tree()
1339 if (error) in xrep_rmap_build_new_tree()
1366 error = xrep_rmap_reset_counters(rr); in xrep_rmap_build_new_tree()
1367 if (error) in xrep_rmap_build_new_tree()
1371 error = xrep_newbt_commit(&rr->new_btree); in xrep_rmap_build_new_tree()
1372 if (error) in xrep_rmap_build_new_tree()
1373 return error; in xrep_rmap_build_new_tree()
1380 xfs_btree_del_cursor(rr->mcur, error); in xrep_rmap_build_new_tree()
1382 xfs_btree_del_cursor(rmap_cur, error); in xrep_rmap_build_new_tree()
1385 return error; in xrep_rmap_build_new_tree()
1416 int error; in xrep_rmap_find_gaps() local
1419 error = xagb_bitmap_set(&rfg->rmap_gaps, rfg->next_agbno, in xrep_rmap_find_gaps()
1421 if (error) in xrep_rmap_find_gaps()
1422 return error; in xrep_rmap_find_gaps()
1448 int error; in xrep_rmap_remove_old_tree() local
1455 error = xfs_rmap_query_all(mcur, xrep_rmap_find_gaps, &rfg); in xrep_rmap_remove_old_tree()
1456 xfs_btree_del_cursor(mcur, error); in xrep_rmap_remove_old_tree()
1457 if (error) in xrep_rmap_remove_old_tree()
1463 error = xagb_bitmap_set(&rfg.rmap_gaps, rfg.next_agbno, in xrep_rmap_remove_old_tree()
1465 if (error) in xrep_rmap_remove_old_tree()
1472 error = xfs_alloc_query_all(sc->sa.bno_cur, xrep_rmap_find_freesp, in xrep_rmap_remove_old_tree()
1474 xfs_btree_del_cursor(sc->sa.bno_cur, error); in xrep_rmap_remove_old_tree()
1476 if (error) in xrep_rmap_remove_old_tree()
1486 error = xrep_reap_agblocks(sc, &rfg.rmap_gaps, in xrep_rmap_remove_old_tree()
1488 if (error) in xrep_rmap_remove_old_tree()
1500 return error; in xrep_rmap_remove_old_tree()
1548 int error; in xrep_rmapbt_live_update() local
1558 error = xrep_trans_alloc_hook_dummy(mp, &txcookie, &tp); in xrep_rmapbt_live_update()
1559 if (error) in xrep_rmapbt_live_update()
1564 error = __xfs_rmap_finish_intent(mcur, action, p->startblock, in xrep_rmapbt_live_update()
1566 xfs_btree_del_cursor(mcur, error); in xrep_rmapbt_live_update()
1567 if (error) in xrep_rmapbt_live_update()
1570 error = xfbtree_trans_commit(&rr->rmap_btree, tp); in xrep_rmapbt_live_update()
1571 if (error) in xrep_rmapbt_live_update()
1594 int error; in xrep_rmap_setup_scan() local
1599 error = xfs_rmapbt_mem_init(sc->mp, &rr->rmap_btree, sc->xmbtp, in xrep_rmap_setup_scan()
1601 if (error) in xrep_rmap_setup_scan()
1615 error = xfs_rmap_hook_add(sc->sa.pag, &rr->rhook); in xrep_rmap_setup_scan()
1616 if (error) in xrep_rmap_setup_scan()
1625 return error; in xrep_rmap_setup_scan()
1648 int error; in xrep_rmapbt() local
1650 error = xrep_rmap_setup_scan(rr); in xrep_rmapbt()
1651 if (error) in xrep_rmapbt()
1652 return error; in xrep_rmapbt()
1658 error = xrep_rmap_find_rmaps(rr); in xrep_rmapbt()
1659 if (error) in xrep_rmapbt()
1663 error = xrep_rmap_build_new_tree(rr); in xrep_rmapbt()
1664 if (error) in xrep_rmapbt()
1668 error = xrep_rmap_remove_old_tree(rr); in xrep_rmapbt()
1669 if (error) in xrep_rmapbt()
1674 return error; in xrep_rmapbt()