]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crush/CrushWrapper: has_non_straw2_buckets()
authorSage Weil <sage@redhat.com>
Thu, 13 Jul 2017 18:12:04 +0000 (14:12 -0400)
committerSage Weil <sage@redhat.com>
Fri, 21 Jul 2017 17:50:49 +0000 (13:50 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/crush/CrushWrapper.cc
src/crush/CrushWrapper.h

index 2a1bf0051521136070606c10f43077b6323ff909..857d2d13dcf89a37fa16d400428b7eddd16308e3 100644 (file)
@@ -71,6 +71,18 @@ bool CrushWrapper::has_multirule_rulesets() const
   return false;
 }
 
+bool CrushWrapper::has_non_straw2_buckets() const
+{
+  for (int i=0; i<crush->max_buckets; ++i) {
+    crush_bucket *b = crush->buckets[i];
+    if (!b)
+      continue;
+    if (b->alg != CRUSH_BUCKET_STRAW2)
+      return true;
+  }
+  return false;
+}
+
 bool CrushWrapper::has_v2_rules() const
 {
   for (unsigned i=0; i<crush->max_rules; i++) {
index 5da29e44a53f55cecbb1abfc7c781290cebc45b1..2a091bd90edf04436b571636a3cfd6b7c5a782cb 100644 (file)
@@ -117,6 +117,9 @@ public:
   /// true if any ruleset has more than 1 rule
   bool has_multirule_rulesets() const;
 
+  /// true if any buckets that aren't straw2
+  bool has_non_straw2_buckets() const;
+
   // tunables
   void set_tunables_argonaut() {
     crush->choose_local_tries = 2;