Lines Matching refs:sc

30 	struct xfs_scrub	*sc)  in xchk_setup_inode_bmap()  argument
34 error = xchk_get_inode(sc); in xchk_setup_inode_bmap()
38 sc->ilock_flags = XFS_IOLOCK_EXCL | XFS_MMAPLOCK_EXCL; in xchk_setup_inode_bmap()
39 xfs_ilock(sc->ip, sc->ilock_flags); in xchk_setup_inode_bmap()
46 if (S_ISREG(VFS_I(sc->ip)->i_mode) && in xchk_setup_inode_bmap()
47 sc->sm->sm_type == XFS_SCRUB_TYPE_BMBTD) { in xchk_setup_inode_bmap()
48 struct address_space *mapping = VFS_I(sc->ip)->i_mapping; in xchk_setup_inode_bmap()
50 inode_dio_wait(VFS_I(sc->ip)); in xchk_setup_inode_bmap()
73 error = xchk_trans_alloc(sc, 0); in xchk_setup_inode_bmap()
76 sc->ilock_flags |= XFS_ILOCK_EXCL; in xchk_setup_inode_bmap()
77 xfs_ilock(sc->ip, XFS_ILOCK_EXCL); in xchk_setup_inode_bmap()
92 struct xfs_scrub *sc; member
134 error = xfs_rmap_lookup_le_range(info->sc->sa.rmap_cur, agbno, in xchk_bmap_get_rmap()
136 if (!xchk_should_check_xref(info->sc, &error, in xchk_bmap_get_rmap()
137 &info->sc->sa.rmap_cur)) in xchk_bmap_get_rmap()
145 error = xfs_rmap_lookup_le(info->sc->sa.rmap_cur, agbno, 0, owner, in xchk_bmap_get_rmap()
147 if (!xchk_should_check_xref(info->sc, &error, in xchk_bmap_get_rmap()
148 &info->sc->sa.rmap_cur)) in xchk_bmap_get_rmap()
153 error = xfs_rmap_get_rec(info->sc->sa.rmap_cur, rmap, &has_rmap); in xchk_bmap_get_rmap()
154 if (!xchk_should_check_xref(info->sc, &error, in xchk_bmap_get_rmap()
155 &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()
176 if (!info->sc->sa.rmap_cur || xchk_skip_xref(info->sc->sm)) in xchk_bmap_xref_rmap()
182 owner = info->sc->ip->i_ino; in xchk_bmap_xref_rmap()
192 xchk_fblock_xref_set_corrupt(info->sc, info->whichfork, in xchk_bmap_xref_rmap()
205 xchk_fblock_xref_set_corrupt(info->sc, in xchk_bmap_xref_rmap()
210 xchk_fblock_xref_set_corrupt(info->sc, info->whichfork, in xchk_bmap_xref_rmap()
223 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()
231 xchk_fblock_xref_set_corrupt(info->sc, info->whichfork, in xchk_bmap_xref_rmap()
242 xchk_xref_is_used_rt_space(info->sc, irec->br_startblock, in xchk_bmap_rt_iextent_xref()
253 struct xfs_mount *mp = info->sc->mp; in xchk_bmap_iextent_xref()
263 error = xchk_ag_init_existing(info->sc, agno, &info->sc->sa); in xchk_bmap_iextent_xref()
264 if (!xchk_fblock_process_error(info->sc, info->whichfork, in xchk_bmap_iextent_xref()
268 xchk_xref_is_used_space(info->sc, agbno, len); in xchk_bmap_iextent_xref()
269 xchk_xref_is_not_inode_chunk(info->sc, agbno, len); in xchk_bmap_iextent_xref()
273 if (xfs_is_reflink_inode(info->sc->ip)) in xchk_bmap_iextent_xref()
277 xchk_xref_is_not_shared(info->sc, agbno, in xchk_bmap_iextent_xref()
281 xchk_xref_is_cow_staging(info->sc, agbno, in xchk_bmap_iextent_xref()
287 xchk_ag_free(info->sc, &info->sc->sa); in xchk_bmap_iextent_xref()
307 xchk_fblock_set_corrupt(info->sc, info->whichfork, in xchk_bmap_dirattr_extent()
312 xchk_fblock_set_corrupt(info->sc, info->whichfork, off); in xchk_bmap_dirattr_extent()
322 struct xfs_mount *mp = info->sc->mp; in xchk_bmap_iextent()
330 xchk_fblock_set_corrupt(info->sc, info->whichfork, in xchk_bmap_iextent()
334 xchk_fblock_set_corrupt(info->sc, info->whichfork, in xchk_bmap_iextent()
341 xchk_fblock_set_corrupt(info->sc, info->whichfork, in xchk_bmap_iextent()
349 xchk_fblock_set_corrupt(info->sc, info->whichfork, in xchk_bmap_iextent()
354 xchk_fblock_set_corrupt(info->sc, info->whichfork, in xchk_bmap_iextent()
358 xchk_fblock_set_corrupt(info->sc, info->whichfork, in xchk_bmap_iextent()
362 xchk_fblock_set_corrupt(info->sc, info->whichfork, in xchk_bmap_iextent()
368 xchk_fblock_set_corrupt(info->sc, info->whichfork, in xchk_bmap_iextent()
371 if (info->sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_bmap_iextent()
410 xchk_fblock_set_corrupt(bs->sc, in xchk_bmapbt_rec()
432 xchk_fblock_set_corrupt(bs->sc, info->whichfork, in xchk_bmapbt_rec()
440 struct xfs_scrub *sc, in xchk_bmap_btree() argument
445 struct xfs_ifork *ifp = XFS_IFORK_PTR(sc->ip, whichfork); in xchk_bmap_btree()
446 struct xfs_mount *mp = sc->mp; in xchk_bmap_btree()
447 struct xfs_inode *ip = sc->ip; in xchk_bmap_btree()
454 error = xfs_iread_extents(sc->tp, ip, whichfork); in xchk_bmap_btree()
455 if (!xchk_fblock_process_error(sc, whichfork, 0, &error)) in xchk_bmap_btree()
459 cur = xfs_bmbt_init_cursor(mp, sc->tp, ip, whichfork); in xchk_bmap_btree()
461 error = xchk_btree(sc, cur, xchk_bmapbt_rec, &oinfo, info); in xchk_bmap_btree()
468 struct xfs_scrub *sc; member
484 struct xfs_scrub *sc = sbcri->sc; in xchk_bmap_check_rmap() local
488 if (rec->rm_owner != sc->ip->i_ino) in xchk_bmap_check_rmap()
497 ifp = XFS_IFORK_PTR(sc->ip, sbcri->whichfork); in xchk_bmap_check_rmap()
499 xchk_fblock_set_corrupt(sc, sbcri->whichfork, in xchk_bmap_check_rmap()
503 have_map = xfs_iext_lookup_extent(sc->ip, ifp, rec->rm_offset, in xchk_bmap_check_rmap()
506 xchk_fblock_set_corrupt(sc, sbcri->whichfork, in xchk_bmap_check_rmap()
518 xchk_fblock_set_corrupt(sc, sbcri->whichfork, in xchk_bmap_check_rmap()
520 if (irec.br_startblock != XFS_AGB_TO_FSB(sc->mp, in xchk_bmap_check_rmap()
523 xchk_fblock_set_corrupt(sc, sbcri->whichfork, in xchk_bmap_check_rmap()
526 xchk_fblock_set_corrupt(sc, sbcri->whichfork, in xchk_bmap_check_rmap()
528 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_bmap_check_rmap()
537 xchk_fblock_set_corrupt(sc, sbcri->whichfork, in xchk_bmap_check_rmap()
542 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_bmap_check_rmap()
550 struct xfs_scrub *sc, in xchk_bmap_check_ag_rmaps() argument
559 error = xfs_alloc_read_agf(sc->mp, sc->tp, pag->pag_agno, 0, &agf); in xchk_bmap_check_ag_rmaps()
563 cur = xfs_rmapbt_init_cursor(sc->mp, sc->tp, agf, pag); in xchk_bmap_check_ag_rmaps()
565 sbcri.sc = sc; in xchk_bmap_check_ag_rmaps()
572 xfs_trans_brelse(sc->tp, agf); in xchk_bmap_check_ag_rmaps()
579 struct xfs_scrub *sc, in xchk_bmap_check_rmaps() argument
582 struct xfs_ifork *ifp = XFS_IFORK_PTR(sc->ip, whichfork); in xchk_bmap_check_rmaps()
588 if (!xfs_has_rmapbt(sc->mp) || in xchk_bmap_check_rmaps()
590 (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)) in xchk_bmap_check_rmaps()
594 if (XFS_IS_REALTIME_INODE(sc->ip) && whichfork == XFS_DATA_FORK) in xchk_bmap_check_rmaps()
597 ASSERT(XFS_IFORK_PTR(sc->ip, whichfork) != NULL); in xchk_bmap_check_rmaps()
608 zero_size = i_size_read(VFS_I(sc->ip)) == 0; in xchk_bmap_check_rmaps()
616 for_each_perag(sc->mp, agno, pag) { in xchk_bmap_check_rmaps()
617 error = xchk_bmap_check_ag_rmaps(sc, whichfork, pag); in xchk_bmap_check_rmaps()
620 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_bmap_check_rmaps()
636 struct xfs_scrub *sc, in xchk_bmap() argument
641 struct xfs_mount *mp = sc->mp; in xchk_bmap()
642 struct xfs_inode *ip = sc->ip; in xchk_bmap()
655 info.sc = sc; in xchk_bmap()
661 xchk_ino_set_corrupt(sc, sc->ip->i_ino); in xchk_bmap()
667 xchk_ino_set_corrupt(sc, sc->ip->i_ino); in xchk_bmap()
685 xchk_fblock_set_corrupt(sc, whichfork, 0); in xchk_bmap()
689 error = xchk_bmap_btree(sc, whichfork, &info); in xchk_bmap()
694 xchk_fblock_set_corrupt(sc, whichfork, 0); in xchk_bmap()
698 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_bmap()
703 if (!xchk_fblock_process_error(sc, whichfork, 0, &error)) in xchk_bmap()
710 if (xchk_should_terminate(sc, &error) || in xchk_bmap()
711 (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)) in xchk_bmap()
716 xchk_fblock_set_corrupt(sc, whichfork, in xchk_bmap()
725 error = xchk_bmap_check_rmaps(sc, whichfork); in xchk_bmap()
726 if (!xchk_fblock_xref_process_error(sc, whichfork, 0, &error)) in xchk_bmap()
735 struct xfs_scrub *sc) in xchk_bmap_data() argument
737 return xchk_bmap(sc, XFS_DATA_FORK); in xchk_bmap_data()
743 struct xfs_scrub *sc) in xchk_bmap_attr() argument
745 return xchk_bmap(sc, XFS_ATTR_FORK); in xchk_bmap_attr()
751 struct xfs_scrub *sc) in xchk_bmap_cow() argument
753 if (!xfs_is_reflink_inode(sc->ip)) in xchk_bmap_cow()
756 return xchk_bmap(sc, XFS_COW_FORK); in xchk_bmap_cow()