]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/PGLog: avoid return by value on ginormous log 14048/head
authorSage Weil <sage@redhat.com>
Fri, 17 Feb 2017 17:46:38 +0000 (12:46 -0500)
committerAlexey Sheplyakov <asheplyakov@mirantis.com>
Mon, 20 Mar 2017 13:07:02 +0000 (17:07 +0400)
Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit a6ead998771753d95382abd082f451e6f67744e4)

src/osd/PGLog.cc
src/osd/PGLog.h

index d0b8e5dd9de73a322f4a51b55e61e1e0af6aa320..6bda7f0ed52cfebfb554b4b156f5f6c18dbf38df 100644 (file)
@@ -30,16 +30,16 @@ static ostream& _prefix(std::ostream *_dout, const PGLog *pglog)
 
 //////////////////// PGLog::IndexedLog ////////////////////
 
-PGLog::IndexedLog PGLog::IndexedLog::split_out_child(
+void PGLog::IndexedLog::split_out_child(
   pg_t child_pgid,
-  unsigned split_bits)
+  unsigned split_bits,
+  PGLog::IndexedLog *target)
 {
   unindex();
-  IndexedLog ret(pg_log_t::split_out_child(child_pgid, split_bits));
+  *target = pg_log_t::split_out_child(child_pgid, split_bits);
   index();
-  ret.index();
+  target->index();
   reset_rollback_info_trimmed_to_riter();
-  return ret;
 }
 
 void PGLog::IndexedLog::trim(
index 837f69f450ddad757aae7cdef46a140e73c37904..8c1ce7ee997eaeea76e94c34a08326b419409b3c 100644 (file)
@@ -213,9 +213,10 @@ public:
       index();
     }
 
-    IndexedLog split_out_child(
+    void split_out_child(
       pg_t child_pgid,
-      unsigned split_bits);
+      unsigned split_bits,
+      IndexedLog *target);
 
     void zero() {
       // we must have already trimmed the old entries
@@ -658,7 +659,7 @@ public:
       pg_t child_pgid,
       unsigned split_bits,
       PGLog *opg_log) { 
-    opg_log->log = log.split_out_child(child_pgid, split_bits);
+    log.split_out_child(child_pgid, split_bits, &opg_log->log);
     missing.split_into(child_pgid, split_bits, &(opg_log->missing));
     opg_log->mark_dirty_to(eversion_t::max());
     mark_dirty_to(eversion_t::max());