Lines Matching refs:rs

143 static inline bool xreap_dirty(const struct xreap_state *rs)  in xreap_dirty()  argument
145 if (rs->force_roll) in xreap_dirty()
147 if (rs->deferred) in xreap_dirty()
149 if (rs->invalidated) in xreap_dirty()
151 if (rs->total_deferred) in xreap_dirty()
164 static inline bool xreap_want_roll(const struct xreap_state *rs) in xreap_want_roll() argument
166 if (rs->force_roll) in xreap_want_roll()
168 if (rs->deferred > XREP_MAX_ITRUNCATE_EFIS) in xreap_want_roll()
170 if (rs->invalidated > XREAP_MAX_BINVAL) in xreap_want_roll()
175 static inline void xreap_reset(struct xreap_state *rs) in xreap_reset() argument
177 rs->total_deferred += rs->deferred; in xreap_reset()
178 rs->deferred = 0; in xreap_reset()
179 rs->invalidated = 0; in xreap_reset()
180 rs->force_roll = false; in xreap_reset()
193 xreap_want_defer_finish(const struct xreap_state *rs) in xreap_want_defer_finish() argument
195 if (rs->force_roll) in xreap_want_defer_finish()
197 if (rs->total_deferred > XREAP_MAX_DEFER_CHAIN) in xreap_want_defer_finish()
202 static inline void xreap_defer_finish_reset(struct xreap_state *rs) in xreap_defer_finish_reset() argument
204 rs->total_deferred = 0; in xreap_defer_finish_reset()
205 rs->deferred = 0; in xreap_defer_finish_reset()
206 rs->invalidated = 0; in xreap_defer_finish_reset()
207 rs->force_roll = false; in xreap_defer_finish_reset()
213 struct xreap_state *rs, in xreap_agextent_binval() argument
217 struct xfs_scrub *sc = rs->sc; in xreap_agextent_binval()
264 rs->invalidated++; in xreap_agextent_binval()
271 if (rs->invalidated > XREAP_MAX_BINVAL) { in xreap_agextent_binval()
292 struct xreap_state *rs, in xreap_agextent_select() argument
298 struct xfs_scrub *sc = rs->sc; in xreap_agextent_select()
310 error = xfs_rmap_has_other_keys(cur, agbno, 1, rs->oinfo, in xreap_agextent_select()
316 if (rs->resv == XFS_AG_RESV_AGFL) in xreap_agextent_select()
326 error = xfs_rmap_has_other_keys(cur, bno, 1, rs->oinfo, in xreap_agextent_select()
352 struct xreap_state *rs, in xreap_agextent_iter() argument
357 struct xfs_scrub *sc = rs->sc; in xreap_agextent_iter()
379 rs->force_roll = true; in xreap_agextent_iter()
381 *aglenp, rs->oinfo); in xreap_agextent_iter()
392 xreap_agextent_binval(rs, agbno, aglenp); in xreap_agextent_iter()
394 ASSERT(xreap_want_roll(rs)); in xreap_agextent_iter()
399 if (rs->resv == XFS_AG_RESV_AGFL) { in xreap_agextent_iter()
405 rs->force_roll = true; in xreap_agextent_iter()
413 error = __xfs_free_extent_later(sc->tp, fsbno, *aglenp, rs->oinfo, in xreap_agextent_iter()
414 rs->resv, true); in xreap_agextent_iter()
418 rs->deferred++; in xreap_agextent_iter()
432 struct xreap_state *rs = priv; in xreap_agmeta_extent() local
433 struct xfs_scrub *sc = rs->sc; in xreap_agmeta_extent()
445 error = xreap_agextent_select(rs, agbno, agbno_next, in xreap_agmeta_extent()
450 error = xreap_agextent_iter(rs, agbno, &aglen, crosslinked); in xreap_agmeta_extent()
454 if (xreap_want_defer_finish(rs)) { in xreap_agmeta_extent()
458 xreap_defer_finish_reset(rs); in xreap_agmeta_extent()
459 } else if (xreap_want_roll(rs)) { in xreap_agmeta_extent()
463 xreap_reset(rs); in xreap_agmeta_extent()
480 struct xreap_state rs = { in xrep_reap_agblocks() local
490 error = xagb_bitmap_walk(bitmap, xreap_agmeta_extent, &rs); in xrep_reap_agblocks()
494 if (xreap_dirty(&rs)) in xrep_reap_agblocks()