Hide block_* fields

blocking-uring-test
Vitaliy Filippov 2019-12-10 00:13:57 +03:00
parent aaea3e1f99
commit a180b4961f
2 changed files with 13 additions and 8 deletions

View File

@ -266,10 +266,12 @@ class blockstore
std::list<blockstore_operation*> submit_queue; // FIXME: funny thing is that vector is better here std::list<blockstore_operation*> submit_queue; // FIXME: funny thing is that vector is better here
std::vector<obj_ver_id> unsynced_big_writes, unsynced_small_writes; std::vector<obj_ver_id> unsynced_big_writes, unsynced_small_writes;
std::list<blockstore_operation*> in_progress_syncs; // ...and probably here, too std::list<blockstore_operation*> in_progress_syncs; // ...and probably here, too
uint64_t block_count;
allocator *data_alloc = NULL; allocator *data_alloc = NULL;
uint8_t *zero_object; uint8_t *zero_object;
uint64_t block_count;
uint32_t block_order, block_size;
int meta_fd; int meta_fd;
int data_fd; int data_fd;
@ -359,7 +361,10 @@ public:
// Submission // Submission
void enqueue_op(blockstore_operation *op); void enqueue_op(blockstore_operation *op);
// FIXME public morozov // Unstable writes are added here (map of object_id -> version)
std::map<object_id, uint64_t> unstable_writes; std::map<object_id, uint64_t> unstable_writes;
uint32_t block_order, block_size;
inline uint32_t get_block_size() { return block_size; }
inline uint32_t get_block_order() { return block_order; }
inline uint64_t get_block_count() { return block_count; }
}; };

View File

@ -178,7 +178,7 @@ static enum fio_q_status bs_queue(struct thread_data *td, struct io_u *io)
io->engine_data = bsd; io->engine_data = bsd;
if (io->ddir == DDIR_WRITE || io->ddir == DDIR_READ) if (io->ddir == DDIR_WRITE || io->ddir == DDIR_READ)
assert(io->xfer_buflen <= bsd->bs->block_size); assert(io->xfer_buflen <= bsd->bs->get_block_size());
blockstore_operation *op = new blockstore_operation; blockstore_operation *op = new blockstore_operation;
op->callback = NULL; op->callback = NULL;
@ -190,9 +190,9 @@ static enum fio_q_status bs_queue(struct thread_data *td, struct io_u *io)
op->buf = io->xfer_buf; op->buf = io->xfer_buf;
op->oid = { op->oid = {
.inode = 1, .inode = 1,
.stripe = io->offset >> bsd->bs->block_order, .stripe = io->offset >> bsd->bs->get_block_order(),
}; };
op->offset = io->offset % bsd->bs->block_size; op->offset = io->offset % bsd->bs->get_block_size();
op->len = io->xfer_buflen; op->len = io->xfer_buflen;
op->callback = [io, n](blockstore_operation *op) op->callback = [io, n](blockstore_operation *op)
{ {
@ -211,9 +211,9 @@ static enum fio_q_status bs_queue(struct thread_data *td, struct io_u *io)
op->buf = io->xfer_buf; op->buf = io->xfer_buf;
op->oid = { op->oid = {
.inode = 1, .inode = 1,
.stripe = io->offset >> bsd->bs->block_order, .stripe = io->offset >> bsd->bs->get_block_order(),
}; };
op->offset = io->offset % bsd->bs->block_size; op->offset = io->offset % bsd->bs->get_block_size();
op->len = io->xfer_buflen; op->len = io->xfer_buflen;
op->callback = [io, n](blockstore_operation *op) op->callback = [io, n](blockstore_operation *op)
{ {