Lines Matching full:sc
35 struct xfs_scrub *sc) in xchk_setup_rtbitmap() argument
37 struct xfs_mount *mp = sc->mp; in xchk_setup_rtbitmap()
41 if (xchk_need_intent_drain(sc)) in xchk_setup_rtbitmap()
42 xchk_fsgates_enable(sc, XCHK_FSGATES_DRAIN); in xchk_setup_rtbitmap()
44 rtb = kzalloc(struct_size(rtb, words, xchk_rtbitmap_wordcnt(sc)), in xchk_setup_rtbitmap()
48 sc->buf = rtb; in xchk_setup_rtbitmap()
49 rtb->sc = sc; in xchk_setup_rtbitmap()
51 error = xchk_rtgroup_init(sc, sc->sm->sm_agno, &sc->sr); in xchk_setup_rtbitmap()
55 if (xchk_could_repair(sc)) { in xchk_setup_rtbitmap()
56 error = xrep_setup_rtbitmap(sc, rtb); in xchk_setup_rtbitmap()
61 error = xchk_trans_alloc(sc, rtb->resblks); in xchk_setup_rtbitmap()
65 error = xchk_install_live_inode(sc, rtg_bitmap(sc->sr.rtg)); in xchk_setup_rtbitmap()
69 error = xchk_ino_dqattach(sc); in xchk_setup_rtbitmap()
73 error = xchk_rtgroup_lock(sc, &sc->sr, XCHK_RTGLOCK_ALL); in xchk_setup_rtbitmap()
100 struct xfs_scrub *sc = rtb->sc; in xchk_rtbitmap_xref() local
101 xfs_rgblock_t rgbno = xfs_rtb_to_rgbno(sc->mp, startblock); in xchk_rtbitmap_xref()
103 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_rtbitmap_xref()
105 if (!sc->sr.rmap_cur) in xchk_rtbitmap_xref()
108 xchk_xref_has_no_rt_owner(sc, rgbno, blockcount); in xchk_rtbitmap_xref()
109 xchk_xref_is_not_rt_shared(sc, rgbno, blockcount); in xchk_rtbitmap_xref()
110 xchk_xref_is_not_rt_cow_staging(sc, rgbno, blockcount); in xchk_rtbitmap_xref()
113 xchk_xref_has_rt_owner(sc, rtb->next_free_rgbno, in xchk_rtbitmap_xref()
127 struct xfs_scrub *sc = rtb->sc; in xchk_rtbitmap_rec() local
135 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0); in xchk_rtbitmap_rec()
139 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_rtbitmap_rec()
148 struct xfs_scrub *sc) in xchk_rtbitmap_check_extents() argument
152 struct xfs_mount *mp = sc->mp; in xchk_rtbitmap_check_extents()
153 struct xfs_inode *ip = sc->ip; in xchk_rtbitmap_check_extents()
161 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, endoff); in xchk_rtbitmap_check_extents()
168 if (xchk_should_terminate(sc, &error) || in xchk_rtbitmap_check_extents()
169 (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)) in xchk_rtbitmap_check_extents()
175 if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, off, &error)) in xchk_rtbitmap_check_extents()
179 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, off); in xchk_rtbitmap_check_extents()
192 struct xfs_scrub *sc) in xchk_rtbitmap() argument
194 struct xfs_mount *mp = sc->mp; in xchk_rtbitmap()
195 struct xfs_rtgroup *rtg = sc->sr.rtg; in xchk_rtbitmap()
197 struct xchk_rtbitmap *rtb = sc->buf; in xchk_rtbitmap()
203 xchk_ino_set_corrupt(sc, rbmip->i_ino); in xchk_rtbitmap()
209 xchk_ino_set_corrupt(sc, rbmip->i_ino); in xchk_rtbitmap()
218 xchk_ino_set_corrupt(sc, rbmip->i_ino); in xchk_rtbitmap()
222 xchk_ino_set_corrupt(sc, rbmip->i_ino); in xchk_rtbitmap()
228 xchk_ino_set_corrupt(sc, rbmip->i_ino); in xchk_rtbitmap()
238 xchk_ino_set_corrupt(sc, rbmip->i_ino); in xchk_rtbitmap()
243 error = xchk_metadata_inode_forks(sc); in xchk_rtbitmap()
244 if (error || (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)) in xchk_rtbitmap()
247 error = xchk_rtbitmap_check_extents(sc); in xchk_rtbitmap()
248 if (error || (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)) in xchk_rtbitmap()
252 error = xfs_rtalloc_query_all(rtg, sc->tp, xchk_rtbitmap_rec, rtb); in xchk_rtbitmap()
253 if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, 0, &error)) in xchk_rtbitmap()
263 xchk_xref_has_rt_owner(sc, rtb->next_free_rgbno, in xchk_rtbitmap()
271 struct xfs_scrub *sc, in xchk_xref_is_used_rt_space() argument
275 struct xfs_rtgroup *rtg = sc->sr.rtg; in xchk_xref_is_used_rt_space()
281 if (xchk_skip_xref(sc->sm)) in xchk_xref_is_used_rt_space()
284 if (xfs_has_zoned(sc->mp)) { in xchk_xref_is_used_rt_space()
286 xfs_rtb_to_rgbno(sc->mp, rtbno) + len - 1)) in xchk_xref_is_used_rt_space()
287 xchk_ino_xref_set_corrupt(sc, rtg_rmap(rtg)->i_ino); in xchk_xref_is_used_rt_space()
291 startext = xfs_rtb_to_rtx(sc->mp, rtbno); in xchk_xref_is_used_rt_space()
292 endext = xfs_rtb_to_rtx(sc->mp, rtbno + len - 1); in xchk_xref_is_used_rt_space()
293 error = xfs_rtalloc_extent_is_free(rtg, sc->tp, startext, in xchk_xref_is_used_rt_space()
295 if (!xchk_should_check_xref(sc, &error, NULL)) in xchk_xref_is_used_rt_space()
298 xchk_ino_xref_set_corrupt(sc, rtg_bitmap(rtg)->i_ino); in xchk_xref_is_used_rt_space()