mirror of
https://github.com/ceph/ceph
synced 2025-01-04 02:02:36 +00:00
mon/PGMap: allow 'pg ls unknown'
"unknown" is annoying because it is 0 and needs a special case. Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
parent
64a046a078
commit
3ccbec71ae
@ -2056,9 +2056,11 @@ void PGMap::get_filtered_pg_stats(uint64_t state, int64_t poolid, int64_t osdid,
|
||||
continue;
|
||||
if ((osdid >= 0) && !(i->second.is_acting_osd(osdid,primary)))
|
||||
continue;
|
||||
if (state != (uint64_t)-1 && !(i->second.state & state))
|
||||
continue;
|
||||
pgs.insert(i->first);
|
||||
if (state == (uint64_t)-1 || // "all"
|
||||
(i->second.state & state) || // matches a state bit
|
||||
(state == 0 && i->second.state == 0)) { // matches "unknown" (== 0)
|
||||
pgs.insert(i->first);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -968,6 +968,8 @@ boost::optional<uint64_t> pg_string_state(const std::string& state)
|
||||
type = PG_STATE_SNAPTRIM_WAIT;
|
||||
else if (state == "snaptrim_error")
|
||||
type = PG_STATE_SNAPTRIM_ERROR;
|
||||
else if (state == "unknown")
|
||||
type = 0;
|
||||
else
|
||||
type = boost::none;
|
||||
return type;
|
||||
|
Loading…
Reference in New Issue
Block a user