Lines Matching defs:xc

84  * space.  Caller must ensure that the physical range is within xc->irec.
88 struct xrep_cow *xc,
94 startoff = xc->irec.br_startoff +
95 (startblock - xc->irec.br_startblock);
97 trace_xrep_cow_mark_file_range(xc->sc->ip, startblock, startoff,
100 return xoff_bitmap_set(&xc->bad_fileoffs, startoff, blockcount);
109 struct xrep_cow *xc,
117 if (dst->rc_startblock < xc->irec_startbno) {
118 adj = xc->irec_startbno - dst->rc_startblock;
124 xc->irec_startbno + xc->irec.br_blockcount) {
126 (xc->irec_startbno + xc->irec.br_blockcount);
138 struct xrep_cow *xc = priv;
146 xrep_cow_trim_refcount(xc, &rrec, rec);
148 fsbno = XFS_AGB_TO_FSB(xc->sc->mp, cur->bc_ag.pag->pag_agno,
150 return xrep_cow_mark_file_range(xc, fsbno, rrec.rc_blockcount);
167 struct xrep_cow *xc = priv;
175 xrep_cow_trim_refcount(xc, &rrec, rec);
177 if (xc->next_bno >= rrec.rc_startblock)
180 error = xrep_cow_mark_file_range(xc,
181 XFS_AGB_TO_FSB(xc->sc->mp, cur->bc_ag.pag->pag_agno,
182 xc->next_bno),
183 rrec.rc_startblock - xc->next_bno);
188 xc->next_bno = rrec.rc_startblock + rrec.rc_blockcount;
202 struct xrep_cow *xc = priv;
213 if (rec_bno < xc->irec_startbno) {
214 adj = xc->irec_startbno - rec_bno;
219 if (rec_bno + rec_len > xc->irec_startbno + xc->irec.br_blockcount) {
221 (xc->irec_startbno + xc->irec.br_blockcount);
225 fsbno = XFS_AGB_TO_FSB(xc->sc->mp, cur->bc_ag.pag->pag_agno, rec_bno);
226 return xrep_cow_mark_file_range(xc, fsbno, rec_len);
235 struct xrep_cow *xc)
242 struct xfs_scrub *sc = xc->sc;
246 agno = XFS_FSB_TO_AGNO(sc->mp, xc->irec.br_startblock);
247 xc->irec_startbno = XFS_FSB_TO_AGBNO(sc->mp, xc->irec.br_startblock);
258 rc_low.rc_startblock = xc->irec_startbno;
259 rc_high.rc_startblock = xc->irec_startbno + xc->irec.br_blockcount - 1;
262 xrep_cow_mark_shared_staging, xc);
267 rc_low.rc_startblock = xc->irec_startbno;
268 rc_high.rc_startblock = xc->irec_startbno + xc->irec.br_blockcount - 1;
270 xc->next_bno = xc->irec_startbno;
272 xrep_cow_mark_missing_staging, xc);
276 if (xc->next_bno < xc->irec_startbno + xc->irec.br_blockcount) {
277 error = xrep_cow_mark_file_range(xc,
279 xc->next_bno),
280 xc->irec_startbno + xc->irec.br_blockcount -
281 xc->next_bno);
287 rm_low.rm_startblock = xc->irec_startbno;
289 rm_high.rm_startblock = xc->irec_startbno + xc->irec.br_blockcount - 1;
291 xrep_cow_mark_missing_staging_rmap, xc);
301 error = xrep_cow_mark_file_range(xc, xc->irec.br_startblock,
302 xc->irec.br_blockcount);
362 struct xrep_cow *xc,
367 struct xfs_inode *ip = xc->sc->ip;
443 struct xrep_cow *xc,
450 struct xfs_scrub *sc = xc->sc;
459 error = xrep_cow_find_mapping(xc, &icur, startoff, &got);
487 error = xfsb_bitmap_set(&xc->old_cowfork_fsblocks, got.br_startblock,
506 struct xrep_cow *xc = priv;
513 error = xrep_cow_replace_range(xc, startoff, &len);
533 struct xrep_cow *xc;
558 xc = kzalloc(sizeof(struct xrep_cow), XCHK_GFP_FLAGS);
559 if (!xc)
564 xc->sc = sc;
565 xoff_bitmap_init(&xc->bad_fileoffs);
566 xfsb_bitmap_init(&xc->old_cowfork_fsblocks);
568 for_each_xfs_iext(ifp, &icur, &xc->irec) {
577 if (isnullstartblock(xc->irec.br_startblock))
586 if (xfs_bmap_is_written_extent(&xc->irec))
589 error = xrep_cow_find_bad(xc);
595 error = xoff_bitmap_walk(&xc->bad_fileoffs, xrep_cow_replace, xc);
604 error = xrep_reap_fsblocks(sc, &xc->old_cowfork_fsblocks,
610 xfsb_bitmap_destroy(&xc->old_cowfork_fsblocks);
611 xoff_bitmap_destroy(&xc->bad_fileoffs);
612 kfree(xc);