using namespace std;
class CrushWrapper {
- mutable Mutex mapper_lock;
public:
std::map<int32_t, string> type_map; /* bucket/device type names */
std::map<int32_t, string> name_map; /* bucket/device names */
CrushWrapper(const CrushWrapper& other);
const CrushWrapper& operator=(const CrushWrapper& other);
- CrushWrapper() : mapper_lock("CrushWrapper::mapper_lock"),
- crush(0), have_rmaps(false) {
+ CrushWrapper() : crush(0), have_rmaps(false) {
create();
}
~CrushWrapper() {
void do_rule(int rule, int x, vector<int>& out, int maxout,
const vector<__u32>& weight) const {
- Mutex::Locker l(mapper_lock);
int rawout[maxout];
char work[crush_work_size(crush, maxout)];
crush_init_workspace(crush, work);