Lines Matching refs:sc
23 struct xfs_scrub *sc) in xchk_setup_rt() argument
27 error = xchk_setup_fs(sc); in xchk_setup_rt()
31 sc->ilock_flags = XFS_ILOCK_EXCL | XFS_ILOCK_RTBITMAP; in xchk_setup_rt()
32 sc->ip = sc->mp->m_rbmip; in xchk_setup_rt()
33 xfs_ilock(sc->ip, sc->ilock_flags); in xchk_setup_rt()
48 struct xfs_scrub *sc = priv; in xchk_rtbitmap_rec() local
56 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0); in xchk_rtbitmap_rec()
63 struct xfs_scrub *sc) in xchk_rtbitmap_check_extents() argument
65 struct xfs_mount *mp = sc->mp; in xchk_rtbitmap_check_extents()
72 if (xchk_should_terminate(sc, &error) || in xchk_rtbitmap_check_extents()
73 (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)) in xchk_rtbitmap_check_extents()
81 if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, off, &error)) in xchk_rtbitmap_check_extents()
85 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, off); in xchk_rtbitmap_check_extents()
98 struct xfs_scrub *sc) in xchk_rtbitmap() argument
103 if (sc->mp->m_rbmip->i_disk_size != in xchk_rtbitmap()
104 XFS_FSB_TO_B(sc->mp, sc->mp->m_sb.sb_rbmblocks)) { in xchk_rtbitmap()
105 xchk_ino_set_corrupt(sc, sc->mp->m_rbmip->i_ino); in xchk_rtbitmap()
110 error = xchk_metadata_inode_forks(sc); in xchk_rtbitmap()
111 if (error || (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)) in xchk_rtbitmap()
114 error = xchk_rtbitmap_check_extents(sc); in xchk_rtbitmap()
115 if (error || (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)) in xchk_rtbitmap()
118 error = xfs_rtalloc_query_all(sc->mp, sc->tp, xchk_rtbitmap_rec, sc); in xchk_rtbitmap()
119 if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, 0, &error)) in xchk_rtbitmap()
129 struct xfs_scrub *sc) in xchk_rtsummary() argument
131 struct xfs_inode *rsumip = sc->mp->m_rsumip; in xchk_rtsummary()
132 struct xfs_inode *old_ip = sc->ip; in xchk_rtsummary()
133 uint old_ilock_flags = sc->ilock_flags; in xchk_rtsummary()
143 sc->ip = rsumip; in xchk_rtsummary()
144 sc->ilock_flags = XFS_ILOCK_EXCL | XFS_ILOCK_RTSUM; in xchk_rtsummary()
145 xfs_ilock(sc->ip, sc->ilock_flags); in xchk_rtsummary()
148 error = xchk_metadata_inode_forks(sc); in xchk_rtsummary()
149 if (error || (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)) in xchk_rtsummary()
153 xchk_set_incomplete(sc); in xchk_rtsummary()
156 xfs_iunlock(sc->ip, sc->ilock_flags); in xchk_rtsummary()
157 sc->ilock_flags = old_ilock_flags; in xchk_rtsummary()
158 sc->ip = old_ip; in xchk_rtsummary()
166 struct xfs_scrub *sc, in xchk_xref_is_used_rt_space() argument
176 if (xchk_skip_xref(sc->sm)) in xchk_xref_is_used_rt_space()
181 do_div(startext, sc->mp->m_sb.sb_rextsize); in xchk_xref_is_used_rt_space()
182 do_div(endext, sc->mp->m_sb.sb_rextsize); in xchk_xref_is_used_rt_space()
184 xfs_ilock(sc->mp->m_rbmip, XFS_ILOCK_SHARED | XFS_ILOCK_RTBITMAP); in xchk_xref_is_used_rt_space()
185 error = xfs_rtalloc_extent_is_free(sc->mp, sc->tp, startext, extcount, in xchk_xref_is_used_rt_space()
187 if (!xchk_should_check_xref(sc, &error, NULL)) in xchk_xref_is_used_rt_space()
190 xchk_ino_xref_set_corrupt(sc, sc->mp->m_rbmip->i_ino); in xchk_xref_is_used_rt_space()
192 xfs_iunlock(sc->mp->m_rbmip, XFS_ILOCK_SHARED | XFS_ILOCK_RTBITMAP); in xchk_xref_is_used_rt_space()