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()
47 struct xfs_scrub *sc = priv; in xchk_rtbitmap_rec() local
54 if (!xfs_verify_rtext(sc->mp, startblock, blockcount)) in xchk_rtbitmap_rec()
55 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, 0); in xchk_rtbitmap_rec()
62 struct xfs_scrub *sc) in xchk_rtbitmap_check_extents() argument
64 struct xfs_mount *mp = sc->mp; in xchk_rtbitmap_check_extents()
71 if (xchk_should_terminate(sc, &error) || in xchk_rtbitmap_check_extents()
72 (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)) in xchk_rtbitmap_check_extents()
80 if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, off, &error)) in xchk_rtbitmap_check_extents()
84 xchk_fblock_set_corrupt(sc, XFS_DATA_FORK, off); in xchk_rtbitmap_check_extents()
97 struct xfs_scrub *sc) in xchk_rtbitmap() argument
102 if (sc->mp->m_rbmip->i_disk_size != in xchk_rtbitmap()
103 XFS_FSB_TO_B(sc->mp, sc->mp->m_sb.sb_rbmblocks)) { in xchk_rtbitmap()
104 xchk_ino_set_corrupt(sc, sc->mp->m_rbmip->i_ino); in xchk_rtbitmap()
109 error = xchk_metadata_inode_forks(sc); in xchk_rtbitmap()
110 if (error || (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)) in xchk_rtbitmap()
113 error = xchk_rtbitmap_check_extents(sc); in xchk_rtbitmap()
114 if (error || (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)) in xchk_rtbitmap()
117 error = xfs_rtalloc_query_all(sc->tp, xchk_rtbitmap_rec, sc); in xchk_rtbitmap()
118 if (!xchk_fblock_process_error(sc, XFS_DATA_FORK, 0, &error)) in xchk_rtbitmap()
128 struct xfs_scrub *sc) in xchk_rtsummary() argument
130 struct xfs_inode *rsumip = sc->mp->m_rsumip; in xchk_rtsummary()
131 struct xfs_inode *old_ip = sc->ip; in xchk_rtsummary()
132 uint old_ilock_flags = sc->ilock_flags; in xchk_rtsummary()
142 sc->ip = rsumip; in xchk_rtsummary()
143 sc->ilock_flags = XFS_ILOCK_EXCL | XFS_ILOCK_RTSUM; in xchk_rtsummary()
144 xfs_ilock(sc->ip, sc->ilock_flags); in xchk_rtsummary()
147 error = xchk_metadata_inode_forks(sc); in xchk_rtsummary()
148 if (error || (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)) in xchk_rtsummary()
152 xchk_set_incomplete(sc); in xchk_rtsummary()
155 xfs_iunlock(sc->ip, sc->ilock_flags); in xchk_rtsummary()
156 sc->ilock_flags = old_ilock_flags; in xchk_rtsummary()
157 sc->ip = old_ip; in xchk_rtsummary()
165 struct xfs_scrub *sc, in xchk_xref_is_used_rt_space() argument
175 if (xchk_skip_xref(sc->sm)) in xchk_xref_is_used_rt_space()
180 do_div(startext, sc->mp->m_sb.sb_rextsize); in xchk_xref_is_used_rt_space()
181 do_div(endext, sc->mp->m_sb.sb_rextsize); in xchk_xref_is_used_rt_space()
183 xfs_ilock(sc->mp->m_rbmip, XFS_ILOCK_SHARED | XFS_ILOCK_RTBITMAP); in xchk_xref_is_used_rt_space()
184 error = xfs_rtalloc_extent_is_free(sc->mp, sc->tp, startext, extcount, in xchk_xref_is_used_rt_space()
186 if (!xchk_should_check_xref(sc, &error, NULL)) in xchk_xref_is_used_rt_space()
189 xchk_ino_xref_set_corrupt(sc, sc->mp->m_rbmip->i_ino); in xchk_xref_is_used_rt_space()
191 xfs_iunlock(sc->mp->m_rbmip, XFS_ILOCK_SHARED | XFS_ILOCK_RTBITMAP); in xchk_xref_is_used_rt_space()