// same region in this transaction. The freelist doesn't like that.
// (Actually, the only thing that cares is the BitmapFreelistManager
// debug check. But that's important.)
- interval_set<uint64_t> overlap;
interval_set<uint64_t> tmp_allocated, tmp_released;
interval_set<uint64_t> *pallocated = &txc->allocated;
interval_set<uint64_t> *preleased = &txc->released;
if (!txc->allocated.empty() && !txc->released.empty()) {
+ interval_set<uint64_t> overlap;
overlap.intersection_of(txc->allocated, txc->released);
- tmp_allocated = txc->allocated;
- tmp_allocated.subtract(overlap);
- tmp_released = txc->released;
- tmp_released.subtract(overlap);
- dout(20) << __func__ << " overlap 0x" << std::hex << overlap
- << ", new allocated 0x" << tmp_allocated
- << " released 0x" << tmp_released << std::dec
- << dendl;
- pallocated = &tmp_allocated;
- preleased = &tmp_released;
+ if (!overlap.empty()) {
+ tmp_allocated = txc->allocated;
+ tmp_allocated.subtract(overlap);
+ tmp_released = txc->released;
+ tmp_released.subtract(overlap);
+ dout(20) << __func__ << " overlap 0x" << std::hex << overlap
+ << ", new allocated 0x" << tmp_allocated
+ << " released 0x" << tmp_released << std::dec
+ << dendl;
+ pallocated = &tmp_allocated;
+ preleased = &tmp_released;
+ }
}
// update freelist with non-overlap sets