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

« back to all changes in this revision

Viewing changes to src/crush/CrushWrapper.h

  • 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:
39
39
  ::decode(s.arg2, p);
40
40
}
41
41
 
42
 
 
43
 
 
44
42
using namespace std;
45
43
class CrushWrapper {
46
44
public:
161
159
 
162
160
 
163
161
  void find_roots(set<int>& roots) const;
164
 
  int insert_item(int id, float weight, string name, map<string,string>& loc);
165
 
  int remove_item(int id);
166
 
  int adjust_item_weight(int id, int weight);
167
 
  int adjust_item_weightf(int id, float weight) {
168
 
    return adjust_item_weight(id, (int)(weight * (float)0x10000));
 
162
  int insert_item(CephContext *cct, int id, float weight, string name, map<string,string>& loc);
 
163
  int remove_item(CephContext *cct, int id);
 
164
  int adjust_item_weight(CephContext *cct, int id, int weight);
 
165
  int adjust_item_weightf(CephContext *cct, int id, float weight) {
 
166
    return adjust_item_weight(cct, id, (int)(weight * (float)0x10000));
169
167
  }
170
 
  void reweight();
 
168
  void reweight(CephContext *cct);
171
169
 
172
170
 
173
171
  /*** devices ***/
174
 
  int get_max_devices() {
 
172
  int get_max_devices() const {
175
173
    if (!crush) return 0;
176
174
    return crush->max_devices;
177
175
  }
382
380
    crush->max_devices = m;
383
381
  }
384
382
 
385
 
  int find_rule(int ruleset, int type, int size) {
 
383
  int find_rule(int ruleset, int type, int size) const {
386
384
    if (!crush) return -1;
387
385
    return crush_find_rule(crush, ruleset, type, size);
388
386
  }
389
387
  void do_rule(int rule, int x, vector<int>& out, int maxout, int forcefeed,
390
 
               vector<__u32>& weight) {
 
388
               const vector<__u32>& weight) const {
391
389
    int rawout[maxout];
392
390
    int numrep = crush_do_rule(crush, rule, x, rawout, maxout,
393
391
                               forcefeed, &weight[0]);