Skip to content

Commit

Permalink
mon: dump range blocklist when dumping regular blocklist
Browse files Browse the repository at this point in the history
Signed-off-by: Greg Farnum <[email protected]>
  • Loading branch information
gregsfortytwo committed Apr 13, 2022
1 parent 9c5e21a commit dc09905
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion src/mon/OSDMonitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6042,7 +6042,31 @@ bool OSDMonitor::preprocess_command(MonOpRequestRef op)
f->close_section();
f->flush(rdata);
}
ss << "listed " << osdmap.blocklist.size() << " entries";
if (f)
f->open_array_section("range_blocklist");

for (auto p = osdmap.range_blocklist.begin();
p != osdmap.range_blocklist.end();
++p) {
if (f) {
f->open_object_section("entry");
f->dump_string("range", p->first.get_legacy_str());
f->dump_stream("until") << p->second;
f->close_section();
} else {
stringstream ss;
string s;
ss << p->first << " " << p->second;
getline(ss, s);
s += "\n";
rdata.append(s);
}
}
if (f) {
f->close_section();
f->flush(rdata);
}
ss << "listed " << osdmap.blocklist.size() + osdmap.range_blocklist.size() << " entries";

} else if (prefix == "osd pool ls") {
string detail;
Expand Down

0 comments on commit dc09905

Please sign in to comment.