staticinlinebool should_drop_next_key(struct sort_iter *iter)
{ /* * key_sort_cmp() ensures that when keys compare equal the older key * comes first; so if l->k compares equal to r->k then l->k is older * and should be dropped.
*/ return iter->used >= 2 &&
!bch2_bkey_cmp_packed(iter->b,
iter->data[0].k,
iter->data[1].k);
}
/* * For sorting in the btree node write path: whiteouts not in the unwritten * whiteouts area are dropped, whiteouts in the unwritten whiteouts area are * dropped if overwritten by real keys:
*/ unsigned bch2_sort_keys_keep_unwritten_whiteouts(struct bkey_packed *dst, struct sort_iter *iter)
{ struct bkey_packed *in, *next, *out = dst;
while ((in = sort_iter_next(iter, keep_unwritten_whiteouts_cmp))) { if (bkey_deleted(in) && in < unwritten_whiteouts_start(iter->b)) continue;
if ((next = sort_iter_peek(iter)) &&
!bch2_bkey_cmp_packed_inlined(iter->b, in, next)) continue;
bkey_p_copy(out, in);
out = bkey_p_next(out);
}
return (u64 *) out - (u64 *) dst;
}
/* * Main sort routine for compacting a btree node in memory: we always drop * whiteouts because any whiteouts that need to be written are in the unwritten * whiteouts area:
*/ unsigned bch2_sort_keys(struct bkey_packed *dst, struct sort_iter *iter)
{ struct bkey_packed *in, *out = dst;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.