Compare commits
2 Commits
5280d1d561
...
d00d4dbac0
Author | SHA1 | Date |
---|---|---|
Vitaliy Filippov | d00d4dbac0 | |
Vitaliy Filippov | 5d9d6f32a0 |
|
@ -558,13 +558,14 @@ 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;
|
||||||
stable = (obj_ver_id*)realloc(stable, sizeof(obj_ver_id) * stable_alloc);
|
obj_ver_id* nst = (obj_ver_id*)realloc(stable, sizeof(obj_ver_id) * stable_alloc);
|
||||||
if (!stable)
|
if (!nst)
|
||||||
{
|
{
|
||||||
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,
|
||||||
|
@ -642,8 +643,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;
|
||||||
stable = (obj_ver_id*)realloc(stable, sizeof(obj_ver_id) * stable_alloc);
|
obj_ver_id *nst = (obj_ver_id*)realloc(stable, sizeof(obj_ver_id) * stable_alloc);
|
||||||
if (!stable)
|
if (!nst)
|
||||||
{
|
{
|
||||||
if (unstable)
|
if (unstable)
|
||||||
free(unstable);
|
free(unstable);
|
||||||
|
@ -651,6 +652,7 @@ 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;
|
||||||
}
|
}
|
||||||
|
@ -666,8 +668,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;
|
||||||
unstable = (obj_ver_id*)realloc(unstable, sizeof(obj_ver_id) * unstable_alloc);
|
obj_ver_id *nst = (obj_ver_id*)realloc(unstable, sizeof(obj_ver_id) * unstable_alloc);
|
||||||
if (!unstable)
|
if (!nst)
|
||||||
{
|
{
|
||||||
if (stable)
|
if (stable)
|
||||||
free(stable);
|
free(stable);
|
||||||
|
@ -675,6 +677,7 @@ 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;
|
||||||
}
|
}
|
||||||
|
@ -694,8 +697,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;
|
||||||
stable = (obj_ver_id*)realloc(stable, sizeof(obj_ver_id) * stable_alloc);
|
obj_ver_id *nst = (obj_ver_id*)realloc(stable, sizeof(obj_ver_id) * stable_alloc);
|
||||||
if (!stable)
|
if (!nst)
|
||||||
{
|
{
|
||||||
if (unstable)
|
if (unstable)
|
||||||
free(unstable);
|
free(unstable);
|
||||||
|
@ -703,6 +706,7 @@ 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++)
|
||||||
|
|
|
@ -28,7 +28,7 @@ struct etcd_kv_t
|
||||||
{
|
{
|
||||||
std::string key;
|
std::string key;
|
||||||
json11::Json value;
|
json11::Json value;
|
||||||
uint64_t mod_revision;
|
uint64_t mod_revision = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct pg_config_t
|
struct pg_config_t
|
||||||
|
|
Loading…
Reference in New Issue