Lines Matching refs:refcount
33 * We want to count the reverse mappings overlapping a refcount record
34 * (bno, len, refcount), allowing for the possibility that some of the
39 * 1. For all reverse mappings overlapping the refcount extent,
45 * refcount record we want to find $refcount owners and we've already
47 * need to find ($refcount - $seen) owners for every block in the
61 * and that they all end at or beyond the end of the refcount extent.
63 * If the refcount is correct, all the check conditions in the algorithm
64 * should always hold true. If not, the refcount is incorrect.
75 /* refcount extent we're examining */
78 xfs_nlink_t refcount;
86 * towards refcount verification now, or if it's a fragment, in
110 if (refchk->refcount == 1 && rec->rm_owner != XFS_RMAP_OWN_COW) {
117 * The rmap overlaps the refcount record, so we can confirm
118 * one refcount owner seen.
123 * This rmap covers only part of the refcount record, so
141 * a running tally of the refcount. If this ever deviates from
142 * what we expect (which is the refcountbt's refcount minus the
159 target_nr = refchk->refcount - refchk->seen;
164 * There are (refchk->rc.rc_refcount - refchk->nr refcount)
169 * refcount record's range.
199 * at or before the refcount extent.
237 * required refcount. Something is wrong, so we're done.
247 * the end of the refcount extent.
252 /* Actually record us having seen the remaining refcount. */
253 refchk->seen = refchk->refcount;
266 /* Use the rmap entries covering this extent to verify the refcount. */
272 xfs_nlink_t refcount)
278 .refcount = refcount,
290 /* Cross-reference with the rmapbt to confirm the refcount. */
303 if (refcount != refchk.seen)
319 xfs_nlink_t refcount)
326 xchk_refcountbt_xref_rmap(sc, agbno, len, refcount);
340 xfs_nlink_t refcount;
345 refcount = be32_to_cpu(rec->refc.rc_refcount);
347 /* Only CoW records can have refcount == 1. */
349 if ((refcount == 1 && !has_cowflag) || (refcount != 1 && has_cowflag))
361 if (refcount == 0)
364 xchk_refcountbt_xref(bs->sc, bno, len, refcount);
402 /* Scrub the refcount btree for some AG. */
453 /* CoW flag must be set, refcount must be 1. */