]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: Make projected_size in ECTransaction const
authorAlex Ainscow <aainscow@uk.ibm.com>
Thu, 24 Apr 2025 12:57:45 +0000 (13:57 +0100)
committerAlex Ainscow <aainscow@uk.ibm.com>
Tue, 1 Jul 2025 12:03:30 +0000 (13:03 +0100)
This does not need to change once set, so adapt constructor to
allow it to be const.

Signed-off-by: Alex Ainscow <aainscow@uk.ibm.com>
src/osd/ECTransaction.cc
src/osd/ECTransaction.h

index 0284ccb0eb7f5b19fa0d9c84c3289de973949b07..e931e6cfbd61ab20185909bc75de461424636d4e 100644 (file)
@@ -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();
 
index b2f6157d17e51bc18cd1fa0e7e70692e03f2a556..4f4059e414c13fb4776cfa063e9aab9f61099a11 100644 (file)
@@ -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 << "]";
   }