From: Sage Weil Date: Mon, 15 May 2017 02:16:56 +0000 (-0500) Subject: crush: add crush_alg_name X-Git-Tag: v12.1.0~10^2~103^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=abe64b451cc2e33a92f87ac3968abff4177a1620;p=ceph.git crush: add crush_alg_name Signed-off-by: Sage Weil --- diff --git a/src/crush/crush.h b/src/crush/crush.h index 83963ef9cc05..31fb94deff48 100644 --- a/src/crush/crush.h +++ b/src/crush/crush.h @@ -506,6 +506,24 @@ static inline int crush_calc_tree_node(int i) return ((i+1) << 1)-1; } +static inline const char *crush_alg_name(int alg) +{ + switch (alg) { + case CRUSH_BUCKET_UNIFORM: + return "uniform"; + case CRUSH_BUCKET_LIST: + return "list"; + case CRUSH_BUCKET_TREE: + return "tree"; + case CRUSH_BUCKET_STRAW: + return "straw"; + case CRUSH_BUCKET_STRAW2: + return "straw2"; + default: + return "unknown"; + } +} + /* --------------------------------------------------------------------- Private --------------------------------------------------------------------- */