X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fceph%2Fsrc%2Ferasure-code%2Fjerasure%2FErasureCodePluginJerasure.cc;fp=src%2Fceph%2Fsrc%2Ferasure-code%2Fjerasure%2FErasureCodePluginJerasure.cc;h=0000000000000000000000000000000000000000;hb=7da45d65be36d36b880cc55c5036e96c24b53f00;hp=38f403826e76835ff7880760efcfc6a7f3e5ab4e;hpb=691462d09d0987b47e112d6ee8740375df3c51b2;p=stor4nfv.git diff --git a/src/ceph/src/erasure-code/jerasure/ErasureCodePluginJerasure.cc b/src/ceph/src/erasure-code/jerasure/ErasureCodePluginJerasure.cc deleted file mode 100644 index 38f4038..0000000 --- a/src/ceph/src/erasure-code/jerasure/ErasureCodePluginJerasure.cc +++ /dev/null @@ -1,89 +0,0 @@ -// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- -// vim: ts=8 sw=2 smarttab -/* - * Ceph distributed storage system - * - * Copyright (C) 2013,2014 Cloudwatt - * Copyright (C) 2014 Red Hat - * - * Author: Loic Dachary - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - */ - -#include "ceph_ver.h" -#include "common/debug.h" -#include "ErasureCodeJerasure.h" -#include "ErasureCodePluginJerasure.h" -#include "jerasure_init.h" - -#define dout_context g_ceph_context -#define dout_subsys ceph_subsys_osd -#undef dout_prefix -#define dout_prefix _prefix(_dout) - -static ostream& _prefix(std::ostream* _dout) -{ - return *_dout << "ErasureCodePluginJerasure: "; -} - -int ErasureCodePluginJerasure::factory(const std::string& directory, - ErasureCodeProfile &profile, - ErasureCodeInterfaceRef *erasure_code, - std::ostream *ss) { - ErasureCodeJerasure *interface; - std::string t; - if (profile.find("technique") != profile.end()) - t = profile.find("technique")->second; - if (t == "reed_sol_van") { - interface = new ErasureCodeJerasureReedSolomonVandermonde(); - } else if (t == "reed_sol_r6_op") { - interface = new ErasureCodeJerasureReedSolomonRAID6(); - } else if (t == "cauchy_orig") { - interface = new ErasureCodeJerasureCauchyOrig(); - } else if (t == "cauchy_good") { - interface = new ErasureCodeJerasureCauchyGood(); - } else if (t == "liberation") { - interface = new ErasureCodeJerasureLiberation(); - } else if (t == "blaum_roth") { - interface = new ErasureCodeJerasureBlaumRoth(); - } else if (t == "liber8tion") { - interface = new ErasureCodeJerasureLiber8tion(); - } else { - derr << "technique=" << t << " is not a valid coding technique. " - << " Choose one of the following: " - << "reed_sol_van, reed_sol_r6_op, cauchy_orig, " - << "cauchy_good, liberation, blaum_roth, liber8tion" - << dendl; - return -ENOENT; - } - dout(20) << __func__ << ": " << profile << dendl; - int r = interface->init(profile, ss); - if (r) { - delete interface; - return r; - } - *erasure_code = ErasureCodeInterfaceRef(interface); - return 0; -} - -#ifndef BUILDING_FOR_EMBEDDED - -const char *__erasure_code_version() { return CEPH_GIT_NICE_VER; } - -int __erasure_code_init(char *plugin_name, char *directory) -{ - ErasureCodePluginRegistry &instance = ErasureCodePluginRegistry::instance(); - int w[] = { 4, 8, 16, 32 }; - int r = jerasure_init(4, w); - if (r) { - return -r; - } - return instance.add(plugin_name, new ErasureCodePluginJerasure()); -} - -#endif \ No newline at end of file