• Home
  • Raw
  • Download

Lines Matching refs:sc

29 	struct xfs_scrub	*sc,  in xchk_setup_inode_bmap()  argument
34 error = xchk_get_inode(sc, ip); 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(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()
286 xchk_ag_free(info->sc, &info->sc->sa); in xchk_bmap_iextent_xref()
306 xchk_fblock_set_corrupt(info->sc, info->whichfork, in xchk_bmap_dirattr_extent()
311 xchk_fblock_set_corrupt(info->sc, info->whichfork, off); in xchk_bmap_dirattr_extent()
321 struct xfs_mount *mp = info->sc->mp; in xchk_bmap_iextent()
330 xchk_fblock_set_corrupt(info->sc, info->whichfork, in xchk_bmap_iextent()
337 xchk_fblock_set_corrupt(info->sc, info->whichfork, in xchk_bmap_iextent()
345 xchk_fblock_set_corrupt(info->sc, info->whichfork, in xchk_bmap_iextent()
350 xchk_fblock_set_corrupt(info->sc, info->whichfork, in xchk_bmap_iextent()
353 xchk_fblock_set_corrupt(info->sc, info->whichfork, in xchk_bmap_iextent()
359 xchk_fblock_set_corrupt(info->sc, info->whichfork, in xchk_bmap_iextent()
366 xchk_fblock_set_corrupt(info->sc, info->whichfork, in xchk_bmap_iextent()
372 xchk_fblock_set_corrupt(info->sc, info->whichfork, in xchk_bmap_iextent()
375 if (info->sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_bmap_iextent()
414 xchk_fblock_set_corrupt(bs->sc, in xchk_bmapbt_rec()
436 xchk_fblock_set_corrupt(bs->sc, info->whichfork, in xchk_bmapbt_rec()
444 struct xfs_scrub *sc, in xchk_bmap_btree() argument
449 struct xfs_ifork *ifp = XFS_IFORK_PTR(sc->ip, whichfork); in xchk_bmap_btree()
450 struct xfs_mount *mp = sc->mp; in xchk_bmap_btree()
451 struct xfs_inode *ip = sc->ip; in xchk_bmap_btree()
458 error = xfs_iread_extents(sc->tp, ip, whichfork); in xchk_bmap_btree()
459 if (!xchk_fblock_process_error(sc, whichfork, 0, &error)) in xchk_bmap_btree()
464 cur = xfs_bmbt_init_cursor(mp, sc->tp, ip, whichfork); in xchk_bmap_btree()
466 error = xchk_btree(sc, cur, xchk_bmapbt_rec, &oinfo, info); in xchk_bmap_btree()
473 struct xfs_scrub *sc; member
488 struct xfs_scrub *sc = sbcri->sc; in xchk_bmap_check_rmap() local
492 if (rec->rm_owner != sc->ip->i_ino) in xchk_bmap_check_rmap()
501 ifp = XFS_IFORK_PTR(sc->ip, sbcri->whichfork); in xchk_bmap_check_rmap()
503 xchk_fblock_set_corrupt(sc, sbcri->whichfork, in xchk_bmap_check_rmap()
507 have_map = xfs_iext_lookup_extent(sc->ip, ifp, rec->rm_offset, in xchk_bmap_check_rmap()
510 xchk_fblock_set_corrupt(sc, sbcri->whichfork, in xchk_bmap_check_rmap()
521 xchk_fblock_set_corrupt(sc, sbcri->whichfork, in xchk_bmap_check_rmap()
523 if (irec.br_startblock != XFS_AGB_TO_FSB(sc->mp, in xchk_bmap_check_rmap()
525 xchk_fblock_set_corrupt(sc, sbcri->whichfork, in xchk_bmap_check_rmap()
528 xchk_fblock_set_corrupt(sc, sbcri->whichfork, in xchk_bmap_check_rmap()
530 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_bmap_check_rmap()
539 xchk_fblock_set_corrupt(sc, sbcri->whichfork, in xchk_bmap_check_rmap()
544 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_bmap_check_rmap()
552 struct xfs_scrub *sc, in xchk_bmap_check_ag_rmaps() argument
561 error = xfs_alloc_read_agf(sc->mp, sc->tp, agno, 0, &agf); in xchk_bmap_check_ag_rmaps()
565 cur = xfs_rmapbt_init_cursor(sc->mp, sc->tp, agf, agno); in xchk_bmap_check_ag_rmaps()
571 sbcri.sc = sc; in xchk_bmap_check_ag_rmaps()
579 xfs_trans_brelse(sc->tp, agf); in xchk_bmap_check_ag_rmaps()
586 struct xfs_scrub *sc, in xchk_bmap_check_rmaps() argument
589 struct xfs_ifork *ifp = XFS_IFORK_PTR(sc->ip, whichfork); in xchk_bmap_check_rmaps()
594 if (!xfs_sb_version_hasrmapbt(&sc->mp->m_sb) || in xchk_bmap_check_rmaps()
596 (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)) in xchk_bmap_check_rmaps()
600 if (XFS_IS_REALTIME_INODE(sc->ip) && whichfork == XFS_DATA_FORK) in xchk_bmap_check_rmaps()
603 ASSERT(XFS_IFORK_PTR(sc->ip, whichfork) != NULL); in xchk_bmap_check_rmaps()
614 zero_size = i_size_read(VFS_I(sc->ip)) == 0; in xchk_bmap_check_rmaps()
622 for (agno = 0; agno < sc->mp->m_sb.sb_agcount; agno++) { in xchk_bmap_check_rmaps()
623 error = xchk_bmap_check_ag_rmaps(sc, whichfork, agno); in xchk_bmap_check_rmaps()
626 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_bmap_check_rmaps()
641 struct xfs_scrub *sc, in xchk_bmap() argument
646 struct xfs_mount *mp = sc->mp; in xchk_bmap()
647 struct xfs_inode *ip = sc->ip; in xchk_bmap()
660 info.sc = sc; in xchk_bmap()
666 xchk_ino_set_corrupt(sc, sc->ip->i_ino); in xchk_bmap()
673 xchk_ino_set_corrupt(sc, sc->ip->i_ino); in xchk_bmap()
689 xchk_fblock_set_corrupt(sc, whichfork, 0); in xchk_bmap()
695 xchk_fblock_set_corrupt(sc, whichfork, 0); in xchk_bmap()
699 error = xchk_bmap_btree(sc, whichfork, &info); in xchk_bmap()
704 xchk_fblock_set_corrupt(sc, whichfork, 0); in xchk_bmap()
708 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_bmap()
713 if (!xchk_fblock_process_error(sc, whichfork, 0, &error)) in xchk_bmap()
720 if (xchk_should_terminate(sc, &error) || in xchk_bmap()
721 (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)) in xchk_bmap()
726 xchk_fblock_set_corrupt(sc, whichfork, in xchk_bmap()
735 error = xchk_bmap_check_rmaps(sc, whichfork); in xchk_bmap()
736 if (!xchk_fblock_xref_process_error(sc, whichfork, 0, &error)) in xchk_bmap()
745 struct xfs_scrub *sc) in xchk_bmap_data() argument
747 return xchk_bmap(sc, XFS_DATA_FORK); in xchk_bmap_data()
753 struct xfs_scrub *sc) in xchk_bmap_attr() argument
755 return xchk_bmap(sc, XFS_ATTR_FORK); in xchk_bmap_attr()
761 struct xfs_scrub *sc) in xchk_bmap_cow() argument
763 if (!xfs_is_reflink_inode(sc->ip)) in xchk_bmap_cow()
766 return xchk_bmap(sc, XFS_COW_FORK); in xchk_bmap_cow()