summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-01-30 00:29:04 -0800
committerSage Weil <sage@inktank.com>2013-02-05 14:30:37 -0800
commit9da6290c7b99878b6baa4d73f72fe5b6d5a2517b (patch)
tree2d9a3f4efa425de78fa5a143ff8381ce3e09077e
parenta04d3f0ab165b36172ca9dfb20221645d8085979 (diff)
downloadceph-9da6290c7b99878b6baa4d73f72fe5b6d5a2517b.tar.gz
crush: factor out dump_rules from dump
Signed-off-by: Sage Weil <sage@inktank.com>
-rw-r--r--src/crush/CrushWrapper.cc7
-rw-r--r--src/crush/CrushWrapper.h1
2 files changed, 7 insertions, 1 deletions
diff --git a/src/crush/CrushWrapper.cc b/src/crush/CrushWrapper.cc
index 6001557e737..bae264245f7 100644
--- a/src/crush/CrushWrapper.cc
+++ b/src/crush/CrushWrapper.cc
@@ -859,6 +859,12 @@ void CrushWrapper::dump(Formatter *f) const
f->close_section();
f->open_array_section("rules");
+ dump_rules(f);
+ f->close_section();
+}
+
+void CrushWrapper::dump_rules(Formatter *f) const
+{
for (int i=0; i<get_max_rules(); i++) {
if (!rule_exists(i))
continue;
@@ -914,7 +920,6 @@ void CrushWrapper::dump(Formatter *f) const
f->close_section();
f->close_section();
}
- f->close_section();
}
void CrushWrapper::generate_test_instances(list<CrushWrapper*>& o)
diff --git a/src/crush/CrushWrapper.h b/src/crush/CrushWrapper.h
index 6e10b3ba417..df2c620a82e 100644
--- a/src/crush/CrushWrapper.h
+++ b/src/crush/CrushWrapper.h
@@ -739,6 +739,7 @@ public:
void decode(bufferlist::iterator &blp);
void decode_crush_bucket(crush_bucket** bptr, bufferlist::iterator &blp);
void dump(Formatter *f) const;
+ void dump_rules(Formatter *f) const;
static void generate_test_instances(list<CrushWrapper*>& o);
};
WRITE_CLASS_ENCODER(CrushWrapper)