From: Alex Ainscow Date: Thu, 24 Apr 2025 12:57:45 +0000 (+0100) Subject: osd: Make projected_size in ECTransaction const X-Git-Tag: v20.1.0~68^2~13 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3a10c06da9f3b3ec88d4c3771f59c7c4066b637f;p=ceph.git osd: Make projected_size in ECTransaction const This does not need to change once set, so adapt constructor to allow it to be const. Signed-off-by: Alex Ainscow (cherry picked from commit 350f3a7a7a8511899adb52b499bc537e178acb0e) --- diff --git a/src/osd/ECTransaction.cc b/src/osd/ECTransaction.cc index 0284ccb0eb7f..e931e6cfbd61 100644 --- a/src/osd/ECTransaction.cc +++ b/src/osd/ECTransaction.cc @@ -132,16 +132,10 @@ ECTransaction::WritePlanObj::WritePlanObj( will_write(sinfo.get_k_plus_m()), hinfo(hinfo), shinfo(shinfo), - orig_size(orig_size) // On-disk object sizes are rounded up to the next page. + orig_size(orig_size), // On-disk object sizes are rounded up to the next page. + projected_size(soi?soi->size:(oi?oi->size:0)) { extent_set unaligned_ro_writes; - - projected_size = oi ? oi->size : 0; - - if (soi) { - projected_size = soi->size; - } - hobject_t source; invalidates_cache = op.has_source(&source) || op.is_delete(); diff --git a/src/osd/ECTransaction.h b/src/osd/ECTransaction.h index b2f6157d17e5..4f4059e414c1 100644 --- a/src/osd/ECTransaction.h +++ b/src/osd/ECTransaction.h @@ -29,7 +29,7 @@ class WritePlanObj { const ECUtil::HashInfoRef hinfo; const ECUtil::HashInfoRef shinfo; const uint64_t orig_size; - uint64_t projected_size; + const uint64_t projected_size; bool invalidates_cache; bool do_parity_delta_write = false; @@ -74,7 +74,7 @@ struct WritePlan { } else { os << ", "; } - os << p; + os << "{" << p << "}"; } os << "]"; }