Remove hardcode of the EC(2+1) scheme, now it supports EC(k+1), fix some bugs

This commit is contained in:
Vitaliy Filippov
2020-02-13 19:13:17 +03:00
parent b7ccd63104
commit ffe073473a
13 changed files with 183 additions and 95 deletions
+4 -3
View File
@@ -51,15 +51,16 @@ void osd_t::exec_secondary(osd_op_t *cur_op)
}
else if (cur_op->op.hdr.opcode == OSD_OP_SECONDARY_LIST)
{
if (cur_op->op.sec_list.pgtotal < cur_op->op.sec_list.pgnum)
if (cur_op->op.sec_list.pg_count < cur_op->op.sec_list.list_pg)
{
// requested pg number is greater than total pg count
cur_op->bs_op.retval = -EINVAL;
secondary_op_callback(cur_op);
return;
}
cur_op->bs_op.len = cur_op->op.sec_list.pgtotal;
cur_op->bs_op.offset = cur_op->op.sec_list.pgnum - 1;
cur_op->bs_op.oid.stripe = cur_op->op.sec_list.parity_block_size;
cur_op->bs_op.len = cur_op->op.sec_list.pg_count;
cur_op->bs_op.offset = cur_op->op.sec_list.list_pg - 1;
}
#ifdef OSD_STUB
cur_op->bs_op.retval = cur_op->bs_op.len;