Lines Matching refs:ragi

838 	struct xrep_agi	*ragi = buf;  in xrep_agi_buf_cleanup()  local
840 xfarray_destroy(ragi->iunlink_prev); in xrep_agi_buf_cleanup()
841 xfarray_destroy(ragi->iunlink_next); in xrep_agi_buf_cleanup()
842 xagino_bitmap_destroy(&ragi->iunlink_bmp); in xrep_agi_buf_cleanup()
851 struct xrep_agi *ragi) in xrep_agi_find_btrees() argument
853 struct xfs_scrub *sc = ragi->sc; in xrep_agi_find_btrees()
854 struct xrep_find_ag_btree *fab = ragi->fab; in xrep_agi_find_btrees()
887 struct xrep_agi *ragi) in xrep_agi_init_header() argument
889 struct xfs_scrub *sc = ragi->sc; in xrep_agi_init_header()
890 struct xfs_buf *agi_bp = ragi->agi_bp; in xrep_agi_init_header()
891 struct xfs_agi *old_agi = &ragi->old_agi; in xrep_agi_init_header()
915 struct xrep_agi *ragi) in xrep_agi_set_roots() argument
917 struct xfs_scrub *sc = ragi->sc; in xrep_agi_set_roots()
918 struct xfs_agi *agi = ragi->agi_bp->b_addr; in xrep_agi_set_roots()
919 struct xrep_find_ag_btree *fab = ragi->fab; in xrep_agi_set_roots()
933 struct xrep_agi *ragi) in xrep_agi_calc_from_btrees() argument
935 struct xfs_scrub *sc = ragi->sc; in xrep_agi_calc_from_btrees()
936 struct xfs_buf *agi_bp = ragi->agi_bp; in xrep_agi_calc_from_btrees()
984 struct xrep_agi *ragi, in xrep_iunlink_store_next() argument
990 return xfarray_store(ragi->iunlink_next, agino, &next_agino); in xrep_iunlink_store_next()
999 struct xrep_agi *ragi, in xrep_iunlink_store_prev() argument
1005 return xfarray_store(ragi->iunlink_prev, agino, &prev_agino); in xrep_iunlink_store_prev()
1035 struct xrep_agi *ragi, in xrep_iunlink_reload_next() argument
1039 struct xfs_scrub *sc = ragi->sc; in xrep_iunlink_reload_next()
1044 error = xchk_iget(ragi->sc, xfs_agino_to_ino(sc->sa.pag, agino), &ip); in xrep_iunlink_reload_next()
1052 xrep_iunlink_store_next(ragi, agino, NULLAGINO); in xrep_iunlink_reload_next()
1076 struct xrep_agi *ragi, in xrep_iunlink_walk_ondisk_bucket() argument
1079 struct xfs_scrub *sc = ragi->sc; in xrep_iunlink_walk_ondisk_bucket()
1089 if (xchk_should_terminate(ragi->sc, &error)) in xrep_iunlink_walk_ondisk_bucket()
1100 next_agino = xrep_iunlink_reload_next(ragi, prev_agino, in xrep_iunlink_walk_ondisk_bucket()
1132 struct xrep_agi *ragi, in xrep_iunlink_visit() argument
1135 struct xfs_mount *mp = ragi->sc->mp; in xrep_iunlink_visit()
1136 struct xfs_inode *ip = ragi->lookup_batch[batch_idx]; in xrep_iunlink_visit()
1141 ASSERT(XFS_INO_TO_AGNO(mp, ip->i_ino) == pag_agno(ragi->sc->sa.pag)); in xrep_iunlink_visit()
1147 trace_xrep_iunlink_visit(ragi->sc->sa.pag, bucket, in xrep_iunlink_visit()
1148 ragi->iunlink_heads[bucket], ip); in xrep_iunlink_visit()
1150 error = xagino_bitmap_set(&ragi->iunlink_bmp, agino, 1); in xrep_iunlink_visit()
1155 if (ragi->iunlink_heads[bucket] == NULLAGINO) in xrep_iunlink_visit()
1156 ragi->iunlink_heads[bucket] = agino; in xrep_iunlink_visit()
1169 struct xrep_agi *ragi) in xrep_iunlink_mark_incore() argument
1171 struct xfs_perag *pag = ragi->sc->sa.pag; in xrep_iunlink_mark_incore()
1181 if (xchk_should_terminate(ragi->sc, &error)) in xrep_iunlink_mark_incore()
1187 (void **)&ragi->lookup_batch, first_index, in xrep_iunlink_mark_incore()
1195 struct xfs_inode *ip = ragi->lookup_batch[i]; in xrep_iunlink_mark_incore()
1198 ragi->lookup_batch[i] = NULL; in xrep_iunlink_mark_incore()
1223 if (!ragi->lookup_batch[i]) in xrep_iunlink_mark_incore()
1225 error = xrep_iunlink_visit(ragi, i); in xrep_iunlink_mark_incore()
1242 struct xrep_agi *ragi = priv; in xrep_iunlink_mark_ondisk_rec() local
1243 struct xfs_scrub *sc = ragi->sc; in xrep_iunlink_mark_ondisk_rec()
1261 if (xagino_bitmap_test(&ragi->iunlink_bmp, agino, &len)) in xrep_iunlink_mark_ondisk_rec()
1279 error = xchk_iget(ragi->sc, xfs_agino_to_ino(sc->sa.pag, agino), in xrep_iunlink_mark_ondisk_rec()
1287 error = xagino_bitmap_set(&ragi->iunlink_bmp, agino, 1); in xrep_iunlink_mark_ondisk_rec()
1303 struct xrep_agi *ragi) in xrep_iunlink_mark_ondisk() argument
1305 struct xfs_scrub *sc = ragi->sc; in xrep_iunlink_mark_ondisk()
1306 struct xfs_buf *agi_bp = ragi->agi_bp; in xrep_iunlink_mark_ondisk()
1311 error = xfs_btree_query_all(cur, xrep_iunlink_mark_ondisk_rec, ragi); in xrep_iunlink_mark_ondisk()
1322 struct xrep_agi *ragi, in xrep_iunlink_resolve_bucket() argument
1325 struct xfs_scrub *sc = ragi->sc; in xrep_iunlink_resolve_bucket()
1328 xfs_agino_t next_agino = ragi->iunlink_heads[bucket]; in xrep_iunlink_resolve_bucket()
1332 if (xchk_should_terminate(ragi->sc, &error)) in xrep_iunlink_resolve_bucket()
1379 error = xagino_bitmap_clear(&ragi->iunlink_bmp, next_agino, 1); in xrep_iunlink_resolve_bucket()
1385 error = xrep_iunlink_store_next(ragi, prev_agino, in xrep_iunlink_resolve_bucket()
1392 error = xrep_iunlink_store_prev(ragi, next_agino, prev_agino); in xrep_iunlink_resolve_bucket()
1403 error = xrep_iunlink_store_next(ragi, prev_agino, next_agino); in xrep_iunlink_resolve_bucket()
1414 struct xrep_agi *ragi, in xrep_iunlink_add_to_bucket() argument
1424 current_head = ragi->iunlink_heads[bucket]; in xrep_iunlink_add_to_bucket()
1426 trace_xrep_iunlink_add_to_bucket(ragi->sc->sa.pag, bucket, agino, in xrep_iunlink_add_to_bucket()
1429 error = xrep_iunlink_store_next(ragi, agino, current_head); in xrep_iunlink_add_to_bucket()
1435 error = xrep_iunlink_store_prev(ragi, current_head, agino); in xrep_iunlink_add_to_bucket()
1440 ragi->iunlink_heads[bucket] = agino; in xrep_iunlink_add_to_bucket()
1451 struct xrep_agi *ragi = priv; in xrep_iunlink_add_lost_inodes() local
1455 error = xrep_iunlink_add_to_bucket(ragi, start); in xrep_iunlink_add_lost_inodes()
1469 struct xrep_agi *ragi) in xrep_iunlink_rebuild_buckets() argument
1482 error = xrep_iunlink_walk_ondisk_bucket(ragi, i); in xrep_iunlink_rebuild_buckets()
1492 error = xrep_iunlink_mark_incore(ragi); in xrep_iunlink_rebuild_buckets()
1500 xrep_iunlink_mark_ondisk(ragi); in xrep_iunlink_rebuild_buckets()
1508 error = xrep_iunlink_resolve_bucket(ragi, i); in xrep_iunlink_rebuild_buckets()
1518 return xagino_bitmap_walk(&ragi->iunlink_bmp, in xrep_iunlink_rebuild_buckets()
1519 xrep_iunlink_add_lost_inodes, ragi); in xrep_iunlink_rebuild_buckets()
1525 struct xrep_agi *ragi, in xrep_iunlink_relink_next() argument
1529 struct xfs_scrub *sc = ragi->sc; in xrep_iunlink_relink_next()
1551 error = xfarray_load(ragi->iunlink_prev, agino, &prev_agino); in xrep_iunlink_relink_next()
1583 struct xrep_agi *ragi, in xrep_iunlink_relink_prev() argument
1587 struct xfs_scrub *sc = ragi->sc; in xrep_iunlink_relink_prev()
1611 error = xfarray_load(ragi->iunlink_prev, agino, &next_agino); in xrep_iunlink_relink_prev()
1643 struct xrep_agi *ragi) in xrep_iunlink_commit() argument
1645 struct xfs_agi *agi = ragi->agi_bp->b_addr; in xrep_iunlink_commit()
1652 while ((error = xfarray_iter(ragi->iunlink_next, &idx, &agino)) == 1) { in xrep_iunlink_commit()
1653 error = xrep_iunlink_relink_next(ragi, idx, agino); in xrep_iunlink_commit()
1660 while ((error = xfarray_iter(ragi->iunlink_prev, &idx, &agino)) == 1) { in xrep_iunlink_commit()
1661 error = xrep_iunlink_relink_prev(ragi, idx, agino); in xrep_iunlink_commit()
1668 trace_xrep_iunlink_commit_bucket(ragi->sc->sa.pag, i, in xrep_iunlink_commit()
1669 be32_to_cpu(ragi->old_agi.agi_unlinked[i]), in xrep_iunlink_commit()
1670 ragi->iunlink_heads[i]); in xrep_iunlink_commit()
1672 agi->agi_unlinked[i] = cpu_to_be32(ragi->iunlink_heads[i]); in xrep_iunlink_commit()
1681 struct xrep_agi *ragi) in xrep_agi_commit_new() argument
1683 struct xfs_scrub *sc = ragi->sc; in xrep_agi_commit_new()
1684 struct xfs_buf *agi_bp = ragi->agi_bp; in xrep_agi_commit_new()
1709 struct xrep_agi *ragi; in xrep_agi() local
1722 ragi = sc->buf; in xrep_agi()
1723 ragi->sc = sc; in xrep_agi()
1725 ragi->fab[XREP_AGI_INOBT] = (struct xrep_find_ag_btree){ in xrep_agi()
1730 ragi->fab[XREP_AGI_FINOBT] = (struct xrep_find_ag_btree){ in xrep_agi()
1735 ragi->fab[XREP_AGI_END] = (struct xrep_find_ag_btree){ in xrep_agi()
1740 ragi->iunlink_heads[i] = NULLAGINO; in xrep_agi()
1742 xagino_bitmap_init(&ragi->iunlink_bmp); in xrep_agi()
1747 &ragi->iunlink_next); in xrep_agi()
1754 &ragi->iunlink_prev); in xrep_agi()
1766 XFS_FSS_TO_BB(mp, 1), 0, &ragi->agi_bp, NULL); in xrep_agi()
1769 ragi->agi_bp->b_ops = &xfs_agi_buf_ops; in xrep_agi()
1772 error = xrep_agi_find_btrees(ragi); in xrep_agi()
1776 error = xrep_iunlink_rebuild_buckets(ragi); in xrep_agi()
1785 xrep_agi_init_header(ragi); in xrep_agi()
1786 xrep_agi_set_roots(ragi); in xrep_agi()
1787 error = xrep_agi_calc_from_btrees(ragi); in xrep_agi()
1790 error = xrep_iunlink_commit(ragi); in xrep_agi()
1795 return xrep_agi_commit_new(ragi); in xrep_agi()
1800 memcpy(ragi->agi_bp->b_addr, &ragi->old_agi, sizeof(struct xfs_agi)); in xrep_agi()