From 1859742b34d07fb6d2ecc08ee34f1908579817e5 Mon Sep 17 00:00:00 2001 From: Loic Dachary Date: Sun, 19 Feb 2017 10:24:13 +0100 Subject: [PATCH] doc: add doxygen help for crush_destroy_{rule,bucket) Signed-off-by: Loic Dachary --- src/crush/builder.h | 8 ++++++++ src/crush/crush.h | 12 ++++++++++++ 2 files changed, 20 insertions(+) diff --git a/src/crush/builder.h b/src/crush/builder.h index 635d784266a..aad103a97de 100644 --- a/src/crush/builder.h +++ b/src/crush/builder.h @@ -55,6 +55,9 @@ extern void crush_finalize(struct crush_map *map); * 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 @@ -151,6 +154,9 @@ extern int crush_add_bucket(struct crush_map *map, * 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 @@ -158,6 +164,8 @@ extern int crush_add_bucket(struct crush_map *map, * @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 diff --git a/src/crush/crush.h b/src/crush/crush.h index 677ff565d14..6669bbf4b34 100644 --- a/src/crush/crush.h +++ b/src/crush/crush.h @@ -393,7 +393,19 @@ extern void crush_destroy_bucket_list(struct crush_bucket_list *b); 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 *