Lines Matching refs:sc
44 struct xfs_scrub *sc, in xrep_attempt() argument
50 trace_xrep_attempt(XFS_I(file_inode(sc->file)), sc->sm, error); in xrep_attempt()
52 xchk_ag_btcur_free(&sc->sa); in xrep_attempt()
55 ASSERT(sc->ops->repair); in xrep_attempt()
58 error = sc->ops->repair(sc); in xrep_attempt()
59 trace_xrep_done(XFS_I(file_inode(sc->file)), sc->sm, error); in xrep_attempt()
67 sc->sm->sm_flags &= ~XFS_SCRUB_FLAGS_OUT; in xrep_attempt()
68 sc->flags |= XREP_ALREADY_FIXED; in xrep_attempt()
72 sc->flags |= XCHK_NEED_DRAIN; in xrep_attempt()
77 if (!(sc->flags & XCHK_TRY_HARDER)) { in xrep_attempt()
78 sc->flags |= XCHK_TRY_HARDER; in xrep_attempt()
121 struct xfs_scrub *sc) in xrep_probe() argument
125 if (xchk_should_terminate(sc, &error)) in xrep_probe()
137 struct xfs_scrub *sc) in xrep_roll_ag_trans() argument
150 if (sc->sa.agi_bp) { in xrep_roll_ag_trans()
151 xfs_ialloc_log_agi(sc->tp, sc->sa.agi_bp, XFS_AGI_MAGICNUM); in xrep_roll_ag_trans()
152 xfs_trans_bhold(sc->tp, sc->sa.agi_bp); in xrep_roll_ag_trans()
155 if (sc->sa.agf_bp) { in xrep_roll_ag_trans()
156 xfs_alloc_log_agf(sc->tp, sc->sa.agf_bp, XFS_AGF_MAGICNUM); in xrep_roll_ag_trans()
157 xfs_trans_bhold(sc->tp, sc->sa.agf_bp); in xrep_roll_ag_trans()
166 error = xfs_trans_roll(&sc->tp); in xrep_roll_ag_trans()
171 if (sc->sa.agi_bp) in xrep_roll_ag_trans()
172 xfs_trans_bjoin(sc->tp, sc->sa.agi_bp); in xrep_roll_ag_trans()
173 if (sc->sa.agf_bp) in xrep_roll_ag_trans()
174 xfs_trans_bjoin(sc->tp, sc->sa.agf_bp); in xrep_roll_ag_trans()
182 struct xfs_scrub *sc) in xrep_defer_finish() argument
195 if (sc->sa.agi_bp) { in xrep_defer_finish()
196 xfs_ialloc_log_agi(sc->tp, sc->sa.agi_bp, XFS_AGI_MAGICNUM); in xrep_defer_finish()
197 xfs_trans_bhold(sc->tp, sc->sa.agi_bp); in xrep_defer_finish()
200 if (sc->sa.agf_bp) { in xrep_defer_finish()
201 xfs_alloc_log_agf(sc->tp, sc->sa.agf_bp, XFS_AGF_MAGICNUM); in xrep_defer_finish()
202 xfs_trans_bhold(sc->tp, sc->sa.agf_bp); in xrep_defer_finish()
212 error = xfs_defer_finish(&sc->tp); in xrep_defer_finish()
221 if (sc->sa.agi_bp) in xrep_defer_finish()
222 xfs_trans_bhold_release(sc->tp, sc->sa.agi_bp); in xrep_defer_finish()
223 if (sc->sa.agf_bp) in xrep_defer_finish()
224 xfs_trans_bhold_release(sc->tp, sc->sa.agf_bp); in xrep_defer_finish()
252 struct xfs_scrub *sc) in xrep_calc_ag_resblks() argument
254 struct xfs_mount *mp = sc->mp; in xrep_calc_ag_resblks()
255 struct xfs_scrub_metadata *sm = sc->sm; in xrep_calc_ag_resblks()
389 struct xfs_scrub *sc, in xrep_fix_freelist() argument
394 args.mp = sc->mp; in xrep_fix_freelist()
395 args.tp = sc->tp; in xrep_fix_freelist()
396 args.agno = sc->sa.pag->pag_agno; in xrep_fix_freelist()
398 args.pag = sc->sa.pag; in xrep_fix_freelist()
432 struct xfs_scrub *sc; member
459 struct xfs_mount *mp = ri->sc->mp; in xrep_findroot_block()
466 daddr = XFS_AGB_TO_DADDR(mp, ri->sc->sa.pag->pag_agno, agbno); in xrep_findroot_block()
501 error = xfs_trans_read_buf(mp, ri->sc->tp, mp->m_ddev_targp, daddr, in xrep_findroot_block()
595 trace_xrep_findroot_block(mp, ri->sc->sa.pag->pag_agno, agbno, in xrep_findroot_block()
598 xfs_trans_brelse(ri->sc->tp, bp); in xrep_findroot_block()
644 struct xfs_scrub *sc, in xrep_find_ag_btree_roots() argument
649 struct xfs_mount *mp = sc->mp; in xrep_find_ag_btree_roots()
658 ri.sc = sc; in xrep_find_ag_btree_roots()
669 cur = xfs_rmapbt_init_cursor(mp, sc->tp, agf_bp, sc->sa.pag); in xrep_find_ag_btree_roots()
679 struct xfs_scrub *sc, in xrep_force_quotacheck() argument
685 if (!(flag & sc->mp->m_qflags)) in xrep_force_quotacheck()
688 mutex_lock(&sc->mp->m_quotainfo->qi_quotaofflock); in xrep_force_quotacheck()
689 sc->mp->m_qflags &= ~flag; in xrep_force_quotacheck()
690 spin_lock(&sc->mp->m_sb_lock); in xrep_force_quotacheck()
691 sc->mp->m_sb.sb_qflags &= ~flag; in xrep_force_quotacheck()
692 spin_unlock(&sc->mp->m_sb_lock); in xrep_force_quotacheck()
693 xfs_log_sb(sc->tp); in xrep_force_quotacheck()
694 mutex_unlock(&sc->mp->m_quotainfo->qi_quotaofflock); in xrep_force_quotacheck()
709 struct xfs_scrub *sc) in xrep_ino_dqattach() argument
713 error = xfs_qm_dqattach_locked(sc->ip, false); in xrep_ino_dqattach()
718 xfs_err_ratelimited(sc->mp, in xrep_ino_dqattach()
720 (unsigned long long)sc->ip->i_ino, error); in xrep_ino_dqattach()
721 if (XFS_IS_UQUOTA_ON(sc->mp) && !sc->ip->i_udquot) in xrep_ino_dqattach()
722 xrep_force_quotacheck(sc, XFS_DQTYPE_USER); in xrep_ino_dqattach()
723 if (XFS_IS_GQUOTA_ON(sc->mp) && !sc->ip->i_gdquot) in xrep_ino_dqattach()
724 xrep_force_quotacheck(sc, XFS_DQTYPE_GROUP); in xrep_ino_dqattach()
725 if (XFS_IS_PQUOTA_ON(sc->mp) && !sc->ip->i_pdquot) in xrep_ino_dqattach()
726 xrep_force_quotacheck(sc, XFS_DQTYPE_PROJ); in xrep_ino_dqattach()