Rename OP_ to BS_OP_
This commit is contained in:
@@ -312,7 +312,7 @@ void osd_t::handle_read(ring_data_t *data, int peer_fd)
|
||||
}
|
||||
}
|
||||
|
||||
void osd_t::blockstore_op_callback(osd_op_t *cur_op)
|
||||
void osd_t::secondary_op_callback(osd_op_t *cur_op)
|
||||
{
|
||||
auto cl_it = clients.find(cur_op->peer_fd);
|
||||
if (cl_it != clients.end())
|
||||
@@ -341,7 +341,7 @@ void osd_t::enqueue_op(osd_op_t *cur_op)
|
||||
{
|
||||
// Bad command
|
||||
cur_op->bs_op.retval = -EINVAL;
|
||||
blockstore_op_callback(cur_op);
|
||||
secondary_op_callback(cur_op);
|
||||
return;
|
||||
}
|
||||
if (cur_op->op.hdr.opcode == OSD_OP_TEST_SYNC_STAB_ALL)
|
||||
@@ -352,16 +352,16 @@ void osd_t::enqueue_op(osd_op_t *cur_op)
|
||||
if (!allow_test_ops)
|
||||
{
|
||||
cur_op->bs_op.retval = -EINVAL;
|
||||
blockstore_op_callback(cur_op);
|
||||
secondary_op_callback(cur_op);
|
||||
return;
|
||||
}
|
||||
cur_op->bs_op.flags = OP_SYNC;
|
||||
cur_op->bs_op.opcode = BS_OP_SYNC;
|
||||
cur_op->bs_op.callback = [this, cur_op](blockstore_op_t *op)
|
||||
{
|
||||
auto & unstable_writes = bs->get_unstable_writes();
|
||||
if (op->retval >= 0 && unstable_writes.size() > 0)
|
||||
{
|
||||
op->flags = OP_STABLE;
|
||||
op->opcode = BS_OP_STABLE;
|
||||
op->len = unstable_writes.size();
|
||||
obj_ver_id *vers = new obj_ver_id[op->len];
|
||||
op->buf = vers;
|
||||
@@ -376,7 +376,7 @@ void osd_t::enqueue_op(osd_op_t *cur_op)
|
||||
unstable_writes.clear();
|
||||
op->callback = [this, cur_op](blockstore_op_t *op)
|
||||
{
|
||||
blockstore_op_callback(cur_op);
|
||||
secondary_op_callback(cur_op);
|
||||
obj_ver_id *vers = (obj_ver_id*)op->buf;
|
||||
delete[] vers;
|
||||
};
|
||||
@@ -384,19 +384,19 @@ void osd_t::enqueue_op(osd_op_t *cur_op)
|
||||
}
|
||||
else
|
||||
{
|
||||
blockstore_op_callback(cur_op);
|
||||
secondary_op_callback(cur_op);
|
||||
}
|
||||
};
|
||||
bs->enqueue_op(&cur_op->bs_op);
|
||||
return;
|
||||
}
|
||||
// FIXME: LIST is not a blockstore op yet
|
||||
cur_op->bs_op.callback = [this, cur_op](blockstore_op_t* bs_op) { blockstore_op_callback(cur_op); };
|
||||
cur_op->bs_op.flags = (cur_op->op.hdr.opcode == OSD_OP_SECONDARY_READ ? OP_READ
|
||||
: (cur_op->op.hdr.opcode == OSD_OP_SECONDARY_WRITE ? OP_WRITE
|
||||
: (cur_op->op.hdr.opcode == OSD_OP_SECONDARY_SYNC ? OP_SYNC
|
||||
: (cur_op->op.hdr.opcode == OSD_OP_SECONDARY_STABILIZE ? OP_STABLE
|
||||
: (cur_op->op.hdr.opcode == OSD_OP_SECONDARY_DELETE ? OP_DELETE
|
||||
cur_op->bs_op.callback = [this, cur_op](blockstore_op_t* bs_op) { secondary_op_callback(cur_op); };
|
||||
cur_op->bs_op.opcode = (cur_op->op.hdr.opcode == OSD_OP_SECONDARY_READ ? BS_OP_READ
|
||||
: (cur_op->op.hdr.opcode == OSD_OP_SECONDARY_WRITE ? BS_OP_WRITE
|
||||
: (cur_op->op.hdr.opcode == OSD_OP_SECONDARY_SYNC ? BS_OP_SYNC
|
||||
: (cur_op->op.hdr.opcode == OSD_OP_SECONDARY_STABILIZE ? BS_OP_STABLE
|
||||
: (cur_op->op.hdr.opcode == OSD_OP_SECONDARY_DELETE ? BS_OP_DELETE
|
||||
: -1)))));
|
||||
if (cur_op->op.hdr.opcode == OSD_OP_SECONDARY_READ ||
|
||||
cur_op->op.hdr.opcode == OSD_OP_SECONDARY_WRITE)
|
||||
|
||||
Reference in New Issue
Block a user