Skip to content
Permalink
Browse files

mon/OSDMonitor: tidy up class_map too on crush removal

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
  • Loading branch information...
xiexingguo committed Jul 1, 2017
1 parent 6ca23e6 commit 7d69fb49ed3a38209bf0c08787a8118da972cb31
Showing with 9 additions and 0 deletions.
  1. +2 −0 src/crush/CrushWrapper.cc
  2. +7 −0 src/crush/CrushWrapper.h
@@ -335,11 +335,13 @@ bool CrushWrapper::_maybe_remove_last_instance(CephContext *cct, int item, bool
crush_remove_bucket(crush, t);
if (class_bucket.count(item) != 0)
class_bucket.erase(item);
class_remove_item(item);
}
if ((item >= 0 || !unlink_only) && name_map.count(item)) {
ldout(cct, 5) << "_maybe_remove_last_instance removing name for item " << item << dendl;
name_map.erase(item);
have_rmaps = false;
class_remove_item(item);
}
return true;
}
@@ -525,6 +525,13 @@ class CrushWrapper {
}
}
}
void class_remove_item(int i) {
auto it = class_map.find(i);
if (it == class_map.end()) {
return;
}
class_map.erase(it);
}
int can_rename_item(const string& srcname,
const string& dstname,
ostream *ss) const;

0 comments on commit 7d69fb4

Please sign in to comment.
You can’t perform that action at this time.