diff --git a/include/dsn/tool-api/aio_task.h b/include/dsn/tool-api/aio_task.h index b0c6a45f94..a92d563ea0 100644 --- a/include/dsn/tool-api/aio_task.h +++ b/include/dsn/tool-api/aio_task.h @@ -51,8 +51,6 @@ class aio_context : public ref_counter // filled by apps dsn_handle_t file; void *buffer; - bool support_write_vec; // if the aio provider supports write buffer vector - std::vector *write_buffer_vec; // only used if support_write_vec is true uint32_t buffer_size; uint64_t file_offset; @@ -64,8 +62,6 @@ class aio_context : public ref_counter aio_context() : file(nullptr), buffer(nullptr), - support_write_vec(false), - write_buffer_vec(nullptr), buffer_size(0), file_offset(0), type(AIO_Invalid), diff --git a/src/aio/aio_provider.cpp b/src/aio/aio_provider.cpp index 0c03252c4b..78dc406dad 100644 --- a/src/aio/aio_provider.cpp +++ b/src/aio/aio_provider.cpp @@ -33,12 +33,9 @@ aio_provider::aio_provider(disk_engine *disk) : _engine(disk) {} service_node *aio_provider::node() const { return _engine->node(); } -void aio_provider::complete_io(aio_task *aio, - error_code err, - uint32_t bytes, - int delay_milliseconds) +void aio_provider::complete_io(aio_task *aio, error_code err, uint32_t bytes) { - _engine->complete_io(aio, err, bytes, delay_milliseconds); + _engine->complete_io(aio, err, bytes); } namespace tools { diff --git a/src/aio/aio_provider.h b/src/aio/aio_provider.h index c2be9a46c4..dcd49e7f3d 100644 --- a/src/aio/aio_provider.h +++ b/src/aio/aio_provider.h @@ -71,7 +71,7 @@ class aio_provider virtual aio_context *prepare_aio_context(aio_task *) = 0; - void complete_io(aio_task *aio, error_code err, uint32_t bytes, int delay_milliseconds = 0); + void complete_io(aio_task *aio, error_code err, uint32_t bytes); private: disk_engine *_engine; diff --git a/src/aio/disk_engine.cpp b/src/aio/disk_engine.cpp index 6bf7b09126..24b691dfd0 100644 --- a/src/aio/disk_engine.cpp +++ b/src/aio/disk_engine.cpp @@ -207,14 +207,7 @@ void disk_engine::process_write(aio_task *aio, uint32_t sz) // no batching if (dio->buffer_size == sz) { - if (dio->buffer == nullptr) { - if (dio->support_write_vec) { - dio->write_buffer_vec = &aio->_unmerged_write_buffers; - } else { - aio->collapse(); - } - } - dassert(dio->buffer || dio->write_buffer_vec, ""); + aio->collapse(); _provider->submit_aio_task(aio); } @@ -251,7 +244,7 @@ void disk_engine::process_write(aio_task *aio, uint32_t sz) } } -void disk_engine::complete_io(aio_task *aio, error_code err, uint32_t bytes, int delay_milliseconds) +void disk_engine::complete_io(aio_task *aio, error_code err, uint32_t bytes) { if (err != ERR_OK) { dinfo("disk operation failure with code %s, err = %s, aio_task_id = %016" PRIx64, diff --git a/src/aio/disk_engine.h b/src/aio/disk_engine.h index 8889b6add1..cfe8da3258 100644 --- a/src/aio/disk_engine.h +++ b/src/aio/disk_engine.h @@ -82,7 +82,7 @@ class disk_engine : public utils::singleton ~disk_engine() = default; void process_write(aio_task *wk, uint32_t sz); - void complete_io(aio_task *aio, error_code err, uint32_t bytes, int delay_milliseconds = 0); + void complete_io(aio_task *aio, error_code err, uint32_t bytes); std::unique_ptr _provider; service_node *_node; diff --git a/src/aio/sim_aio_provider.cpp b/src/aio/sim_aio_provider.cpp index 97cf365d5d..35783044dc 100644 --- a/src/aio/sim_aio_provider.cpp +++ b/src/aio/sim_aio_provider.cpp @@ -39,7 +39,7 @@ void sim_aio_provider::submit_aio_task(aio_task *aio) uint32_t bytes; err = aio_internal(aio, false, &bytes); - complete_io(aio, err, bytes, 0); + complete_io(aio, err, bytes); } } // namespace aio