]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
erasure-code: move to ErasureCode::decode_concat
authorLoic Dachary <loic@dachary.org>
Wed, 6 Aug 2014 11:54:49 +0000 (13:54 +0200)
committerLoic Dachary <loic@dachary.org>
Wed, 6 Aug 2014 13:44:22 +0000 (15:44 +0200)
It does not belong to ErasureCodeInterface which is supposed to not have
any implementation.

Signed-off-by: Loic Dachary <loic@dachary.org>
src/erasure-code/ErasureCode.cc
src/erasure-code/ErasureCode.h
src/erasure-code/ErasureCodeInterface.h

index 95bf13a49d1e2485d787868caf1376cfcde5ab0c..25de8e137e378610a576def3d42fba1503e6cb45 100644 (file)
@@ -183,3 +183,17 @@ int ErasureCode::to_bool(const std::string &name,
   *value = (p == "yes") || (p == "true");
   return 0;
 }
+
+int ErasureCode::decode_concat(const map<int, bufferlist> &chunks,
+                              bufferlist *decoded)
+{
+  set<int> want_to_read;
+  for (unsigned int i = 0; i < get_data_chunk_count(); i++)
+    want_to_read.insert(i);
+  map<int, bufferlist> decoded_map;
+  int r = decode(want_to_read, chunks, &decoded_map);
+  if (r == 0)
+    for (unsigned int i = 0; i < get_data_chunk_count(); i++)
+      decoded->claim_append(decoded_map[i]);
+  return r;
+}
index 97ec687aed1810b844efa30ad7dbe7521e6c73eb..63306db2378f918a782182041242f965fa44a08b 100644 (file)
@@ -66,6 +66,9 @@ namespace ceph {
                       bool *value,
                       bool default_value,
                       ostream *ss);
+
+    virtual int decode_concat(const map<int, bufferlist> &chunks,
+                             bufferlist *decoded);
   };
 }
 
index 06ee373357af31fe9582b3325d6ca8bd9031e8b3..328e323546e44453adcac59d282a9ca1aa94c03b 100644 (file)
@@ -358,17 +358,7 @@ namespace ceph {
      * @return **0** on success or a negative errno on error.
      */
     virtual int decode_concat(const map<int, bufferlist> &chunks,
-                             bufferlist *decoded) {
-      set<int> want_to_read;
-      for (unsigned int i = 0; i < get_data_chunk_count(); i++)
-       want_to_read.insert(i);
-      map<int, bufferlist> decoded_map;
-      int r = decode(want_to_read, chunks, &decoded_map);
-      if (r == 0)
-       for (unsigned int i = 0; i < get_data_chunk_count(); i++)
-         decoded->claim_append(decoded_map[i]);
-      return r;
-    }
+                             bufferlist *decoded) = 0;
   };
 
   typedef ceph::shared_ptr<ErasureCodeInterface> ErasureCodeInterfaceRef;