Some useless code changes for beauty
This commit is contained in:
@@ -2291,7 +2291,9 @@ void blockstore_heap_t::apply_inflight(heap_inflight_lsn_t & inflight)
|
|||||||
}
|
}
|
||||||
if (!next)
|
if (!next)
|
||||||
{
|
{
|
||||||
|
// The last freed entry must be a deletion
|
||||||
assert(!prev);
|
assert(!prev);
|
||||||
|
assert(wr->entry_type == BS_HEAP_DELETE|BS_HEAP_STABLE);
|
||||||
auto & pg_idx = block_index[get_pg_id(wr->inode, wr->stripe)];
|
auto & pg_idx = block_index[get_pg_id(wr->inode, wr->stripe)];
|
||||||
auto & inode_idx = pg_idx[wr->inode];
|
auto & inode_idx = pg_idx[wr->inode];
|
||||||
heap_inode_map_t::iterator li_it;
|
heap_inode_map_t::iterator li_it;
|
||||||
|
|||||||
@@ -193,12 +193,12 @@ void blockstore_impl_t::loop()
|
|||||||
heap->start_block_write(block_num);
|
heap->start_block_write(block_num);
|
||||||
mb.sent = true;
|
mb.sent = true;
|
||||||
}
|
}
|
||||||
|
pending_modified_blocks.clear();
|
||||||
int ret = ringloop->submit();
|
int ret = ringloop->submit();
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
throw std::runtime_error(std::string("io_uring_submit: ") + strerror(-ret));
|
throw std::runtime_error(std::string("io_uring_submit: ") + strerror(-ret));
|
||||||
}
|
}
|
||||||
pending_modified_blocks.clear();
|
|
||||||
if ((initial_ring_space - ringloop->space_left()) > 0)
|
if ((initial_ring_space - ringloop->space_left()) > 0)
|
||||||
{
|
{
|
||||||
live = true;
|
live = true;
|
||||||
|
|||||||
@@ -22,16 +22,18 @@ void blockstore_impl_t::prepare_meta_block_write(uint32_t modified_block)
|
|||||||
ring_data_t *data = ((ring_data_t*)sqe->user_data);
|
ring_data_t *data = ((ring_data_t*)sqe->user_data);
|
||||||
uint8_t *buf = (uint8_t*)memalign_or_die(MEM_ALIGNMENT, dsk.meta_block_size);
|
uint8_t *buf = (uint8_t*)memalign_or_die(MEM_ALIGNMENT, dsk.meta_block_size);
|
||||||
data->iov = (struct iovec){ buf, (size_t)dsk.meta_block_size };
|
data->iov = (struct iovec){ buf, (size_t)dsk.meta_block_size };
|
||||||
data->callback = [this, modified_block, buf](ring_data_t *data)
|
data->callback = [this, modified_block](ring_data_t *data)
|
||||||
{
|
{
|
||||||
free(buf);
|
|
||||||
live = true;
|
live = true;
|
||||||
if (data->res != data->iov.iov_len)
|
if (data->res != data->iov.iov_len)
|
||||||
{
|
{
|
||||||
// FIXME: our state becomes corrupted after a write error. maybe do something better than just die
|
// FIXME: our state becomes corrupted after a write error. maybe do something better than just die
|
||||||
disk_error_abort("data write", data->res, data->iov.iov_len);
|
disk_error_abort("data write", data->res, data->iov.iov_len);
|
||||||
}
|
}
|
||||||
modified_blocks.erase(modified_block);
|
auto it = modified_blocks.find(modified_block);
|
||||||
|
assert(it != modified_blocks.end());
|
||||||
|
free(it->second.buf);
|
||||||
|
modified_blocks.erase(it);
|
||||||
heap->complete_block_write(modified_block);
|
heap->complete_block_write(modified_block);
|
||||||
ringloop->wakeup();
|
ringloop->wakeup();
|
||||||
};
|
};
|
||||||
@@ -249,13 +251,12 @@ enospc:
|
|||||||
goto enospc;
|
goto enospc;
|
||||||
assert(res == 0);
|
assert(res == 0);
|
||||||
PRIV(op)->lsn = obj->lsn;
|
PRIV(op)->lsn = obj->lsn;
|
||||||
if (op->len)
|
|
||||||
heap->use_buffer_area(op->oid.inode, loc, op->len);
|
|
||||||
prepare_meta_block_write(PRIV(op)->modified_block);
|
prepare_meta_block_write(PRIV(op)->modified_block);
|
||||||
PRIV(op)->pending_ops++;
|
PRIV(op)->pending_ops++;
|
||||||
if (op->len > 0)
|
if (op->len > 0)
|
||||||
{
|
{
|
||||||
// Prepare buffered data write
|
// Prepare buffered data write
|
||||||
|
heap->use_buffer_area(op->oid.inode, loc, op->len);
|
||||||
if (dsk.inmemory_journal)
|
if (dsk.inmemory_journal)
|
||||||
{
|
{
|
||||||
memcpy((uint8_t*)buffer_area + loc, op->buf, op->len);
|
memcpy((uint8_t*)buffer_area + loc, op->buf, op->len);
|
||||||
@@ -348,6 +349,7 @@ resume_12:
|
|||||||
}
|
}
|
||||||
resume_4:
|
resume_4:
|
||||||
{
|
{
|
||||||
|
BS_SUBMIT_CHECK_SQES(1);
|
||||||
auto obj = heap->read_entry(op->oid);
|
auto obj = heap->read_entry(op->oid);
|
||||||
int res = 0;
|
int res = 0;
|
||||||
if (PRIV(op)->write_type == _REDIRECT_INTENT)
|
if (PRIV(op)->write_type == _REDIRECT_INTENT)
|
||||||
|
|||||||
Reference in New Issue
Block a user