summaryrefslogtreecommitdiffstats
path: root/src/erasure-code/shec
diff options
context:
space:
mode:
authorBassam Tabbara <bassam.tabbara@quantum.com>2016-09-19 20:19:37 +0200
committerBassam Tabbara <bassam.tabbara@quantum.com>2016-09-29 19:34:34 +0200
commit2e333bdbc4a8119391124e52a2fb4931aef8e479 (patch)
tree8ce3ca7a370400e26f7c82ab3e565b0f59ac11a9 /src/erasure-code/shec
parentcmake: normalize use of SIMD flags (diff)
downloadceph-2e333bdbc4a8119391124e52a2fb4931aef8e479.tar.xz
ceph-2e333bdbc4a8119391124e52a2fb4931aef8e479.zip
erasure-code: Move the EC factory code into separate header files
This helps the EC factories be invokable directly for testing and other uses. Signed-off-by: Bassam Tabbara <bassam.tabbara@quantum.com>
Diffstat (limited to 'src/erasure-code/shec')
-rw-r--r--src/erasure-code/shec/ErasureCodePluginShec.cc11
-rw-r--r--src/erasure-code/shec/ErasureCodePluginShec.h34
2 files changed, 37 insertions, 8 deletions
diff --git a/src/erasure-code/shec/ErasureCodePluginShec.cc b/src/erasure-code/shec/ErasureCodePluginShec.cc
index 7d242b4f7e0..d31777e50d6 100644
--- a/src/erasure-code/shec/ErasureCodePluginShec.cc
+++ b/src/erasure-code/shec/ErasureCodePluginShec.cc
@@ -20,7 +20,7 @@
#include "ceph_ver.h"
#include "common/debug.h"
-#include "erasure-code/ErasureCodePlugin.h"
+#include "ErasureCodePluginShec.h"
#include "ErasureCodeShecTableCache.h"
#include "ErasureCodeShec.h"
#include "jerasure_init.h"
@@ -34,11 +34,7 @@ static ostream& _prefix(std::ostream* _dout)
return *_dout << "ErasureCodePluginShec: ";
}
-class ErasureCodePluginShec : public ErasureCodePlugin {
-public:
- ErasureCodeShecTableCache tcache;
-
- virtual int factory(const std::string &directory,
+int ErasureCodePluginShec::factory(const std::string &directory,
ErasureCodeProfile &profile,
ErasureCodeInterfaceRef *erasure_code,
ostream *ss) {
@@ -68,8 +64,7 @@ public:
dout(10) << "ErasureCodePluginShec: factory() completed" << dendl;
return 0;
- }
-};
+}
const char *__erasure_code_version() { return CEPH_GIT_NICE_VER; }
diff --git a/src/erasure-code/shec/ErasureCodePluginShec.h b/src/erasure-code/shec/ErasureCodePluginShec.h
new file mode 100644
index 00000000000..fa642974ea0
--- /dev/null
+++ b/src/erasure-code/shec/ErasureCodePluginShec.h
@@ -0,0 +1,34 @@
+// -*- 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) 2014 Cloudwatt <libre.licensing@cloudwatt.com>
+ * Copyright (C) 2014 Red Hat <contact@redhat.com>
+ *
+ * Author: Loic Dachary <loic@dachary.org>
+ *
+ * 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.
+ *
+ */
+
+#ifndef CEPH_ERASURE_CODE_PLUGIN_SHEC_H
+#define CEPH_ERASURE_CODE_PLUGIN_SHEC_H
+
+#include "ErasureCodeShecTableCache.h"
+#include "erasure-code/ErasureCodePlugin.h"
+
+class ErasureCodePluginShec : public ErasureCodePlugin {
+public:
+ ErasureCodeShecTableCache tcache;
+
+ virtual int factory(const std::string &directory,
+ ErasureCodeProfile &profile,
+ ErasureCodeInterfaceRef *erasure_code,
+ ostream *ss);
+};
+
+#endif