/* * This counts the number of iterators to the alloc & ec btrees we'll need * inserting/removing this extent:
*/ staticunsigned bch2_bkey_nr_alloc_ptrs(struct bkey_s_c k)
{ struct bkey_ptrs_c ptrs = bch2_bkey_ptrs_c(k); constunion bch_extent_entry *entry; unsigned ret = 0, lru = 0;
bkey_extent_entry_for_each(ptrs, entry) { switch (__extent_entry_type(entry)) { case BCH_EXTENT_ENTRY_ptr: /* Might also be updating LRU btree */ if (entry->ptr.cached)
lru++;
fallthrough; case BCH_EXTENT_ENTRY_stripe_ptr:
ret++;
}
}
/* * Updating keys in the alloc btree may also update keys in the * freespace or discard btrees:
*/ return lru + ret * 2;
}
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.