Compare commits

..

No commits in common. "d00d4dbac079384c91561be6c652f79c2d57df1a" and "5280d1d56180315f2df0f9d224ac9466f9148f89" have entirely different histories.

2 changed files with 9 additions and 13 deletions

View File

@ -558,14 +558,13 @@ void blockstore_impl_t::process_list(blockstore_op_t *op)
if (stable_count >= stable_alloc) if (stable_count >= stable_alloc)
{ {
stable_alloc *= 2; stable_alloc *= 2;
obj_ver_id* nst = (obj_ver_id*)realloc(stable, sizeof(obj_ver_id) * stable_alloc); stable = (obj_ver_id*)realloc(stable, sizeof(obj_ver_id) * stable_alloc);
if (!nst) if (!stable)
{ {
op->retval = -ENOMEM; op->retval = -ENOMEM;
FINISH_OP(op); FINISH_OP(op);
return; return;
} }
stable = nst;
} }
stable[stable_count++] = { stable[stable_count++] = {
.oid = clean_it->first, .oid = clean_it->first,
@ -643,8 +642,8 @@ void blockstore_impl_t::process_list(blockstore_op_t *op)
if (stable_count >= stable_alloc) if (stable_count >= stable_alloc)
{ {
stable_alloc += 32768; stable_alloc += 32768;
obj_ver_id *nst = (obj_ver_id*)realloc(stable, sizeof(obj_ver_id) * stable_alloc); stable = (obj_ver_id*)realloc(stable, sizeof(obj_ver_id) * stable_alloc);
if (!nst) if (!stable)
{ {
if (unstable) if (unstable)
free(unstable); free(unstable);
@ -652,7 +651,6 @@ void blockstore_impl_t::process_list(blockstore_op_t *op)
FINISH_OP(op); FINISH_OP(op);
return; return;
} }
stable = nst;
} }
stable[stable_count++] = dirty_it->first; stable[stable_count++] = dirty_it->first;
} }
@ -668,8 +666,8 @@ void blockstore_impl_t::process_list(blockstore_op_t *op)
if (unstable_count >= unstable_alloc) if (unstable_count >= unstable_alloc)
{ {
unstable_alloc += 32768; unstable_alloc += 32768;
obj_ver_id *nst = (obj_ver_id*)realloc(unstable, sizeof(obj_ver_id) * unstable_alloc); unstable = (obj_ver_id*)realloc(unstable, sizeof(obj_ver_id) * unstable_alloc);
if (!nst) if (!unstable)
{ {
if (stable) if (stable)
free(stable); free(stable);
@ -677,7 +675,6 @@ void blockstore_impl_t::process_list(blockstore_op_t *op)
FINISH_OP(op); FINISH_OP(op);
return; return;
} }
unstable = nst;
} }
unstable[unstable_count++] = dirty_it->first; unstable[unstable_count++] = dirty_it->first;
} }
@ -697,8 +694,8 @@ void blockstore_impl_t::process_list(blockstore_op_t *op)
if (stable_count+unstable_count > stable_alloc) if (stable_count+unstable_count > stable_alloc)
{ {
stable_alloc = stable_count+unstable_count; stable_alloc = stable_count+unstable_count;
obj_ver_id *nst = (obj_ver_id*)realloc(stable, sizeof(obj_ver_id) * stable_alloc); stable = (obj_ver_id*)realloc(stable, sizeof(obj_ver_id) * stable_alloc);
if (!nst) if (!stable)
{ {
if (unstable) if (unstable)
free(unstable); free(unstable);
@ -706,7 +703,6 @@ void blockstore_impl_t::process_list(blockstore_op_t *op)
FINISH_OP(op); FINISH_OP(op);
return; return;
} }
stable = nst;
} }
// Copy unstable entries // Copy unstable entries
for (int i = 0; i < unstable_count; i++) for (int i = 0; i < unstable_count; i++)

View File

@ -28,7 +28,7 @@ struct etcd_kv_t
{ {
std::string key; std::string key;
json11::Json value; json11::Json value;
uint64_t mod_revision = 0; uint64_t mod_revision;
}; };
struct pg_config_t struct pg_config_t