]>
git.proxmox.com Git - ceph.git/blob - ceph/src/erasure-code/clay/ErasureCodePluginClay.cc
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 * Ceph - scalable distributed file system
6 * Copyright (C) 2018 Indian Institute of Science <office.ece@iisc.ac.in>
8 * Author: Myna Vajha <mynaramana@gmail.com>
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License as published by the Free Software Foundation; either
13 * version 2.1 of the License, or (at your option) any later version.
18 #include "common/debug.h"
19 #include "ErasureCodePluginClay.h"
20 #include "ErasureCodeClay.h"
22 #define dout_subsys ceph_subsys_osd
24 #define dout_prefix _prefix(_dout)
26 int ErasureCodePluginClay::factory(const std::string
&directory
,
27 ceph::ErasureCodeProfile
&profile
,
28 ceph::ErasureCodeInterfaceRef
*erasure_code
,
30 auto interface
= std::make_unique
<ErasureCodeClay
>(directory
);
31 if (int r
= interface
->init(profile
, ss
); r
) {
34 *erasure_code
= ceph::ErasureCodeInterfaceRef(interface
.release());
38 const char *__erasure_code_version() { return CEPH_GIT_NICE_VER
; }
40 int __erasure_code_init(char *plugin_name
, char *directory
)
42 auto& instance
= ceph::ErasureCodePluginRegistry::instance();
43 return instance
.add(plugin_name
, new ErasureCodePluginClay());