Lines Matching full:sc
72 struct xfs_scrub *sc, in __xchk_process_error() argument
84 trace_xchk_deadlock_retry(sc->ip, sc->sm, *error); in __xchk_process_error()
89 sc->sm->sm_flags |= errflag; in __xchk_process_error()
93 trace_xchk_op_error(sc, agno, bno, *error, in __xchk_process_error()
102 struct xfs_scrub *sc, in xchk_process_error() argument
107 return __xchk_process_error(sc, agno, bno, error, in xchk_process_error()
113 struct xfs_scrub *sc, in xchk_xref_process_error() argument
118 return __xchk_process_error(sc, agno, bno, error, in xchk_xref_process_error()
125 struct xfs_scrub *sc, in __xchk_fblock_process_error() argument
137 trace_xchk_deadlock_retry(sc->ip, sc->sm, *error); in __xchk_fblock_process_error()
142 sc->sm->sm_flags |= errflag; in __xchk_fblock_process_error()
146 trace_xchk_file_op_error(sc, whichfork, offset, *error, in __xchk_fblock_process_error()
155 struct xfs_scrub *sc, in xchk_fblock_process_error() argument
160 return __xchk_fblock_process_error(sc, whichfork, offset, error, in xchk_fblock_process_error()
166 struct xfs_scrub *sc, in xchk_fblock_xref_process_error() argument
171 return __xchk_fblock_process_error(sc, whichfork, offset, error, in xchk_fblock_xref_process_error()
190 struct xfs_scrub *sc, in xchk_block_set_preen() argument
193 sc->sm->sm_flags |= XFS_SCRUB_OFLAG_PREEN; in xchk_block_set_preen()
194 trace_xchk_block_preen(sc, bp->b_bn, __return_address); in xchk_block_set_preen()
204 struct xfs_scrub *sc, in xchk_ino_set_preen() argument
207 sc->sm->sm_flags |= XFS_SCRUB_OFLAG_PREEN; in xchk_ino_set_preen()
208 trace_xchk_ino_preen(sc, ino, __return_address); in xchk_ino_set_preen()
214 struct xfs_scrub *sc, in xchk_block_set_corrupt() argument
217 sc->sm->sm_flags |= XFS_SCRUB_OFLAG_CORRUPT; in xchk_block_set_corrupt()
218 trace_xchk_block_error(sc, bp->b_bn, __return_address); in xchk_block_set_corrupt()
224 struct xfs_scrub *sc, in xchk_block_xref_set_corrupt() argument
227 sc->sm->sm_flags |= XFS_SCRUB_OFLAG_XCORRUPT; in xchk_block_xref_set_corrupt()
228 trace_xchk_block_error(sc, bp->b_bn, __return_address); in xchk_block_xref_set_corrupt()
238 struct xfs_scrub *sc, in xchk_ino_set_corrupt() argument
241 sc->sm->sm_flags |= XFS_SCRUB_OFLAG_CORRUPT; in xchk_ino_set_corrupt()
242 trace_xchk_ino_error(sc, ino, __return_address); in xchk_ino_set_corrupt()
248 struct xfs_scrub *sc, in xchk_ino_xref_set_corrupt() argument
251 sc->sm->sm_flags |= XFS_SCRUB_OFLAG_XCORRUPT; in xchk_ino_xref_set_corrupt()
252 trace_xchk_ino_error(sc, ino, __return_address); in xchk_ino_xref_set_corrupt()
258 struct xfs_scrub *sc, in xchk_fblock_set_corrupt() argument
262 sc->sm->sm_flags |= XFS_SCRUB_OFLAG_CORRUPT; in xchk_fblock_set_corrupt()
263 trace_xchk_fblock_error(sc, whichfork, offset, __return_address); in xchk_fblock_set_corrupt()
269 struct xfs_scrub *sc, in xchk_fblock_xref_set_corrupt() argument
273 sc->sm->sm_flags |= XFS_SCRUB_OFLAG_XCORRUPT; in xchk_fblock_xref_set_corrupt()
274 trace_xchk_fblock_error(sc, whichfork, offset, __return_address); in xchk_fblock_xref_set_corrupt()
283 struct xfs_scrub *sc, in xchk_ino_set_warning() argument
286 sc->sm->sm_flags |= XFS_SCRUB_OFLAG_WARNING; in xchk_ino_set_warning()
287 trace_xchk_ino_warning(sc, ino, __return_address); in xchk_ino_set_warning()
293 struct xfs_scrub *sc, in xchk_fblock_set_warning() argument
297 sc->sm->sm_flags |= XFS_SCRUB_OFLAG_WARNING; in xchk_fblock_set_warning()
298 trace_xchk_fblock_warning(sc, whichfork, offset, __return_address); in xchk_fblock_set_warning()
304 struct xfs_scrub *sc) in xchk_set_incomplete() argument
306 sc->sm->sm_flags |= XFS_SCRUB_OFLAG_INCOMPLETE; in xchk_set_incomplete()
307 trace_xchk_incomplete(sc, __return_address); in xchk_set_incomplete()
348 struct xfs_scrub *sc, in xchk_count_rmap_ownedby_ag() argument
374 struct xfs_scrub *sc, in want_ag_read_header_failure() argument
378 if (sc->sm->sm_type != XFS_SCRUB_TYPE_AGF && in want_ag_read_header_failure()
379 sc->sm->sm_type != XFS_SCRUB_TYPE_AGFL && in want_ag_read_header_failure()
380 sc->sm->sm_type != XFS_SCRUB_TYPE_AGI) in want_ag_read_header_failure()
387 if (sc->sm->sm_type == type) in want_ag_read_header_failure()
401 struct xfs_scrub *sc, in xchk_ag_read_headers() argument
407 struct xfs_mount *mp = sc->mp; in xchk_ag_read_headers()
410 error = xfs_ialloc_read_agi(mp, sc->tp, agno, agi); in xchk_ag_read_headers()
411 if (error && want_ag_read_header_failure(sc, XFS_SCRUB_TYPE_AGI)) in xchk_ag_read_headers()
414 error = xfs_alloc_read_agf(mp, sc->tp, agno, 0, agf); in xchk_ag_read_headers()
415 if (error && want_ag_read_header_failure(sc, XFS_SCRUB_TYPE_AGF)) in xchk_ag_read_headers()
418 error = xfs_alloc_read_agfl(mp, sc->tp, agno, agfl); in xchk_ag_read_headers()
419 if (error && want_ag_read_header_failure(sc, XFS_SCRUB_TYPE_AGFL)) in xchk_ag_read_headers()
455 struct xfs_scrub *sc, in xchk_ag_btcur_init() argument
458 struct xfs_mount *mp = sc->mp; in xchk_ag_btcur_init()
463 sa->bno_cur = xfs_allocbt_init_cursor(mp, sc->tp, sa->agf_bp, in xchk_ag_btcur_init()
469 sa->cnt_cur = xfs_allocbt_init_cursor(mp, sc->tp, sa->agf_bp, in xchk_ag_btcur_init()
477 sa->ino_cur = xfs_inobt_init_cursor(mp, sc->tp, sa->agi_bp, in xchk_ag_btcur_init()
485 sa->fino_cur = xfs_inobt_init_cursor(mp, sc->tp, sa->agi_bp, in xchk_ag_btcur_init()
493 sa->rmap_cur = xfs_rmapbt_init_cursor(mp, sc->tp, sa->agf_bp, in xchk_ag_btcur_init()
501 sa->refc_cur = xfs_refcountbt_init_cursor(mp, sc->tp, in xchk_ag_btcur_init()
515 struct xfs_scrub *sc, in xchk_ag_free() argument
520 xfs_trans_brelse(sc->tp, sa->agfl_bp); in xchk_ag_free()
524 xfs_trans_brelse(sc->tp, sa->agf_bp); in xchk_ag_free()
528 xfs_trans_brelse(sc->tp, sa->agi_bp); in xchk_ag_free()
547 struct xfs_scrub *sc, in xchk_ag_init() argument
554 error = xchk_ag_read_headers(sc, agno, &sa->agi_bp, in xchk_ag_init()
559 return xchk_ag_btcur_init(sc, sa); in xchk_ag_init()
589 struct xfs_scrub *sc, in xchk_trans_alloc() argument
592 if (sc->sm->sm_flags & XFS_SCRUB_IFLAG_REPAIR) in xchk_trans_alloc()
593 return xfs_trans_alloc(sc->mp, &M_RES(sc->mp)->tr_itruncate, in xchk_trans_alloc()
594 resblks, 0, 0, &sc->tp); in xchk_trans_alloc()
596 return xfs_trans_alloc_empty(sc->mp, &sc->tp); in xchk_trans_alloc()
602 struct xfs_scrub *sc, in xchk_setup_fs() argument
607 resblks = xrep_calc_ag_resblks(sc); in xchk_setup_fs()
608 return xchk_trans_alloc(sc, resblks); in xchk_setup_fs()
614 struct xfs_scrub *sc, in xchk_setup_ag_btree() argument
618 struct xfs_mount *mp = sc->mp; in xchk_setup_ag_btree()
633 error = xchk_setup_fs(sc, ip); in xchk_setup_ag_btree()
637 return xchk_ag_init(sc, sc->sm->sm_agno, &sc->sa); in xchk_setup_ag_btree()
661 struct xfs_scrub *sc, in xchk_get_inode() argument
665 struct xfs_mount *mp = sc->mp; in xchk_get_inode()
670 if (sc->sm->sm_ino == 0 || sc->sm->sm_ino == ip_in->i_ino) { in xchk_get_inode()
671 sc->ip = ip_in; in xchk_get_inode()
676 if (xfs_internal_inum(mp, sc->sm->sm_ino)) in xchk_get_inode()
678 error = xfs_iget(mp, NULL, sc->sm->sm_ino, in xchk_get_inode()
700 error = xfs_imap(sc->mp, sc->tp, sc->sm->sm_ino, &imap, in xchk_get_inode()
707 trace_xchk_op_error(sc, in xchk_get_inode()
708 XFS_INO_TO_AGNO(mp, sc->sm->sm_ino), in xchk_get_inode()
709 XFS_INO_TO_AGBNO(mp, sc->sm->sm_ino), in xchk_get_inode()
713 if (VFS_I(ip)->i_generation != sc->sm->sm_gen) { in xchk_get_inode()
718 sc->ip = ip; in xchk_get_inode()
725 struct xfs_scrub *sc, in xchk_setup_inode_contents() argument
731 error = xchk_get_inode(sc, ip); in xchk_setup_inode_contents()
736 sc->ilock_flags = XFS_IOLOCK_EXCL | XFS_MMAPLOCK_EXCL; in xchk_setup_inode_contents()
737 xfs_ilock(sc->ip, sc->ilock_flags); in xchk_setup_inode_contents()
738 error = xchk_trans_alloc(sc, resblks); in xchk_setup_inode_contents()
741 sc->ilock_flags |= XFS_ILOCK_EXCL; in xchk_setup_inode_contents()
742 xfs_ilock(sc->ip, XFS_ILOCK_EXCL); in xchk_setup_inode_contents()
756 struct xfs_scrub *sc, in xchk_should_check_xref() argument
761 if (xchk_skip_xref(sc->sm)) in xchk_should_check_xref()
777 sc->sm->sm_flags |= XFS_SCRUB_OFLAG_XFAIL; in xchk_should_check_xref()
778 trace_xchk_xref_error(sc, *error, __return_address); in xchk_should_check_xref()
791 struct xfs_scrub *sc, in xchk_buffer_recheck() argument
797 xchk_block_set_corrupt(sc, bp); in xchk_buffer_recheck()
801 xchk_set_incomplete(sc); in xchk_buffer_recheck()
807 sc->sm->sm_flags |= XFS_SCRUB_OFLAG_CORRUPT; in xchk_buffer_recheck()
808 trace_xchk_block_error(sc, bp->b_bn, fa); in xchk_buffer_recheck()
813 * pointed to by sc->ip and the ILOCK must be held.
817 struct xfs_scrub *sc) in xchk_metadata_inode_forks() argument
823 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_metadata_inode_forks()
827 if (sc->ip->i_d.di_flags & XFS_DIFLAG_REALTIME) { in xchk_metadata_inode_forks()
828 xchk_ino_set_corrupt(sc, sc->ip->i_ino); in xchk_metadata_inode_forks()
833 if (xfs_is_reflink_inode(sc->ip)) { in xchk_metadata_inode_forks()
834 xchk_ino_set_corrupt(sc, sc->ip->i_ino); in xchk_metadata_inode_forks()
839 if (xfs_inode_hasattr(sc->ip)) { in xchk_metadata_inode_forks()
840 xchk_ino_set_corrupt(sc, sc->ip->i_ino); in xchk_metadata_inode_forks()
845 smtype = sc->sm->sm_type; in xchk_metadata_inode_forks()
846 sc->sm->sm_type = XFS_SCRUB_TYPE_BMBTD; in xchk_metadata_inode_forks()
847 error = xchk_bmap_data(sc); in xchk_metadata_inode_forks()
848 sc->sm->sm_type = smtype; in xchk_metadata_inode_forks()
849 if (error || (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)) in xchk_metadata_inode_forks()
853 if (xfs_sb_version_hasreflink(&sc->mp->m_sb)) { in xchk_metadata_inode_forks()
854 error = xfs_reflink_inode_has_shared_extents(sc->tp, sc->ip, in xchk_metadata_inode_forks()
856 if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, 0, in xchk_metadata_inode_forks()
860 xchk_ino_set_corrupt(sc, sc->ip->i_ino); in xchk_metadata_inode_forks()