From: Loic Dachary Date: Sun, 26 Jan 2014 17:54:37 +0000 (+0100) Subject: erasure-code: add crush ruleset creation API X-Git-Tag: v0.78~226^2~24 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6ca9b2469377d5edbc00d9239d622f1afd5a8045;p=ceph.git erasure-code: add crush ruleset creation API Because only the erasure code plugin knows enough to create a ruleset that is best suited for a given set of parameters. Reviewed-By: Christophe Courtaut Signed-off-by: Loic Dachary --- diff --git a/src/osd/ErasureCodeInterface.h b/src/osd/ErasureCodeInterface.h index 9a44be71bb8..f8e22d1eb53 100644 --- a/src/osd/ErasureCodeInterface.h +++ b/src/osd/ErasureCodeInterface.h @@ -145,6 +145,8 @@ #include "include/memory.h" #include "include/buffer.h" +class CrushWrapper; + using namespace std; namespace ceph { @@ -153,6 +155,24 @@ namespace ceph { public: virtual ~ErasureCodeInterface() {} + /** + * Create a new ruleset in **crush** under the name **name**, + * unless it already exists. + * + * Return the ruleset number that was created on success. If a + * ruleset **name** already exists, return -EEXISTS, otherwise + * return a negative value indicating an error with a semantic + * defined by the implementation. + * + * @param [in] name of the ruleset to create + * @param [in] crush crushmap in which the ruleset is created + * @param [out] ss contains informative messages when an error occurs + * @return **0** on success or a negative errno on error. + */ + virtual int create_ruleset(const string &name, + CrushWrapper &crush, + ostream *ss) const = 0; + /** * Return the number of chunks created by a call to the **encode** * method.