Wrap this submit_ into n_subops > 0 too
This commit is contained in:
+1
-1
@@ -368,7 +368,7 @@ class osd_t
|
|||||||
osd_rmw_stripe_t *si, bool wr, inode_t inode, uint64_t op_version);
|
osd_rmw_stripe_t *si, bool wr, inode_t inode, uint64_t op_version);
|
||||||
void submit_primary_del_subops(osd_op_t *cur_op, uint64_t *cur_set, uint64_t set_size, pg_osd_set_t & loc_set);
|
void submit_primary_del_subops(osd_op_t *cur_op, uint64_t *cur_set, uint64_t set_size, pg_osd_set_t & loc_set);
|
||||||
void submit_primary_del_batch(osd_op_t *cur_op, obj_ver_osd_t *chunks_to_delete, int chunks_to_delete_count);
|
void submit_primary_del_batch(osd_op_t *cur_op, obj_ver_osd_t *chunks_to_delete, int chunks_to_delete_count);
|
||||||
int submit_primary_sync_subops(osd_op_t *cur_op);
|
void submit_primary_sync_subops(osd_op_t *cur_op);
|
||||||
void submit_primary_stab_subops(osd_op_t *cur_op);
|
void submit_primary_stab_subops(osd_op_t *cur_op);
|
||||||
void submit_primary_rollback_subops(osd_op_t *cur_op, const uint64_t* osd_set);
|
void submit_primary_rollback_subops(osd_op_t *cur_op, const uint64_t* osd_set);
|
||||||
|
|
||||||
|
|||||||
@@ -633,13 +633,17 @@ void osd_t::submit_primary_del_batch(osd_op_t *cur_op, obj_ver_osd_t *chunks_to_
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int osd_t::submit_primary_sync_subops(osd_op_t *cur_op)
|
void osd_t::submit_primary_sync_subops(osd_op_t *cur_op)
|
||||||
{
|
{
|
||||||
osd_primary_op_data_t *op_data = cur_op->op_data;
|
osd_primary_op_data_t *op_data = cur_op->op_data;
|
||||||
int n_osds = op_data->dirty_osd_count;
|
int n_osds = op_data->dirty_osd_count;
|
||||||
osd_op_t *subops = new osd_op_t[n_osds];
|
|
||||||
op_data->done = op_data->errors = op_data->errcode = 0;
|
op_data->done = op_data->errors = op_data->errcode = 0;
|
||||||
op_data->n_subops = n_osds;
|
op_data->n_subops = n_osds;
|
||||||
|
if (op_data->n_subops <= 0)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
osd_op_t *subops = new osd_op_t[n_osds];
|
||||||
op_data->subops = subops;
|
op_data->subops = subops;
|
||||||
robin_hood::unordered_flat_map<uint64_t, osd_client_t*>::iterator peer_it;
|
robin_hood::unordered_flat_map<uint64_t, osd_client_t*>::iterator peer_it;
|
||||||
for (int i = 0; i < n_osds; i++)
|
for (int i = 0; i < n_osds; i++)
|
||||||
@@ -677,25 +681,27 @@ int osd_t::submit_primary_sync_subops(osd_op_t *cur_op)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
op_data->done++;
|
op_data->n_subops--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (op_data->done >= op_data->n_subops)
|
if (op_data->n_subops <= 0)
|
||||||
{
|
{
|
||||||
delete[] op_data->subops;
|
delete[] op_data->subops;
|
||||||
op_data->subops = NULL;
|
op_data->subops = NULL;
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void osd_t::submit_primary_stab_subops(osd_op_t *cur_op)
|
void osd_t::submit_primary_stab_subops(osd_op_t *cur_op)
|
||||||
{
|
{
|
||||||
osd_primary_op_data_t *op_data = cur_op->op_data;
|
osd_primary_op_data_t *op_data = cur_op->op_data;
|
||||||
int n_osds = op_data->unstable_write_osds->size();
|
int n_osds = op_data->unstable_write_osds->size();
|
||||||
osd_op_t *subops = new osd_op_t[n_osds];
|
|
||||||
op_data->done = op_data->errors = op_data->errcode = 0;
|
op_data->done = op_data->errors = op_data->errcode = 0;
|
||||||
op_data->n_subops = n_osds;
|
op_data->n_subops = n_osds;
|
||||||
|
if (op_data->n_subops <= 0)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
osd_op_t *subops = new osd_op_t[n_osds];
|
||||||
op_data->subops = subops;
|
op_data->subops = subops;
|
||||||
for (int i = 0; i < n_osds; i++)
|
for (int i = 0; i < n_osds; i++)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -127,13 +127,13 @@ resume_2:
|
|||||||
if (immediate_commit != IMMEDIATE_ALL)
|
if (immediate_commit != IMMEDIATE_ALL)
|
||||||
{
|
{
|
||||||
// SYNC
|
// SYNC
|
||||||
if (!submit_primary_sync_subops(cur_op))
|
submit_primary_sync_subops(cur_op);
|
||||||
{
|
|
||||||
goto resume_4;
|
|
||||||
}
|
|
||||||
resume_3:
|
resume_3:
|
||||||
op_data->st = 3;
|
if (op_data->n_subops > 0)
|
||||||
return;
|
{
|
||||||
|
op_data->st = 3;
|
||||||
|
return;
|
||||||
|
}
|
||||||
resume_4:
|
resume_4:
|
||||||
if (op_data->errors > 0)
|
if (op_data->errors > 0)
|
||||||
{
|
{
|
||||||
@@ -194,8 +194,11 @@ resume_6:
|
|||||||
// Actually delete copies which we wanted to delete
|
// Actually delete copies which we wanted to delete
|
||||||
submit_primary_del_batch(cur_op, op_data->copies_to_delete, op_data->copies_to_delete_count);
|
submit_primary_del_batch(cur_op, op_data->copies_to_delete, op_data->copies_to_delete_count);
|
||||||
resume_7:
|
resume_7:
|
||||||
op_data->st = 7;
|
if (op_data->n_subops > 0)
|
||||||
return;
|
{
|
||||||
|
op_data->st = 7;
|
||||||
|
return;
|
||||||
|
}
|
||||||
resume_8:
|
resume_8:
|
||||||
if (op_data->errors > 0)
|
if (op_data->errors > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user