mirror of
https://github.com/ceph/ceph
synced 2026-08-02 07:03:18 +00:00
os/bluestore: Simplify _maybe_unshare_on_remove
Unify compressed and uncompressed blobs handling. Signed-off-by: Adam Kupczyk <akupczyk@ibm.com>
This commit is contained in:
parent
96a1a2e25d
commit
72fe925e93
@ -18354,24 +18354,13 @@ int BlueStore::_maybe_unshare_on_remove(
|
||||
const Blob* B = e.blob.get();
|
||||
const bluestore_blob_t& b = B->get_blob();
|
||||
SharedBlob *sb = B->get_shared_blob().get();
|
||||
if (b.is_shared() &&
|
||||
sb->loaded &&
|
||||
maybe_unshared_blobs.count(sb)) {
|
||||
if (b.is_compressed()) {
|
||||
b.map(0, b.get_ondisk_size(), [&](uint64_t off, uint64_t len) {
|
||||
expect[B].get(off, len);
|
||||
return 0;
|
||||
});
|
||||
// Do not account second time.
|
||||
maybe_unshared_blobs.erase(sb);
|
||||
} else {
|
||||
for (const auto& e: b.get_extents()) {
|
||||
if (e.is_valid()) {
|
||||
expect[B].get(e.offset, e.length);
|
||||
}
|
||||
if (b.is_shared() && sb->loaded && maybe_unshared_blobs.count(sb)) {
|
||||
for (const auto& e: b.get_extents()) {
|
||||
if (e.is_valid()) {
|
||||
expect[B].get(e.offset, e.length);
|
||||
}
|
||||
maybe_unshared_blobs.erase(sb);
|
||||
}
|
||||
maybe_unshared_blobs.erase(sb);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user