• Home
  • Raw
  • Download

Lines Matching refs:sc

41 	struct xfs_scrub	*sc)  in xrep_attempt()  argument
45 trace_xrep_attempt(ip, sc->sm, error); in xrep_attempt()
47 xchk_ag_btcur_free(&sc->sa); in xrep_attempt()
50 ASSERT(sc->ops->repair); in xrep_attempt()
51 error = sc->ops->repair(sc); in xrep_attempt()
52 trace_xrep_done(ip, sc->sm, error); in xrep_attempt()
59 sc->sm->sm_flags &= ~XFS_SCRUB_FLAGS_OUT; in xrep_attempt()
60 sc->flags |= XREP_ALREADY_FIXED; in xrep_attempt()
65 if (!(sc->flags & XCHK_TRY_HARDER)) { in xrep_attempt()
66 sc->flags |= XCHK_TRY_HARDER; in xrep_attempt()
103 struct xfs_scrub *sc) in xrep_probe() argument
107 if (xchk_should_terminate(sc, &error)) in xrep_probe()
119 struct xfs_scrub *sc) in xrep_roll_ag_trans() argument
124 if (sc->sa.agi_bp) in xrep_roll_ag_trans()
125 xfs_trans_bhold(sc->tp, sc->sa.agi_bp); in xrep_roll_ag_trans()
126 if (sc->sa.agf_bp) in xrep_roll_ag_trans()
127 xfs_trans_bhold(sc->tp, sc->sa.agf_bp); in xrep_roll_ag_trans()
128 if (sc->sa.agfl_bp) in xrep_roll_ag_trans()
129 xfs_trans_bhold(sc->tp, sc->sa.agfl_bp); in xrep_roll_ag_trans()
138 error = xfs_trans_roll(&sc->tp); in xrep_roll_ag_trans()
143 if (sc->sa.agi_bp) in xrep_roll_ag_trans()
144 xfs_trans_bjoin(sc->tp, sc->sa.agi_bp); in xrep_roll_ag_trans()
145 if (sc->sa.agf_bp) in xrep_roll_ag_trans()
146 xfs_trans_bjoin(sc->tp, sc->sa.agf_bp); in xrep_roll_ag_trans()
147 if (sc->sa.agfl_bp) in xrep_roll_ag_trans()
148 xfs_trans_bjoin(sc->tp, sc->sa.agfl_bp); in xrep_roll_ag_trans()
176 struct xfs_scrub *sc) in xrep_calc_ag_resblks() argument
178 struct xfs_mount *mp = sc->mp; in xrep_calc_ag_resblks()
179 struct xfs_scrub_metadata *sm = sc->sm; in xrep_calc_ag_resblks()
286 struct xfs_scrub *sc, in xrep_alloc_ag_block() argument
298 error = xfs_alloc_get_freelist(sc->tp, sc->sa.agf_bp, &bno, 1); in xrep_alloc_ag_block()
303 xfs_extent_busy_reuse(sc->mp, sc->sa.agno, bno, in xrep_alloc_ag_block()
305 *fsbno = XFS_AGB_TO_FSB(sc->mp, sc->sa.agno, bno); in xrep_alloc_ag_block()
307 xfs_ag_resv_rmapbt_alloc(sc->mp, sc->sa.agno); in xrep_alloc_ag_block()
313 args.tp = sc->tp; in xrep_alloc_ag_block()
314 args.mp = sc->mp; in xrep_alloc_ag_block()
316 args.fsbno = XFS_AGB_TO_FSB(args.mp, sc->sa.agno, 0); in xrep_alloc_ag_block()
337 struct xfs_scrub *sc, in xrep_init_btblock() argument
343 struct xfs_trans *tp = sc->tp; in xrep_init_btblock()
344 struct xfs_mount *mp = sc->mp; in xrep_init_btblock()
351 ASSERT(XFS_FSB_TO_AGNO(mp, fsb) == sc->sa.agno); in xrep_init_btblock()
358 xfs_btree_init_block(mp, bp, btnum, 0, 0, sc->sa.agno); in xrep_init_btblock()
438 struct xfs_scrub *sc, in xrep_invalidate_blocks() argument
456 if (!xfs_verify_fsbno(sc->mp, fsbno)) in xrep_invalidate_blocks()
458 bp = xfs_buf_incore(sc->mp->m_ddev_targp, in xrep_invalidate_blocks()
459 XFS_FSB_TO_DADDR(sc->mp, fsbno), in xrep_invalidate_blocks()
460 XFS_FSB_TO_BB(sc->mp, 1), XBF_TRYLOCK); in xrep_invalidate_blocks()
462 xfs_trans_bjoin(sc->tp, bp); in xrep_invalidate_blocks()
463 xfs_trans_binval(sc->tp, bp); in xrep_invalidate_blocks()
473 struct xfs_scrub *sc, in xrep_fix_freelist() argument
478 args.mp = sc->mp; in xrep_fix_freelist()
479 args.tp = sc->tp; in xrep_fix_freelist()
480 args.agno = sc->sa.agno; in xrep_fix_freelist()
482 args.pag = sc->sa.pag; in xrep_fix_freelist()
493 struct xfs_scrub *sc, in xrep_put_freelist() argument
499 error = xrep_fix_freelist(sc, true); in xrep_put_freelist()
508 error = xfs_rmap_alloc(sc->tp, sc->sa.agf_bp, sc->sa.agno, agbno, 1, in xrep_put_freelist()
514 error = xfs_alloc_put_freelist(sc->tp, sc->sa.agf_bp, sc->sa.agfl_bp, in xrep_put_freelist()
518 xfs_extent_busy_insert(sc->tp, sc->sa.agno, agbno, 1, in xrep_put_freelist()
527 struct xfs_scrub *sc, in xrep_reap_block() argument
539 agno = XFS_FSB_TO_AGNO(sc->mp, fsbno); in xrep_reap_block()
540 agbno = XFS_FSB_TO_AGBNO(sc->mp, fsbno); in xrep_reap_block()
547 if (sc->ip) { in xrep_reap_block()
548 error = xfs_alloc_read_agf(sc->mp, sc->tp, agno, 0, &agf_bp); in xrep_reap_block()
552 agf_bp = sc->sa.agf_bp; in xrep_reap_block()
554 cur = xfs_rmapbt_init_cursor(sc->mp, sc->tp, agf_bp, agno); in xrep_reap_block()
576 error = xfs_rmap_free(sc->tp, agf_bp, agno, agbno, 1, oinfo); in xrep_reap_block()
578 error = xrep_put_freelist(sc, agbno); in xrep_reap_block()
580 error = xfs_free_extent(sc->tp, fsbno, 1, oinfo, resv); in xrep_reap_block()
581 if (agf_bp != sc->sa.agf_bp) in xrep_reap_block()
582 xfs_trans_brelse(sc->tp, agf_bp); in xrep_reap_block()
586 if (sc->ip) in xrep_reap_block()
587 return xfs_trans_roll_inode(&sc->tp, sc->ip); in xrep_reap_block()
588 return xrep_roll_ag_trans(sc); in xrep_reap_block()
591 if (agf_bp != sc->sa.agf_bp) in xrep_reap_block()
592 xfs_trans_brelse(sc->tp, agf_bp); in xrep_reap_block()
599 struct xfs_scrub *sc, in xrep_reap_extents() argument
609 ASSERT(xfs_sb_version_hasrmapbt(&sc->mp->m_sb)); in xrep_reap_extents()
612 ASSERT(sc->ip != NULL || in xrep_reap_extents()
613 XFS_FSB_TO_AGNO(sc->mp, fsbno) == sc->sa.agno); in xrep_reap_extents()
614 trace_xrep_dispose_btree_extent(sc->mp, in xrep_reap_extents()
615 XFS_FSB_TO_AGNO(sc->mp, fsbno), in xrep_reap_extents()
616 XFS_FSB_TO_AGBNO(sc->mp, fsbno), 1); in xrep_reap_extents()
618 error = xrep_reap_block(sc, fsbno, oinfo, type); in xrep_reap_extents()
654 struct xfs_scrub *sc; member
681 struct xfs_mount *mp = ri->sc->mp; in xrep_findroot_block()
688 daddr = XFS_AGB_TO_DADDR(mp, ri->sc->sa.agno, agbno); in xrep_findroot_block()
723 error = xfs_trans_read_buf(mp, ri->sc->tp, mp->m_ddev_targp, daddr, in xrep_findroot_block()
817 trace_xrep_findroot_block(mp, ri->sc->sa.agno, agbno, in xrep_findroot_block()
820 xfs_trans_brelse(ri->sc->tp, bp); in xrep_findroot_block()
866 struct xfs_scrub *sc, in xrep_find_ag_btree_roots() argument
871 struct xfs_mount *mp = sc->mp; in xrep_find_ag_btree_roots()
880 ri.sc = sc; in xrep_find_ag_btree_roots()
891 cur = xfs_rmapbt_init_cursor(mp, sc->tp, agf_bp, sc->sa.agno); in xrep_find_ag_btree_roots()
901 struct xfs_scrub *sc, in xrep_force_quotacheck() argument
907 if (!(flag & sc->mp->m_qflags)) in xrep_force_quotacheck()
910 sc->mp->m_qflags &= ~flag; in xrep_force_quotacheck()
911 spin_lock(&sc->mp->m_sb_lock); in xrep_force_quotacheck()
912 sc->mp->m_sb.sb_qflags &= ~flag; in xrep_force_quotacheck()
913 spin_unlock(&sc->mp->m_sb_lock); in xrep_force_quotacheck()
914 xfs_log_sb(sc->tp); in xrep_force_quotacheck()
929 struct xfs_scrub *sc) in xrep_ino_dqattach() argument
933 error = xfs_qm_dqattach_locked(sc->ip, false); in xrep_ino_dqattach()
938 xfs_err_ratelimited(sc->mp, in xrep_ino_dqattach()
940 (unsigned long long)sc->ip->i_ino, error); in xrep_ino_dqattach()
941 if (XFS_IS_UQUOTA_ON(sc->mp) && !sc->ip->i_udquot) in xrep_ino_dqattach()
942 xrep_force_quotacheck(sc, XFS_DQTYPE_USER); in xrep_ino_dqattach()
943 if (XFS_IS_GQUOTA_ON(sc->mp) && !sc->ip->i_gdquot) in xrep_ino_dqattach()
944 xrep_force_quotacheck(sc, XFS_DQTYPE_GROUP); in xrep_ino_dqattach()
945 if (XFS_IS_PQUOTA_ON(sc->mp) && !sc->ip->i_pdquot) in xrep_ino_dqattach()
946 xrep_force_quotacheck(sc, XFS_DQTYPE_PROJ); in xrep_ino_dqattach()