mirror of
https://github.com/ceph/ceph
synced 2025-01-18 09:02:08 +00:00
erasure-code: remove jerasure internals dependencies
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>
This commit is contained in:
parent
87650d430f
commit
e29beff3f1
@ -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());
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 3135db11ec8f042e502d0765b64bc3a44145a2df
|
||||
Subproject commit 8fe20c6608385d6a1f38db89aec5cba85ccf04ac
|
Loading…
Reference in New Issue
Block a user