case CEPH_PG_TYPE_RAID4:
out << "\ttype raid4\n";
break;
+ case CEPH_PG_TYPE_ERASURE:
+ out << "\ttype erasure\n";
+ break;
default:
out << "\ttype " << crush.get_rule_mask_type(i) << "\n";
}
int type;
if (tname == "replicated")
type = CEPH_PG_TYPE_REP;
- else if (tname == "raid4")
+ else if (tname == "raid4")
type = CEPH_PG_TYPE_RAID4;
+ else if (tname == "erasure")
+ type = CEPH_PG_TYPE_ERASURE;
else
assert(0);
step_emit );
crushrule = str_p("rule") >> !name >> '{'
>> str_p("ruleset") >> posint
- >> str_p("type") >> ( str_p("replicated") | str_p("raid4") )
+ >> str_p("type") >> ( str_p("replicated") | str_p("raid4") | str_p("erasure") )
>> str_p("min_size") >> posint
>> str_p("max_size") >> posint
>> +step
/*
* pg pool types
+ *
+ * NOTE: These map 1:1 on to the pg_pool_t::TYPE_* values. They are
+ * duplicated here only for CrushCompiler's benefit.
*/
#define CEPH_PG_TYPE_REP 1
#define CEPH_PG_TYPE_RAID4 2
+#define CEPH_PG_TYPE_ERASURE 3
/*
* stable_mod func is used to control number of placement groups.
enum {
TYPE_REP = 1, // replication
TYPE_RAID4 = 2, // raid4 (never implemented)
+ TYPE_ERASURE = 3, // erasure-coded
};
static const char *get_type_name(int t) {
switch (t) {
case TYPE_REP: return "rep";
case TYPE_RAID4: return "raid4";
+ case TYPE_ERASURE: return "erasure";
default: return "???";
}
}
bool is_rep() const { return get_type() == TYPE_REP; }
bool is_raid4() const { return get_type() == TYPE_RAID4; }
+ bool is_erasure() const { return get_type() == TYPE_ERASURE; }
unsigned get_pg_num() const { return pg_num; }
unsigned get_pgp_num() const { return pgp_num; }