Lines Matching full:sc
34 struct xfs_scrub *sc) in xchk_setup_rtbitmap() argument
36 struct xfs_mount *mp = sc->mp; in xchk_setup_rtbitmap()
40 if (xchk_need_intent_drain(sc)) in xchk_setup_rtbitmap()
41 xchk_fsgates_enable(sc, XCHK_FSGATES_DRAIN); in xchk_setup_rtbitmap()
43 rtb = kzalloc(struct_size(rtb, words, xchk_rtbitmap_wordcnt(sc)), in xchk_setup_rtbitmap()
47 sc->buf = rtb; in xchk_setup_rtbitmap()
48 rtb->sc = sc; in xchk_setup_rtbitmap()
50 error = xchk_rtgroup_init(sc, sc->sm->sm_agno, &sc->sr); in xchk_setup_rtbitmap()
54 if (xchk_could_repair(sc)) { in xchk_setup_rtbitmap()
55 error = xrep_setup_rtbitmap(sc, rtb); in xchk_setup_rtbitmap()
60 error = xchk_trans_alloc(sc, rtb->resblks); in xchk_setup_rtbitmap()
64 error = xchk_install_live_inode(sc, rtg_bitmap(sc->sr.rtg)); in xchk_setup_rtbitmap()
68 error = xchk_ino_dqattach(sc); in xchk_setup_rtbitmap()
72 error = xchk_rtgroup_lock(sc, &sc->sr, XCHK_RTGLOCK_ALL); in xchk_setup_rtbitmap()
99 struct xfs_scrub *sc = rtb->sc; in xchk_rtbitmap_xref() local
100 xfs_rgblock_t rgbno = xfs_rtb_to_rgbno(sc->mp, startblock); in xchk_rtbitmap_xref()
102 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_rtbitmap_xref()
104 if (!sc->sr.rmap_cur) in xchk_rtbitmap_xref()
107 xchk_xref_has_no_rt_owner(sc, rgbno, blockcount); in xchk_rtbitmap_xref()
108 xchk_xref_is_not_rt_shared(sc, rgbno, blockcount); in xchk_rtbitmap_xref()
109 xchk_xref_is_not_rt_cow_staging(sc, rgbno, blockcount); in xchk_rtbitmap_xref()
112 xchk_xref_has_rt_owner(sc, rtb->next_free_rgbno, in xchk_rtbitmap_xref()
126 struct xfs_scrub *sc = rtb->sc; in xchk_rtbitmap_rec() local
134 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0); in xchk_rtbitmap_rec()
138 if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT) in xchk_rtbitmap_rec()
147 struct xfs_scrub *sc) in xchk_rtbitmap_check_extents() argument
151 struct xfs_mount *mp = sc->mp; in xchk_rtbitmap_check_extents()
152 struct xfs_inode *ip = sc->ip; in xchk_rtbitmap_check_extents()
160 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, endoff); in xchk_rtbitmap_check_extents()
167 if (xchk_should_terminate(sc, &error) || in xchk_rtbitmap_check_extents()
168 (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)) in xchk_rtbitmap_check_extents()
174 if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, off, &error)) in xchk_rtbitmap_check_extents()
178 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, off); in xchk_rtbitmap_check_extents()
191 struct xfs_scrub *sc) in xchk_rtbitmap() argument
193 struct xfs_mount *mp = sc->mp; in xchk_rtbitmap()
194 struct xfs_rtgroup *rtg = sc->sr.rtg; in xchk_rtbitmap()
196 struct xchk_rtbitmap *rtb = sc->buf; in xchk_rtbitmap()
202 xchk_ino_set_corrupt(sc, rbmip->i_ino); in xchk_rtbitmap()
208 xchk_ino_set_corrupt(sc, rbmip->i_ino); in xchk_rtbitmap()
217 xchk_ino_set_corrupt(sc, rbmip->i_ino); in xchk_rtbitmap()
221 xchk_ino_set_corrupt(sc, rbmip->i_ino); in xchk_rtbitmap()
227 xchk_ino_set_corrupt(sc, rbmip->i_ino); in xchk_rtbitmap()
237 xchk_ino_set_corrupt(sc, rbmip->i_ino); in xchk_rtbitmap()
242 error = xchk_metadata_inode_forks(sc); in xchk_rtbitmap()
243 if (error || (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)) in xchk_rtbitmap()
246 error = xchk_rtbitmap_check_extents(sc); in xchk_rtbitmap()
247 if (error || (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)) in xchk_rtbitmap()
251 error = xfs_rtalloc_query_all(rtg, sc->tp, xchk_rtbitmap_rec, rtb); in xchk_rtbitmap()
252 if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, 0, &error)) in xchk_rtbitmap()
262 xchk_xref_has_rt_owner(sc, rtb->next_free_rgbno, in xchk_rtbitmap()
270 struct xfs_scrub *sc, in xchk_xref_is_used_rt_space() argument
274 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 startext = xfs_rtb_to_rtx(sc->mp, rtbno); in xchk_xref_is_used_rt_space()
285 endext = xfs_rtb_to_rtx(sc->mp, rtbno + len - 1); in xchk_xref_is_used_rt_space()
286 error = xfs_rtalloc_extent_is_free(rtg, sc->tp, startext, in xchk_xref_is_used_rt_space()
288 if (!xchk_should_check_xref(sc, &error, NULL)) in xchk_xref_is_used_rt_space()
291 xchk_ino_xref_set_corrupt(sc, rbmip->i_ino); in xchk_xref_is_used_rt_space()