From abe64b451cc2e33a92f87ac3968abff4177a1620 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Sun, 14 May 2017 21:16:56 -0500 Subject: [PATCH] crush: add crush_alg_name Signed-off-by: Sage Weil --- src/crush/crush.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/crush/crush.h b/src/crush/crush.h index 83963ef9cc0..31fb94deff4 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 --------------------------------------------------------------------- */ -- 2.39.5