]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- |
2 | // vim: ts=8 sw=2 smarttab | |
3 | /* | |
4 | * Ceph - scalable distributed file system | |
5 | * | |
6 | * Copyright (C) 2014 Cloudwatt <libre.licensing@cloudwatt.com> | |
7 | * Copyright (C) 2014 Red Hat <contact@redhat.com> | |
8 | * | |
9 | * Author: Loic Dachary <loic@dachary.org> | |
10 | * | |
11 | * This library is free software; you can redistribute it and/or | |
12 | * modify it under the terms of the GNU Lesser General Public | |
13 | * License as published by the Free Software Foundation; either | |
14 | * version 2.1 of the License, or (at your option) any later version. | |
15 | * | |
16 | */ | |
17 | ||
18 | #include "ceph_ver.h" | |
19 | #include "common/debug.h" | |
20 | #include "ErasureCodePluginLrc.h" | |
21 | #include "ErasureCodeLrc.h" | |
22 | ||
7c673cae FG |
23 | #define dout_subsys ceph_subsys_osd |
24 | #undef dout_prefix | |
25 | #define dout_prefix _prefix(_dout) | |
26 | ||
27 | int ErasureCodePluginLrc::factory(const std::string &directory, | |
28 | ErasureCodeProfile &profile, | |
29 | ErasureCodeInterfaceRef *erasure_code, | |
31f18b77 | 30 | std::ostream *ss) { |
7c673cae FG |
31 | ErasureCodeLrc *interface; |
32 | interface = new ErasureCodeLrc(directory); | |
33 | int r = interface->init(profile, ss); | |
34 | if (r) { | |
35 | delete interface; | |
36 | return r; | |
37 | } | |
38 | *erasure_code = ErasureCodeInterfaceRef(interface); | |
39 | return 0; | |
40 | }; | |
41 | ||
7c673cae FG |
42 | const char *__erasure_code_version() { return CEPH_GIT_NICE_VER; } |
43 | ||
44 | int __erasure_code_init(char *plugin_name, char *directory) | |
45 | { | |
46 | ErasureCodePluginRegistry &instance = ErasureCodePluginRegistry::instance(); | |
47 | return instance.add(plugin_name, new ErasureCodePluginLrc()); | |
48 | } |