Lines Matching refs:sc
30 struct xfs_scrub *sc) in xchk_setup_inode_bmap() argument
34 if (xchk_need_intent_drain(sc)) in xchk_setup_inode_bmap()
35 xchk_fsgates_enable(sc, XCHK_FSGATES_DRAIN); in xchk_setup_inode_bmap()
37 error = xchk_iget_for_scrubbing(sc); in xchk_setup_inode_bmap()
41 xchk_ilock(sc, XFS_IOLOCK_EXCL); in xchk_setup_inode_bmap()
48 if (S_ISREG(VFS_I(sc->ip)->i_mode) && in xchk_setup_inode_bmap()
49 sc->sm->sm_type != XFS_SCRUB_TYPE_BMBTA) { in xchk_setup_inode_bmap()
50 struct address_space *mapping = VFS_I(sc->ip)->i_mapping; in xchk_setup_inode_bmap()
52 xchk_ilock(sc, XFS_MMAPLOCK_EXCL); in xchk_setup_inode_bmap()
54 inode_dio_wait(VFS_I(sc->ip)); in xchk_setup_inode_bmap()
77 error = xchk_trans_alloc(sc, 0); in xchk_setup_inode_bmap()
81 xchk_ilock(sc, XFS_ILOCK_EXCL); in xchk_setup_inode_bmap()
95 struct xfs_scrub *sc; member
150 error = xfs_rmap_lookup_le_range(info->sc->sa.rmap_cur, agbno, in xchk_bmap_get_rmap()
153 error = xfs_rmap_lookup_le(info->sc->sa.rmap_cur, agbno, in xchk_bmap_get_rmap()
156 if (!xchk_should_check_xref(info->sc, &error, &info->sc->sa.rmap_cur)) in xchk_bmap_get_rmap()
160 xchk_fblock_xref_set_corrupt(info->sc, info->whichfork, in xchk_bmap_get_rmap()
174 uint64_t owner = info->sc->ip->i_ino; in xchk_bmap_xref_rmap()
176 if (!info->sc->sa.rmap_cur || xchk_skip_xref(info->sc->sm)) in xchk_bmap_xref_rmap()
188 xchk_fblock_xref_set_corrupt(info->sc, info->whichfork, in xchk_bmap_xref_rmap()
193 xchk_fblock_xref_set_corrupt(info->sc, info->whichfork, in xchk_bmap_xref_rmap()
198 xchk_fblock_xref_set_corrupt(info->sc, info->whichfork, in xchk_bmap_xref_rmap()
203 xchk_fblock_xref_set_corrupt(info->sc, info->whichfork, in xchk_bmap_xref_rmap()
208 xchk_fblock_xref_set_corrupt(info->sc, info->whichfork, in xchk_bmap_xref_rmap()
220 xchk_fblock_xref_set_corrupt(info->sc, info->whichfork, in xchk_bmap_xref_rmap()
225 xchk_fblock_xref_set_corrupt(info->sc, info->whichfork, in xchk_bmap_xref_rmap()
228 xchk_fblock_xref_set_corrupt(info->sc, info->whichfork, in xchk_bmap_xref_rmap()
243 if (!info->sc->sa.rmap_cur || xchk_skip_xref(info->sc->sm)) in xchk_bmap_xref_rmap_cow()
256 xchk_fblock_xref_set_corrupt(info->sc, info->whichfork, in xchk_bmap_xref_rmap_cow()
261 xchk_fblock_xref_set_corrupt(info->sc, info->whichfork, in xchk_bmap_xref_rmap_cow()
266 xchk_fblock_xref_set_corrupt(info->sc, info->whichfork, in xchk_bmap_xref_rmap_cow()
276 xchk_fblock_xref_set_corrupt(info->sc, info->whichfork, in xchk_bmap_xref_rmap_cow()
279 xchk_fblock_xref_set_corrupt(info->sc, info->whichfork, in xchk_bmap_xref_rmap_cow()
282 xchk_fblock_xref_set_corrupt(info->sc, info->whichfork, in xchk_bmap_xref_rmap_cow()
293 xchk_xref_is_used_rt_space(info->sc, irec->br_startblock, in xchk_bmap_rt_iextent_xref()
305 struct xfs_mount *mp = info->sc->mp; in xchk_bmap_iextent_xref()
315 error = xchk_ag_init_existing(info->sc, agno, &info->sc->sa); in xchk_bmap_iextent_xref()
316 if (!xchk_fblock_process_error(info->sc, info->whichfork, in xchk_bmap_iextent_xref()
320 xchk_xref_is_used_space(info->sc, agbno, len); in xchk_bmap_iextent_xref()
321 xchk_xref_is_not_inode_chunk(info->sc, agbno, len); in xchk_bmap_iextent_xref()
325 if (!xfs_is_reflink_inode(info->sc->ip)) { in xchk_bmap_iextent_xref()
326 xfs_rmap_ino_owner(&oinfo, info->sc->ip->i_ino, in xchk_bmap_iextent_xref()
328 xchk_xref_is_only_owned_by(info->sc, agbno, in xchk_bmap_iextent_xref()
330 xchk_xref_is_not_shared(info->sc, agbno, in xchk_bmap_iextent_xref()
333 xchk_xref_is_not_cow_staging(info->sc, agbno, in xchk_bmap_iextent_xref()
338 xfs_rmap_ino_owner(&oinfo, info->sc->ip->i_ino, in xchk_bmap_iextent_xref()
340 xchk_xref_is_only_owned_by(info->sc, agbno, irec->br_blockcount, in xchk_bmap_iextent_xref()
342 xchk_xref_is_not_shared(info->sc, agbno, in xchk_bmap_iextent_xref()
344 xchk_xref_is_not_cow_staging(info->sc, agbno, in xchk_bmap_iextent_xref()
349 xchk_xref_is_only_owned_by(info->sc, agbno, irec->br_blockcount, in xchk_bmap_iextent_xref()
351 xchk_xref_is_cow_staging(info->sc, agbno, in xchk_bmap_iextent_xref()
353 xchk_xref_is_not_shared(info->sc, agbno, in xchk_bmap_iextent_xref()
359 xchk_ag_free(info->sc, &info->sc->sa); in xchk_bmap_iextent_xref()
379 xchk_fblock_set_corrupt(info->sc, info->whichfork, in xchk_bmap_dirattr_extent()
384 xchk_fblock_set_corrupt(info->sc, info->whichfork, off); in xchk_bmap_dirattr_extent()
394 struct xfs_mount *mp = info->sc->mp; in xchk_bmap_iextent()
402 xchk_fblock_set_corrupt(info->sc, info->whichfork, in xchk_bmap_iextent()
406 xchk_fblock_set_corrupt(info->sc, info->whichfork, in xchk_bmap_iextent()
414 xchk_fblock_set_corrupt(info->sc, info->whichfork, in xchk_bmap_iextent()
418 xchk_fblock_set_corrupt(info->sc, info->whichfork, in xchk_bmap_iextent()
424 xchk_fblock_set_corrupt(info->sc, info->whichfork, in xchk_bmap_iextent()
427 if (info->sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_bmap_iextent()
463 xchk_fblock_set_corrupt(bs->sc, in xchk_bmapbt_rec()
480 xchk_fblock_set_corrupt(bs->sc, info->whichfork, in xchk_bmapbt_rec()
491 xchk_fblock_set_corrupt(bs->sc, info->whichfork, in xchk_bmapbt_rec()
499 struct xfs_scrub *sc, in xchk_bmap_btree() argument
504 struct xfs_ifork *ifp = xfs_ifork_ptr(sc->ip, whichfork); in xchk_bmap_btree()
505 struct xfs_mount *mp = sc->mp; in xchk_bmap_btree()
506 struct xfs_inode *ip = sc->ip; in xchk_bmap_btree()
513 error = xfs_iread_extents(sc->tp, ip, whichfork); in xchk_bmap_btree()
514 if (!xchk_fblock_process_error(sc, whichfork, 0, &error)) in xchk_bmap_btree()
518 cur = xfs_bmbt_init_cursor(mp, sc->tp, ip, whichfork); in xchk_bmap_btree()
520 error = xchk_btree(sc, cur, xchk_bmapbt_rec, &oinfo, info); in xchk_bmap_btree()
527 struct xfs_scrub *sc; member
543 struct xfs_scrub *sc = sbcri->sc; in xchk_bmap_check_rmap() local
547 if (rec->rm_owner != sc->ip->i_ino) in xchk_bmap_check_rmap()
556 ifp = xfs_ifork_ptr(sc->ip, sbcri->whichfork); in xchk_bmap_check_rmap()
558 xchk_fblock_set_corrupt(sc, sbcri->whichfork, in xchk_bmap_check_rmap()
562 have_map = xfs_iext_lookup_extent(sc->ip, ifp, rec->rm_offset, in xchk_bmap_check_rmap()
565 xchk_fblock_set_corrupt(sc, sbcri->whichfork, in xchk_bmap_check_rmap()
577 xchk_fblock_set_corrupt(sc, sbcri->whichfork, in xchk_bmap_check_rmap()
579 if (irec.br_startblock != XFS_AGB_TO_FSB(sc->mp, in xchk_bmap_check_rmap()
582 xchk_fblock_set_corrupt(sc, sbcri->whichfork, in xchk_bmap_check_rmap()
585 xchk_fblock_set_corrupt(sc, sbcri->whichfork, in xchk_bmap_check_rmap()
587 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_bmap_check_rmap()
596 xchk_fblock_set_corrupt(sc, sbcri->whichfork, in xchk_bmap_check_rmap()
601 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_bmap_check_rmap()
609 struct xfs_scrub *sc, in xchk_bmap_check_ag_rmaps() argument
618 error = xfs_alloc_read_agf(pag, sc->tp, 0, &agf); in xchk_bmap_check_ag_rmaps()
622 cur = xfs_rmapbt_init_cursor(sc->mp, sc->tp, agf, pag); in xchk_bmap_check_ag_rmaps()
624 sbcri.sc = sc; in xchk_bmap_check_ag_rmaps()
631 xfs_trans_brelse(sc->tp, agf); in xchk_bmap_check_ag_rmaps()
643 struct xfs_scrub *sc = info->sc; in xchk_bmap_want_check_rmaps() local
646 if (!xfs_has_rmapbt(sc->mp)) in xchk_bmap_want_check_rmaps()
650 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_bmap_want_check_rmaps()
665 ifp = xfs_ifork_ptr(sc->ip, info->whichfork); in xchk_bmap_want_check_rmaps()
668 i_size_read(VFS_I(sc->ip)) == 0) in xchk_bmap_want_check_rmaps()
680 struct xfs_scrub *sc, in xchk_bmap_check_rmaps() argument
687 for_each_perag(sc->mp, agno, pag) { in xchk_bmap_check_rmaps()
688 error = xchk_bmap_check_ag_rmaps(sc, whichfork, pag); in xchk_bmap_check_rmaps()
690 (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)) { in xchk_bmap_check_rmaps()
706 struct xfs_mount *mp = info->sc->mp; in xchk_bmap_iextent_delalloc()
714 xchk_fblock_set_corrupt(info->sc, info->whichfork, in xchk_bmap_iextent_delalloc()
718 xchk_fblock_set_corrupt(info->sc, info->whichfork, in xchk_bmap_iextent_delalloc()
723 xchk_fblock_set_corrupt(info->sc, info->whichfork, in xchk_bmap_iextent_delalloc()
778 ifp = xfs_ifork_ptr(info->sc->ip, info->whichfork); in xchk_bmap_iext_iter()
786 xchk_fblock_set_corrupt(info->sc, info->whichfork, in xchk_bmap_iext_iter()
801 xchk_fblock_set_corrupt(info->sc, info->whichfork, in xchk_bmap_iext_iter()
818 xchk_ino_set_preen(info->sc, info->sc->ip->i_ino); in xchk_bmap_iext_iter()
831 struct xfs_scrub *sc, in xchk_bmap() argument
836 struct xfs_mount *mp = sc->mp; in xchk_bmap()
837 struct xfs_inode *ip = sc->ip; in xchk_bmap()
849 info.sc = sc; in xchk_bmap()
855 xchk_ino_set_corrupt(sc, sc->ip->i_ino); in xchk_bmap()
861 xchk_ino_set_corrupt(sc, sc->ip->i_ino); in xchk_bmap()
875 xchk_fblock_set_corrupt(sc, whichfork, 0); in xchk_bmap()
881 xchk_fblock_set_corrupt(sc, whichfork, 0); in xchk_bmap()
885 error = xchk_bmap_btree(sc, whichfork, &info); in xchk_bmap()
890 xchk_fblock_set_corrupt(sc, whichfork, 0); in xchk_bmap()
894 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_bmap()
899 if (!xchk_fblock_process_error(sc, whichfork, 0, &error)) in xchk_bmap()
911 if (xchk_should_terminate(sc, &error) || in xchk_bmap()
912 (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)) in xchk_bmap()
916 xchk_fblock_set_corrupt(sc, whichfork, in xchk_bmap()
929 error = xchk_bmap_check_rmaps(sc, whichfork); in xchk_bmap()
930 if (!xchk_fblock_xref_process_error(sc, whichfork, 0, &error)) in xchk_bmap()
940 struct xfs_scrub *sc) in xchk_bmap_data() argument
942 return xchk_bmap(sc, XFS_DATA_FORK); in xchk_bmap_data()
948 struct xfs_scrub *sc) in xchk_bmap_attr() argument
950 return xchk_bmap(sc, XFS_ATTR_FORK); in xchk_bmap_attr()
956 struct xfs_scrub *sc) in xchk_bmap_cow() argument
958 return xchk_bmap(sc, XFS_COW_FORK); in xchk_bmap_cow()