MCPcopy Create free account
hub / github.com/ceph/ceph / factory

Method factory

src/erasure-code/ErasureCodePlugin.cc:87–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85}
86
87int ErasureCodePluginRegistry::factory(const std::string &plugin_name,
88 const std::string &directory,
89 ErasureCodeProfile &profile,
90 ErasureCodeInterfaceRef *erasure_code,
91 ostream *ss)
92{
93 ErasureCodePlugin *plugin;
94 {
95 std::lock_guard l{lock};
96 plugin = get(plugin_name);
97 if (plugin == 0) {
98 loading = true;
99 int r = load(plugin_name, directory, &plugin, ss);
100 loading = false;
101 if (r != 0)
102 return r;
103 }
104 }
105
106 int r = plugin->factory(directory, profile, erasure_code, ss);
107 if (r)
108 return r;
109 if (profile != (*erasure_code)->get_profile()) {
110 *ss << __func__ << " profile " << profile << " != get_profile() "
111 << (*erasure_code)->get_profile() << std::endl;
112 return -EINVAL;
113 }
114 return 0;
115}
116
117static const char *an_older_version() {
118 return "an older version";

Callers

nothing calls this directly

Calls 3

get_profileMethod · 0.80
getFunction · 0.50
loadFunction · 0.50

Tested by

no test coverage detected