]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crush: add crush_alg_name
authorSage Weil <sage@redhat.com>
Mon, 15 May 2017 02:16:56 +0000 (21:16 -0500)
committerSage Weil <sage@redhat.com>
Mon, 15 May 2017 13:15:59 +0000 (09:15 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/crush/crush.h

index 83963ef9cc0527ee50839ddba43ad3728a1b63d5..31fb94deff48969c024b71762b8e5b4e216c6f54 100644 (file)
@@ -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
    --------------------------------------------------------------------- */