}
f->close_section();
f->dump_stream("removed_snaps") << removed_snaps;
+ f->dump_int("quota_max_bytes", quota_max_bytes);
+ f->dump_int("quota_max_objects", quota_max_objects);
}
return;
}
- ENCODE_START(7, 5, bl);
+ ENCODE_START(8, 5, bl);
::encode(type, bl);
::encode(size, bl);
::encode(crush_ruleset, bl);
::encode(flags, bl);
::encode(crash_replay_interval, bl);
::encode(min_size, bl);
+ ::encode(quota_max_bytes, bl);
+ ::encode(quota_max_objects, bl);
ENCODE_FINISH(bl);
}
} else {
min_size = size - size/2;
}
+ if (struct_v >= 8) {
+ ::decode(quota_max_bytes, bl);
+ ::decode(quota_max_objects, bl);
+ }
DECODE_FINISH(bl);
calc_pg_masks();
}
a.snap_epoch = 11;
a.auid = 12;
a.crash_replay_interval = 13;
+ a.quota_max_bytes = 473;
+ a.quota_max_objects = 474;
o.push_back(new pg_pool_t(a));
a.snaps[3].name = "asdf";
o.push_back(new pg_pool_t(a));
a.removed_snaps.insert(2); // not quite valid to combine with snaps!
+ a.quota_max_bytes = 2473;
+ a.quota_max_objects = 4374;
o.push_back(new pg_pool_t(a));
}
out << " flags " << p.flags;
if (p.crash_replay_interval)
out << " crash_replay_interval " << p.crash_replay_interval;
+ if (p.quota_max_bytes)
+ out << " max_bytes " << p.quota_max_bytes;
+ if (p.quota_max_objects)
+ out << " max_objects " << p.quota_max_objects;
return out;
}
};
enum {
FLAG_HASHPSPOOL = 1, // hash pg seed and pool together (instead of adding)
+ FLAG_FULL = 2, // pool is full
};
static const char *get_type_name(int t) {
uint64_t auid; /// who owns the pg
__u32 crash_replay_interval; /// seconds to allow clients to replay ACKed but unCOMMITted requests
+ uint64_t quota_max_bytes; /// maximum number of bytes for this pool
+ uint64_t quota_max_objects; /// maximum number of objects for this pool
+
/*
* Pool snaps (global to this pool). These define a SnapContext for
* the pool, unless the client manually specifies an alternate
snap_seq(0), snap_epoch(0),
auid(0),
crash_replay_interval(0),
+ quota_max_bytes(0), quota_max_objects(0),
pg_num_mask(0), pgp_num_mask(0) { }
void dump(Formatter *f) const;
calc_pg_masks();
}
+ void set_quota_max_bytes(uint64_t m) {
+ quota_max_bytes = m;
+ }
+ uint64_t get_quota_max_bytes() {
+ return quota_max_bytes;
+ }
+
+ void set_quota_max_objects(uint64_t m) {
+ quota_max_objects = m;
+ }
+ uint64_t get_quota_max_objects() {
+ return quota_max_objects;
+ }
+
static int calc_bits_of(int t);
void calc_pg_masks();