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()
137 error = xfs_rmap_lookup_le(info->sc->sa.rmap_cur, agbno, in xchk_bmap_get_rmap()
140 if (!xchk_should_check_xref(info->sc, &error, &info->sc->sa.rmap_cur)) in xchk_bmap_get_rmap()
144 xchk_fblock_xref_set_corrupt(info->sc, info->whichfork, in xchk_bmap_get_rmap()
160 if (!info->sc->sa.rmap_cur || xchk_skip_xref(info->sc->sm)) in xchk_bmap_xref_rmap()
166 owner = info->sc->ip->i_ino; in xchk_bmap_xref_rmap()
176 xchk_fblock_xref_set_corrupt(info->sc, info->whichfork, in xchk_bmap_xref_rmap()
189 xchk_fblock_xref_set_corrupt(info->sc, in xchk_bmap_xref_rmap()
194 xchk_fblock_xref_set_corrupt(info->sc, info->whichfork, in xchk_bmap_xref_rmap()
207 xchk_fblock_xref_set_corrupt(info->sc, info->whichfork, in xchk_bmap_xref_rmap()
212 xchk_fblock_xref_set_corrupt(info->sc, info->whichfork, in xchk_bmap_xref_rmap()
215 xchk_fblock_xref_set_corrupt(info->sc, info->whichfork, in xchk_bmap_xref_rmap()
226 xchk_xref_is_used_rt_space(info->sc, irec->br_startblock, in xchk_bmap_rt_iextent_xref()
237 struct xfs_mount *mp = info->sc->mp; in xchk_bmap_iextent_xref()
247 error = xchk_ag_init_existing(info->sc, agno, &info->sc->sa); in xchk_bmap_iextent_xref()
248 if (!xchk_fblock_process_error(info->sc, info->whichfork, in xchk_bmap_iextent_xref()
252 xchk_xref_is_used_space(info->sc, agbno, len); in xchk_bmap_iextent_xref()
253 xchk_xref_is_not_inode_chunk(info->sc, agbno, len); in xchk_bmap_iextent_xref()
257 if (xfs_is_reflink_inode(info->sc->ip)) in xchk_bmap_iextent_xref()
261 xchk_xref_is_not_shared(info->sc, agbno, in xchk_bmap_iextent_xref()
265 xchk_xref_is_cow_staging(info->sc, agbno, in xchk_bmap_iextent_xref()
271 xchk_ag_free(info->sc, &info->sc->sa); in xchk_bmap_iextent_xref()
291 xchk_fblock_set_corrupt(info->sc, info->whichfork, in xchk_bmap_dirattr_extent()
296 xchk_fblock_set_corrupt(info->sc, info->whichfork, off); in xchk_bmap_dirattr_extent()
306 struct xfs_mount *mp = info->sc->mp; in xchk_bmap_iextent()
314 xchk_fblock_set_corrupt(info->sc, info->whichfork, in xchk_bmap_iextent()
318 xchk_fblock_set_corrupt(info->sc, info->whichfork, in xchk_bmap_iextent()
325 xchk_fblock_set_corrupt(info->sc, info->whichfork, in xchk_bmap_iextent()
333 xchk_fblock_set_corrupt(info->sc, info->whichfork, in xchk_bmap_iextent()
338 xchk_fblock_set_corrupt(info->sc, info->whichfork, in xchk_bmap_iextent()
342 xchk_fblock_set_corrupt(info->sc, info->whichfork, in xchk_bmap_iextent()
346 xchk_fblock_set_corrupt(info->sc, info->whichfork, in xchk_bmap_iextent()
352 xchk_fblock_set_corrupt(info->sc, info->whichfork, in xchk_bmap_iextent()
355 if (info->sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_bmap_iextent()
394 xchk_fblock_set_corrupt(bs->sc, in xchk_bmapbt_rec()
416 xchk_fblock_set_corrupt(bs->sc, info->whichfork, in xchk_bmapbt_rec()
424 struct xfs_scrub *sc, in xchk_bmap_btree() argument
429 struct xfs_ifork *ifp = xfs_ifork_ptr(sc->ip, whichfork); in xchk_bmap_btree()
430 struct xfs_mount *mp = sc->mp; in xchk_bmap_btree()
431 struct xfs_inode *ip = sc->ip; in xchk_bmap_btree()
438 error = xfs_iread_extents(sc->tp, ip, whichfork); in xchk_bmap_btree()
439 if (!xchk_fblock_process_error(sc, whichfork, 0, &error)) in xchk_bmap_btree()
443 cur = xfs_bmbt_init_cursor(mp, sc->tp, ip, whichfork); in xchk_bmap_btree()
445 error = xchk_btree(sc, cur, xchk_bmapbt_rec, &oinfo, info); in xchk_bmap_btree()
452 struct xfs_scrub *sc; member
468 struct xfs_scrub *sc = sbcri->sc; in xchk_bmap_check_rmap() local
472 if (rec->rm_owner != sc->ip->i_ino) in xchk_bmap_check_rmap()
481 ifp = xfs_ifork_ptr(sc->ip, sbcri->whichfork); in xchk_bmap_check_rmap()
483 xchk_fblock_set_corrupt(sc, sbcri->whichfork, in xchk_bmap_check_rmap()
487 have_map = xfs_iext_lookup_extent(sc->ip, ifp, rec->rm_offset, in xchk_bmap_check_rmap()
490 xchk_fblock_set_corrupt(sc, sbcri->whichfork, in xchk_bmap_check_rmap()
502 xchk_fblock_set_corrupt(sc, sbcri->whichfork, in xchk_bmap_check_rmap()
504 if (irec.br_startblock != XFS_AGB_TO_FSB(sc->mp, in xchk_bmap_check_rmap()
507 xchk_fblock_set_corrupt(sc, sbcri->whichfork, in xchk_bmap_check_rmap()
510 xchk_fblock_set_corrupt(sc, sbcri->whichfork, in xchk_bmap_check_rmap()
512 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_bmap_check_rmap()
521 xchk_fblock_set_corrupt(sc, sbcri->whichfork, in xchk_bmap_check_rmap()
526 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_bmap_check_rmap()
534 struct xfs_scrub *sc, in xchk_bmap_check_ag_rmaps() argument
543 error = xfs_alloc_read_agf(pag, sc->tp, 0, &agf); in xchk_bmap_check_ag_rmaps()
547 cur = xfs_rmapbt_init_cursor(sc->mp, sc->tp, agf, pag); in xchk_bmap_check_ag_rmaps()
549 sbcri.sc = sc; in xchk_bmap_check_ag_rmaps()
556 xfs_trans_brelse(sc->tp, agf); in xchk_bmap_check_ag_rmaps()
563 struct xfs_scrub *sc, in xchk_bmap_check_rmaps() argument
566 struct xfs_ifork *ifp = xfs_ifork_ptr(sc->ip, whichfork); in xchk_bmap_check_rmaps()
572 if (!xfs_has_rmapbt(sc->mp) || in xchk_bmap_check_rmaps()
574 (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)) in xchk_bmap_check_rmaps()
578 if (XFS_IS_REALTIME_INODE(sc->ip) && whichfork == XFS_DATA_FORK) in xchk_bmap_check_rmaps()
581 ASSERT(xfs_ifork_ptr(sc->ip, whichfork) != NULL); in xchk_bmap_check_rmaps()
592 zero_size = i_size_read(VFS_I(sc->ip)) == 0; in xchk_bmap_check_rmaps()
600 for_each_perag(sc->mp, agno, pag) { in xchk_bmap_check_rmaps()
601 error = xchk_bmap_check_ag_rmaps(sc, whichfork, pag); in xchk_bmap_check_rmaps()
604 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_bmap_check_rmaps()
620 struct xfs_scrub *sc, in xchk_bmap() argument
625 struct xfs_mount *mp = sc->mp; in xchk_bmap()
626 struct xfs_inode *ip = sc->ip; in xchk_bmap()
639 info.sc = sc; in xchk_bmap()
645 xchk_ino_set_corrupt(sc, sc->ip->i_ino); in xchk_bmap()
651 xchk_ino_set_corrupt(sc, sc->ip->i_ino); in xchk_bmap()
669 xchk_fblock_set_corrupt(sc, whichfork, 0); in xchk_bmap()
673 error = xchk_bmap_btree(sc, whichfork, &info); in xchk_bmap()
678 xchk_fblock_set_corrupt(sc, whichfork, 0); in xchk_bmap()
682 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_bmap()
687 if (!xchk_fblock_process_error(sc, whichfork, 0, &error)) in xchk_bmap()
694 if (xchk_should_terminate(sc, &error) || in xchk_bmap()
695 (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)) in xchk_bmap()
700 xchk_fblock_set_corrupt(sc, whichfork, in xchk_bmap()
709 error = xchk_bmap_check_rmaps(sc, whichfork); in xchk_bmap()
710 if (!xchk_fblock_xref_process_error(sc, whichfork, 0, &error)) in xchk_bmap()
719 struct xfs_scrub *sc) in xchk_bmap_data() argument
721 return xchk_bmap(sc, XFS_DATA_FORK); in xchk_bmap_data()
727 struct xfs_scrub *sc) in xchk_bmap_attr() argument
729 return xchk_bmap(sc, XFS_ATTR_FORK); in xchk_bmap_attr()
735 struct xfs_scrub *sc) in xchk_bmap_cow() argument
737 if (!xfs_is_reflink_inode(sc->ip)) in xchk_bmap_cow()
740 return xchk_bmap(sc, XFS_COW_FORK); in xchk_bmap_cow()