erasure-code: preload the isa plugin by default

But only do so when it has been compiled because a recent enough yasm
has been found.

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
erasure-code: add directory to plugin init functions

The prototype of the init functions of erasure coded plugins is changed
from

   int __erasure_code_init(char *plugin_name)

to

   int __erasure_code_init(char *plugin_name, char *directory)

The jerasure plugin will find optimized variants in this directory and
load them. The load() and preload() functions of
ErasureCodePluginRegistry only use a directory instead of a more generic
parameters map. The parameters map was only used for the directory entry
anyway.

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
erasure-code: remove unused errno.h include

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
erasure-code: add Red Hat to copyright notices

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
erasure-code: jerasure preloads all variants

All jerasure plugin are preloaded, regardless of the CPU features
available. The selection of the variant happens in the factory() method
and will not use a variant that would require CPU features that are not
available.

Although it would be possible to only load the plugins that will be
used, it would not allow the caller to override the selection to use the
generic version suitable for all processors over the SSE4 version that
would be automatically selected or even the SSE3 version. Such an
override is useful when running benchmarks, to compare the performances
of the variants.

http://tracker.ceph.com/issues/9153 Fixes: #9153

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
erasure-code: wrap lines for emacs compile command

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
erasure-code: implement ErasureCodePluginRegistry::remove

Which is symmetric to the add method and used for test.

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
erasure-code: add Ceph version check to plugins

Add the __erasure_code_version function to all plugins, to return the
Ceph version against which they have been compiled. When a plugin is
loaded, an error is thrown if the version of the plugin does not match
the version of the daemon loading it.

If the symbol does not exist, which will be true of older plugins, set
the version to "an older version" so it never matches.

http://tracker.ceph.com/issues/9167 Fixes: #9167

Signed-off-by: Loic Dachary <loic-201408@dachary.org>