]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
erasure-code: remove jerasure internals dependencies 1938/head
authorLoic Dachary <loic@dachary.org>
Sun, 8 Jun 2014 17:19:45 +0000 (19:19 +0200)
committerLoic Dachary <loic@dachary.org>
Thu, 12 Jun 2014 21:36:27 +0000 (23:36 +0200)
Use the galois_init_default_field() function instead of implementing it
in the init function of the ErasureCodeJerasure plugin. It removes
dependencies to internal variables of the jerasure library that are
subject to change because they are not part of the published API.

http://tracker.ceph.com/issues/8071 Fixes: #8071

Signed-off-by: Loic Dachary <loic@dachary.org>
src/erasure-code/jerasure/ErasureCodePluginJerasure.cc
src/erasure-code/jerasure/jerasure

index e1abf13da5cd1c7444f1e9ea8cd699ef95011dc8..b90a12a2784901eac85b245bcf65251084d6988a 100644 (file)
@@ -75,14 +75,10 @@ int __erasure_code_init(char *plugin_name)
   ErasureCodePluginRegistry &instance = ErasureCodePluginRegistry::instance();
   int w[] = { 4, 8, 16, 32 };
   for(int i = 0; i < 4; i++) {
-    if (gfp_array[w[i]] == NULL) {
-      gfp_array[w[i]] = (gf_t*)malloc(sizeof(gf_t));
-      assert(gfp_array[w[i]]);
-      gfp_is_composite[w[i]] = 0;
-      if (!gf_init_easy(gfp_array[w[i]], w[i])) {
-       derr << "failed to gf_init_easy(" << w[i] << ")" << dendl;
-       return -EINVAL;
-      }
+    int r = galois_init_default_field(w[i]);
+    if (r) {
+      derr << "failed to gf_init_easy(" << w[i] << ")" << dendl;
+      return -r;
     }
   }
   return instance.add(plugin_name, new ErasureCodePluginJerasure());
index 3135db11ec8f042e502d0765b64bc3a44145a2df..8fe20c6608385d6a1f38db89aec5cba85ccf04ac 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 3135db11ec8f042e502d0765b64bc3a44145a2df
+Subproject commit 8fe20c6608385d6a1f38db89aec5cba85ccf04ac