os/bluestore: Make maybe_unshare_extents use allocations

Blob is tracking whole AUs in SharedBlob tracker.
But the extents may account for just a portion of AUs.
We need to compare what would Blob release against SharedBlob tracker.

Signed-off-by: Adam Kupczyk <akupczyk@ibm.com>
This commit is contained in:
Adam Kupczyk 2026-06-02 05:59:39 +00:00
parent 1cebcd999d
commit 96a1a2e25d

View File

@ -18365,11 +18365,12 @@ int BlueStore::_maybe_unshare_on_remove(
// Do not account second time.
maybe_unshared_blobs.erase(sb);
} else {
// todo: it seems to be an overkill to go through map()
b.map(e.blob_offset, e.length, [&](uint64_t off, uint64_t len) {
expect[B].get(off, len);
return 0;
});
for (const auto& e: b.get_extents()) {
if (e.is_valid()) {
expect[B].get(e.offset, e.length);
}
}
maybe_unshared_blobs.erase(sb);
}
}
}