* crush_find_rule() when looking for a rule and by
* __CRUSH_RULE_CHOOSE*__ steps when looking for items.
*
+ * The caller is responsible for deallocating the returned pointer via
+ * crush_destroy_rule().
+ *
* If __malloc(3)__ fails, return NULL.
*
* @param len number of steps in the rule
* to have a weight equal to __weights[0]__, otherwise the weight of
* __items[x]__ is set to be the value of __weights[x]__.
*
+ * The caller is responsible for deallocating the returned pointer via
+ * crush_destroy_bucket().
+ *
* @param map __unused__
* @param alg algorithm for item selection
* @param hash always set to CRUSH_HASH_RJENKINS1
* @param size of the __items__ array
* @param items array of __size__ items
* @param weights the weight of each item in __items__, depending on __alg__
+ *
+ * @returns a pointer to the newly created bucket or NULL
*/
struct crush_bucket *crush_make_bucket(struct crush_map *map, int alg, int hash, int type, int size, int *items, int *weights);
/** @ingroup API
extern void crush_destroy_bucket_tree(struct crush_bucket_tree *b);
extern void crush_destroy_bucket_straw(struct crush_bucket_straw *b);
extern void crush_destroy_bucket_straw2(struct crush_bucket_straw2 *b);
+/** @ingroup API
+ *
+ * Deallocate a bucket created via crush_add_bucket().
+ *
+ * @param bucket the bucket to deallocate
+ */
extern void crush_destroy_bucket(struct crush_bucket *b);
+/** @ingroup API
+ *
+ * Deallocate a rule created via crush_add_rule().
+ *
+ * @param r the rule to deallocate
+ */
extern void crush_destroy_rule(struct crush_rule *r);
/** @ingroup API
*