~ubuntu-branches/ubuntu/raring/ceph/raring

« back to all changes in this revision

Viewing changes to src/crushtool.cc

  • Committer: Package Import Robot
  • Author(s): Laszlo Boszormenyi (GCS)
  • Date: 2012-02-05 10:07:38 UTC
  • mfrom: (1.1.7) (0.1.11 sid)
  • Revision ID: package-import@ubuntu.com-20120205100738-00s0bxx93mamy8tk
Tags: 0.41-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
 
41
41
#include <typeinfo>
42
42
 
 
43
#ifndef EBADE
 
44
#define EBADE EFTYPE
 
45
#endif
 
46
 
43
47
using namespace std;
44
48
 
45
49
typedef char const*         iterator_t;                                                                              
1146
1150
      r = -ENOENT;
1147
1151
    } else {
1148
1152
      int item = crush.get_item_id(reweight_name.c_str());
1149
 
      r = crush.adjust_item_weightf(item, reweight_weight);
 
1153
      r = crush.adjust_item_weightf(g_ceph_context, item, reweight_weight);
1150
1154
    }
1151
1155
    if (r == 0)
1152
1156
      modified = true;
1164
1168
      r = -ENOENT;
1165
1169
    } else {
1166
1170
      int remove_item = crush.get_item_id(remove_name.c_str());
1167
 
      r = crush.remove_item(remove_item);
 
1171
      r = crush.remove_item(g_ceph_context, remove_item);
1168
1172
    }
1169
1173
    if (r == 0)
1170
1174
      modified = true;
1176
1180
  if (add_item >= 0) {
1177
1181
    cout << me << " adding item " << add_item << " weight " << add_weight
1178
1182
         << " at " << add_loc << std::endl;
1179
 
    int r = crush.insert_item(add_item, add_weight, add_name.c_str(), add_loc);
 
1183
    int r = crush.insert_item(g_ceph_context, add_item, add_weight, add_name.c_str(), add_loc);
1180
1184
    if (r == 0)
1181
1185
      modified = true;
1182
1186
    else {
1185
1189
    }
1186
1190
  }
1187
1191
  if (reweight) {
1188
 
    crush.reweight();
 
1192
    crush.reweight(g_ceph_context);
1189
1193
    modified = true;
1190
1194
  }
1191
1195