Remove BS_OP_SYNC_STAB_ALL
This commit is contained in:
@@ -42,8 +42,7 @@
|
|||||||
#define BS_OP_DELETE 6
|
#define BS_OP_DELETE 6
|
||||||
#define BS_OP_LIST 7
|
#define BS_OP_LIST 7
|
||||||
#define BS_OP_ROLLBACK 8
|
#define BS_OP_ROLLBACK 8
|
||||||
#define BS_OP_SYNC_STAB_ALL 9
|
#define BS_OP_MAX 8
|
||||||
#define BS_OP_MAX 9
|
|
||||||
|
|
||||||
#define BS_OP_PRIVATE_DATA_SIZE 256
|
#define BS_OP_PRIVATE_DATA_SIZE 256
|
||||||
|
|
||||||
@@ -113,14 +112,6 @@ Input:
|
|||||||
Output:
|
Output:
|
||||||
- retval = 0 or negative error number (-ENOENT if no such version for stabilize)
|
- retval = 0 or negative error number (-ENOENT if no such version for stabilize)
|
||||||
|
|
||||||
## BS_OP_SYNC_STAB_ALL
|
|
||||||
|
|
||||||
ONLY FOR TESTS! Sync and mark all unstable object versions as stable, at once.
|
|
||||||
|
|
||||||
Input: Nothing except opcode
|
|
||||||
Output:
|
|
||||||
- retval = 0 or negative error number (-EINVAL)
|
|
||||||
|
|
||||||
## BS_OP_LIST
|
## BS_OP_LIST
|
||||||
|
|
||||||
Get a list of all objects in this Blockstore.
|
Get a list of all objects in this Blockstore.
|
||||||
|
|||||||
@@ -343,44 +343,6 @@ void blockstore_impl_t::enqueue_op(blockstore_op_t *op)
|
|||||||
ringloop->set_immediate([op]() { std::function<void (blockstore_op_t*)>(op->callback)(op); });
|
ringloop->set_immediate([op]() { std::function<void (blockstore_op_t*)>(op->callback)(op); });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (op->opcode == BS_OP_SYNC_STAB_ALL)
|
|
||||||
{
|
|
||||||
std::function<void(blockstore_op_t*)> *old_callback = new std::function<void(blockstore_op_t*)>(op->callback);
|
|
||||||
op->opcode = BS_OP_SYNC;
|
|
||||||
op->callback = [this, old_callback](blockstore_op_t *op)
|
|
||||||
{
|
|
||||||
if (op->retval >= 0 && unstable_writes.size() > 0)
|
|
||||||
{
|
|
||||||
op->opcode = BS_OP_STABLE;
|
|
||||||
op->len = unstable_writes.size();
|
|
||||||
obj_ver_id *vers = new obj_ver_id[op->len];
|
|
||||||
op->buf = vers;
|
|
||||||
int i = 0;
|
|
||||||
for (auto it = unstable_writes.begin(); it != unstable_writes.end(); it++, i++)
|
|
||||||
{
|
|
||||||
vers[i] = {
|
|
||||||
.oid = it->first,
|
|
||||||
.version = it->second,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
unstable_writes.clear();
|
|
||||||
op->callback = [old_callback](blockstore_op_t *op)
|
|
||||||
{
|
|
||||||
obj_ver_id *vers = (obj_ver_id*)op->buf;
|
|
||||||
delete[] vers;
|
|
||||||
op->buf = NULL;
|
|
||||||
(*old_callback)(op);
|
|
||||||
delete old_callback;
|
|
||||||
};
|
|
||||||
this->enqueue_op(op);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
(*old_callback)(op);
|
|
||||||
delete old_callback;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
if ((op->opcode == BS_OP_WRITE || op->opcode == BS_OP_WRITE_STABLE || op->opcode == BS_OP_DELETE) && !enqueue_write(op))
|
if ((op->opcode == BS_OP_WRITE || op->opcode == BS_OP_WRITE_STABLE || op->opcode == BS_OP_DELETE) && !enqueue_write(op))
|
||||||
{
|
{
|
||||||
ringloop->set_immediate([op]() { std::function<void (blockstore_op_t*)>(op->callback)(op); });
|
ringloop->set_immediate([op]() { std::function<void (blockstore_op_t*)>(op->callback)(op); });
|
||||||
|
|||||||
@@ -225,7 +225,7 @@ static enum fio_q_status bs_queue(struct thread_data *td, struct io_u *io)
|
|||||||
bsd->last_sync = false;
|
bsd->last_sync = false;
|
||||||
break;
|
break;
|
||||||
case DDIR_SYNC:
|
case DDIR_SYNC:
|
||||||
op->opcode = BS_OP_SYNC_STAB_ALL;
|
op->opcode = BS_OP_SYNC;
|
||||||
op->callback = [io, n = bsd->op_n](blockstore_op_t *op)
|
op->callback = [io, n = bsd->op_n](blockstore_op_t *op)
|
||||||
{
|
{
|
||||||
bs_data *bsd = (bs_data*)io->engine_data;
|
bs_data *bsd = (bs_data*)io->engine_data;
|
||||||
|
|||||||
Reference in New Issue
Block a user