Lines Matching refs:sc

65 	struct xfs_scrub	*sc,
77 trace_xchk_deadlock_retry(sc->ip, sc->sm, *error);
82 sc->sm->sm_flags |= errflag;
86 trace_xchk_op_error(sc, agno, bno, *error,
95 struct xfs_scrub *sc,
100 return __xchk_process_error(sc, agno, bno, error,
106 struct xfs_scrub *sc,
111 return __xchk_process_error(sc, agno, bno, error,
118 struct xfs_scrub *sc,
130 trace_xchk_deadlock_retry(sc->ip, sc->sm, *error);
135 sc->sm->sm_flags |= errflag;
139 trace_xchk_file_op_error(sc, whichfork, offset, *error,
148 struct xfs_scrub *sc,
153 return __xchk_fblock_process_error(sc, whichfork, offset, error,
159 struct xfs_scrub *sc,
164 return __xchk_fblock_process_error(sc, whichfork, offset, error,
183 struct xfs_scrub *sc,
186 sc->sm->sm_flags |= XFS_SCRUB_OFLAG_PREEN;
187 trace_xchk_block_preen(sc, bp->b_bn, __return_address);
197 struct xfs_scrub *sc,
200 sc->sm->sm_flags |= XFS_SCRUB_OFLAG_PREEN;
201 trace_xchk_ino_preen(sc, ino, __return_address);
207 struct xfs_scrub *sc)
209 sc->sm->sm_flags |= XFS_SCRUB_OFLAG_CORRUPT;
210 trace_xchk_fs_error(sc, 0, __return_address);
216 struct xfs_scrub *sc,
219 sc->sm->sm_flags |= XFS_SCRUB_OFLAG_CORRUPT;
220 trace_xchk_block_error(sc, bp->b_bn, __return_address);
226 struct xfs_scrub *sc,
229 sc->sm->sm_flags |= XFS_SCRUB_OFLAG_XCORRUPT;
230 trace_xchk_block_error(sc, bp->b_bn, __return_address);
240 struct xfs_scrub *sc,
243 sc->sm->sm_flags |= XFS_SCRUB_OFLAG_CORRUPT;
244 trace_xchk_ino_error(sc, ino, __return_address);
250 struct xfs_scrub *sc,
253 sc->sm->sm_flags |= XFS_SCRUB_OFLAG_XCORRUPT;
254 trace_xchk_ino_error(sc, ino, __return_address);
260 struct xfs_scrub *sc,
264 sc->sm->sm_flags |= XFS_SCRUB_OFLAG_CORRUPT;
265 trace_xchk_fblock_error(sc, whichfork, offset, __return_address);
271 struct xfs_scrub *sc,
275 sc->sm->sm_flags |= XFS_SCRUB_OFLAG_XCORRUPT;
276 trace_xchk_fblock_error(sc, whichfork, offset, __return_address);
285 struct xfs_scrub *sc,
288 sc->sm->sm_flags |= XFS_SCRUB_OFLAG_WARNING;
289 trace_xchk_ino_warning(sc, ino, __return_address);
295 struct xfs_scrub *sc,
299 sc->sm->sm_flags |= XFS_SCRUB_OFLAG_WARNING;
300 trace_xchk_fblock_warning(sc, whichfork, offset, __return_address);
306 struct xfs_scrub *sc)
308 sc->sm->sm_flags |= XFS_SCRUB_OFLAG_INCOMPLETE;
309 trace_xchk_incomplete(sc, __return_address);
350 struct xfs_scrub *sc,
376 struct xfs_scrub *sc,
380 if (sc->sm->sm_type != XFS_SCRUB_TYPE_AGF &&
381 sc->sm->sm_type != XFS_SCRUB_TYPE_AGFL &&
382 sc->sm->sm_type != XFS_SCRUB_TYPE_AGI)
389 if (sc->sm->sm_type == type)
403 struct xfs_scrub *sc,
409 struct xfs_mount *mp = sc->mp;
412 error = xfs_ialloc_read_agi(mp, sc->tp, agno, agi);
413 if (error && want_ag_read_header_failure(sc, XFS_SCRUB_TYPE_AGI))
416 error = xfs_alloc_read_agf(mp, sc->tp, agno, 0, agf);
417 if (error && want_ag_read_header_failure(sc, XFS_SCRUB_TYPE_AGF))
420 error = xfs_alloc_read_agfl(mp, sc->tp, agno, agfl);
421 if (error && want_ag_read_header_failure(sc, XFS_SCRUB_TYPE_AGFL))
457 struct xfs_scrub *sc,
460 struct xfs_mount *mp = sc->mp;
463 xchk_perag_get(sc->mp, sa);
465 xchk_ag_btree_healthy_enough(sc, sa->pag, XFS_BTNUM_BNO)) {
467 sa->bno_cur = xfs_allocbt_init_cursor(mp, sc->tp, sa->agf_bp,
474 xchk_ag_btree_healthy_enough(sc, sa->pag, XFS_BTNUM_CNT)) {
476 sa->cnt_cur = xfs_allocbt_init_cursor(mp, sc->tp, sa->agf_bp,
484 xchk_ag_btree_healthy_enough(sc, sa->pag, XFS_BTNUM_INO)) {
485 sa->ino_cur = xfs_inobt_init_cursor(mp, sc->tp, sa->agi_bp,
493 xchk_ag_btree_healthy_enough(sc, sa->pag, XFS_BTNUM_FINO)) {
494 sa->fino_cur = xfs_inobt_init_cursor(mp, sc->tp, sa->agi_bp,
502 xchk_ag_btree_healthy_enough(sc, sa->pag, XFS_BTNUM_RMAP)) {
503 sa->rmap_cur = xfs_rmapbt_init_cursor(mp, sc->tp, sa->agf_bp,
511 xchk_ag_btree_healthy_enough(sc, sa->pag, XFS_BTNUM_REFC)) {
512 sa->refc_cur = xfs_refcountbt_init_cursor(mp, sc->tp,
526 struct xfs_scrub *sc,
531 xfs_trans_brelse(sc->tp, sa->agfl_bp);
535 xfs_trans_brelse(sc->tp, sa->agf_bp);
539 xfs_trans_brelse(sc->tp, sa->agi_bp);
558 struct xfs_scrub *sc,
565 error = xchk_ag_read_headers(sc, agno, &sa->agi_bp,
570 return xchk_ag_btcur_init(sc, sa);
600 struct xfs_scrub *sc,
603 if (sc->sm->sm_flags & XFS_SCRUB_IFLAG_REPAIR)
604 return xfs_trans_alloc(sc->mp, &M_RES(sc->mp)->tr_itruncate,
605 resblks, 0, 0, &sc->tp);
607 return xfs_trans_alloc_empty(sc->mp, &sc->tp);
613 struct xfs_scrub *sc,
618 resblks = xrep_calc_ag_resblks(sc);
619 return xchk_trans_alloc(sc, resblks);
625 struct xfs_scrub *sc,
629 struct xfs_mount *mp = sc->mp;
644 error = xchk_setup_fs(sc, ip);
648 return xchk_ag_init(sc, sc->sm->sm_agno, &sc->sa);
672 struct xfs_scrub *sc,
676 struct xfs_mount *mp = sc->mp;
681 if (sc->sm->sm_ino == 0 || sc->sm->sm_ino == ip_in->i_ino) {
682 sc->ip = ip_in;
687 if (xfs_internal_inum(mp, sc->sm->sm_ino))
689 error = xfs_iget(mp, NULL, sc->sm->sm_ino,
711 error = xfs_imap(sc->mp, sc->tp, sc->sm->sm_ino, &imap,
718 trace_xchk_op_error(sc,
719 XFS_INO_TO_AGNO(mp, sc->sm->sm_ino),
720 XFS_INO_TO_AGBNO(mp, sc->sm->sm_ino),
724 if (VFS_I(ip)->i_generation != sc->sm->sm_gen) {
729 sc->ip = ip;
736 struct xfs_scrub *sc,
742 error = xchk_get_inode(sc, ip);
747 sc->ilock_flags = XFS_IOLOCK_EXCL | XFS_MMAPLOCK_EXCL;
748 xfs_ilock(sc->ip, sc->ilock_flags);
749 error = xchk_trans_alloc(sc, resblks);
752 sc->ilock_flags |= XFS_ILOCK_EXCL;
753 xfs_ilock(sc->ip, XFS_ILOCK_EXCL);
767 struct xfs_scrub *sc,
772 if (xchk_skip_xref(sc->sm))
788 sc->sm->sm_flags |= XFS_SCRUB_OFLAG_XFAIL;
789 trace_xchk_xref_error(sc, *error, __return_address);
802 struct xfs_scrub *sc,
808 xchk_block_set_corrupt(sc, bp);
812 xchk_set_incomplete(sc);
818 sc->sm->sm_flags |= XFS_SCRUB_OFLAG_CORRUPT;
819 trace_xchk_block_error(sc, bp->b_bn, fa);
824 * pointed to by sc->ip and the ILOCK must be held.
828 struct xfs_scrub *sc)
834 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
838 if (sc->ip->i_d.di_flags & XFS_DIFLAG_REALTIME) {
839 xchk_ino_set_corrupt(sc, sc->ip->i_ino);
844 if (xfs_is_reflink_inode(sc->ip)) {
845 xchk_ino_set_corrupt(sc, sc->ip->i_ino);
850 if (xfs_inode_hasattr(sc->ip)) {
851 xchk_ino_set_corrupt(sc, sc->ip->i_ino);
856 smtype = sc->sm->sm_type;
857 sc->sm->sm_type = XFS_SCRUB_TYPE_BMBTD;
858 error = xchk_bmap_data(sc);
859 sc->sm->sm_type = smtype;
860 if (error || (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT))
864 if (xfs_sb_version_hasreflink(&sc->mp->m_sb)) {
865 error = xfs_reflink_inode_has_shared_extents(sc->tp, sc->ip,
867 if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, 0,
871 xchk_ino_set_corrupt(sc, sc->ip->i_ino);
902 struct xfs_scrub *sc)
904 sc->flags |= XCHK_REAPING_DISABLED;
905 xfs_stop_block_reaping(sc->mp);
911 struct xfs_scrub *sc)
913 xfs_start_block_reaping(sc->mp);
914 sc->flags &= ~XCHK_REAPING_DISABLED;