Loading include/daemon/ops/data.hpp +1 −1 Original line number Diff line number Diff line Loading @@ -132,7 +132,7 @@ public: void truncate(size_t size); int wait_for_tasks(); int wait_for_task(); }; class ChunkWriteOperation : public ChunkOperation<ChunkWriteOperation> { Loading src/daemon/backend/data/chunk_storage.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -275,7 +275,7 @@ void ChunkStorage::trim_chunk_space(const string& file_path, gkfs::rpc::chnk_id_ void ChunkStorage::truncate_chunk_file(const string& file_path, gkfs::rpc::chnk_id_t chunk_id, off_t length) { auto chunk_path = absolute(get_chunk_path(file_path, chunk_id)); assert(length > 0 && static_cast<gkfs::rpc::chnk_id_t>(length) <= chunksize_); int ret = truncate(chunk_path.c_str(), length); auto ret = truncate(chunk_path.c_str(), length); if (ret == -1) { auto err_str = fmt::format("Failed to truncate chunk file. File: '{}', Error: '{}'", chunk_path, ::strerror(errno)); Loading src/daemon/handler/srv_data.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -390,7 +390,7 @@ static hg_return_t rpc_srv_truncate(hg_handle_t handle) { } // wait and get output out.err = chunk_op.wait_for_tasks(); out.err = chunk_op.wait_for_task(); GKFS_DATA->spdlogger()->debug("{}() Sending output response '{}'", __func__, out.err); return gkfs::rpc::cleanup_respond(&handle, &in, &out); Loading src/daemon/ops/data.cpp +7 −8 Original line number Diff line number Diff line Loading @@ -25,7 +25,6 @@ using namespace std; namespace gkfs { namespace data { /* ------------------------------------------------------------------------ * -------------------------- TRUNCATE ------------------------------------ * ------------------------------------------------------------------------*/ Loading Loading @@ -64,7 +63,7 @@ void ChunkTruncateOperation::truncate_abt(void* _arg) { size); err_response = EIO; } ABT_eventual_set(arg->eventual, &err_response, sizeof(int)); ABT_eventual_set(arg->eventual, &err_response, sizeof(err_response)); } void ChunkTruncateOperation::clear_task_args() { Loading @@ -81,7 +80,7 @@ void ChunkTruncateOperation::truncate(size_t size) { assert(!task_eventuals_[0]); GKFS_DATA->spdlogger()->trace("ChunkTruncateOperation::{}() enter: path '{}' size '{}'", __func__, path_, size); // sizeof(int) comes from truncate's return type auto abt_err = ABT_eventual_create(sizeof(int), &task_eventuals_[0]); // truncate file return value if (abt_err != ABT_SUCCESS) { auto err_str = fmt::format("ChunkTruncateOperation::{}() Failed to create ABT eventual with abt_err '{}'", Loading @@ -104,7 +103,7 @@ void ChunkTruncateOperation::truncate(size_t size) { } int ChunkTruncateOperation::wait_for_tasks() { int ChunkTruncateOperation::wait_for_task() { GKFS_DATA->spdlogger()->trace("ChunkTruncateOperation::{}() enter: path '{}'", __func__, path_); int trunc_err = 0; Loading Loading @@ -155,7 +154,7 @@ void ChunkWriteOperation::write_file_abt(void* _arg) { path); wrote = -EIO; } ABT_eventual_set(arg->eventual, &wrote, sizeof(ssize_t)); ABT_eventual_set(arg->eventual, &wrote, sizeof(wrote)); } void ChunkWriteOperation::clear_task_args() { Loading Loading @@ -183,7 +182,7 @@ ChunkWriteOperation::write_nonblock(size_t idx, const uint64_t chunk_id, const c assert(idx < task_args_.size()); GKFS_DATA->spdlogger()->trace("ChunkWriteOperation::{}() enter: idx '{}' path '{}' size '{}' offset '{}'", __func__, idx, path_, size, offset); // sizeof(ssize_t) comes from pwrite's return type auto abt_err = ABT_eventual_create(sizeof(ssize_t), &task_eventuals_[idx]); // written file return value if (abt_err != ABT_SUCCESS) { auto err_str = fmt::format("ChunkWriteOperation::{}() Failed to create ABT eventual with abt_err '{}'", Loading Loading @@ -279,7 +278,7 @@ void ChunkReadOperation::read_file_abt(void* _arg) { path); read = -EIO; } ABT_eventual_set(arg->eventual, &read, sizeof(ssize_t)); ABT_eventual_set(arg->eventual, &read, sizeof(read)); } void ChunkReadOperation::clear_task_args() { Loading @@ -305,7 +304,7 @@ ChunkReadOperation::read_nonblock(size_t idx, const uint64_t chunk_id, char* bul assert(idx < task_args_.size()); GKFS_DATA->spdlogger()->trace("ChunkReadOperation::{}() enter: idx '{}' path '{}' size '{}' offset '{}'", __func__, idx, path_, size, offset); // sizeof(ssize_t) comes from pread's return type auto abt_err = ABT_eventual_create(sizeof(ssize_t), &task_eventuals_[idx]); // read file return value if (abt_err != ABT_SUCCESS) { auto err_str = fmt::format("ChunkReadOperation::{}() Failed to create ABT eventual with abt_err '{}'", Loading Loading
include/daemon/ops/data.hpp +1 −1 Original line number Diff line number Diff line Loading @@ -132,7 +132,7 @@ public: void truncate(size_t size); int wait_for_tasks(); int wait_for_task(); }; class ChunkWriteOperation : public ChunkOperation<ChunkWriteOperation> { Loading
src/daemon/backend/data/chunk_storage.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -275,7 +275,7 @@ void ChunkStorage::trim_chunk_space(const string& file_path, gkfs::rpc::chnk_id_ void ChunkStorage::truncate_chunk_file(const string& file_path, gkfs::rpc::chnk_id_t chunk_id, off_t length) { auto chunk_path = absolute(get_chunk_path(file_path, chunk_id)); assert(length > 0 && static_cast<gkfs::rpc::chnk_id_t>(length) <= chunksize_); int ret = truncate(chunk_path.c_str(), length); auto ret = truncate(chunk_path.c_str(), length); if (ret == -1) { auto err_str = fmt::format("Failed to truncate chunk file. File: '{}', Error: '{}'", chunk_path, ::strerror(errno)); Loading
src/daemon/handler/srv_data.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -390,7 +390,7 @@ static hg_return_t rpc_srv_truncate(hg_handle_t handle) { } // wait and get output out.err = chunk_op.wait_for_tasks(); out.err = chunk_op.wait_for_task(); GKFS_DATA->spdlogger()->debug("{}() Sending output response '{}'", __func__, out.err); return gkfs::rpc::cleanup_respond(&handle, &in, &out); Loading
src/daemon/ops/data.cpp +7 −8 Original line number Diff line number Diff line Loading @@ -25,7 +25,6 @@ using namespace std; namespace gkfs { namespace data { /* ------------------------------------------------------------------------ * -------------------------- TRUNCATE ------------------------------------ * ------------------------------------------------------------------------*/ Loading Loading @@ -64,7 +63,7 @@ void ChunkTruncateOperation::truncate_abt(void* _arg) { size); err_response = EIO; } ABT_eventual_set(arg->eventual, &err_response, sizeof(int)); ABT_eventual_set(arg->eventual, &err_response, sizeof(err_response)); } void ChunkTruncateOperation::clear_task_args() { Loading @@ -81,7 +80,7 @@ void ChunkTruncateOperation::truncate(size_t size) { assert(!task_eventuals_[0]); GKFS_DATA->spdlogger()->trace("ChunkTruncateOperation::{}() enter: path '{}' size '{}'", __func__, path_, size); // sizeof(int) comes from truncate's return type auto abt_err = ABT_eventual_create(sizeof(int), &task_eventuals_[0]); // truncate file return value if (abt_err != ABT_SUCCESS) { auto err_str = fmt::format("ChunkTruncateOperation::{}() Failed to create ABT eventual with abt_err '{}'", Loading @@ -104,7 +103,7 @@ void ChunkTruncateOperation::truncate(size_t size) { } int ChunkTruncateOperation::wait_for_tasks() { int ChunkTruncateOperation::wait_for_task() { GKFS_DATA->spdlogger()->trace("ChunkTruncateOperation::{}() enter: path '{}'", __func__, path_); int trunc_err = 0; Loading Loading @@ -155,7 +154,7 @@ void ChunkWriteOperation::write_file_abt(void* _arg) { path); wrote = -EIO; } ABT_eventual_set(arg->eventual, &wrote, sizeof(ssize_t)); ABT_eventual_set(arg->eventual, &wrote, sizeof(wrote)); } void ChunkWriteOperation::clear_task_args() { Loading Loading @@ -183,7 +182,7 @@ ChunkWriteOperation::write_nonblock(size_t idx, const uint64_t chunk_id, const c assert(idx < task_args_.size()); GKFS_DATA->spdlogger()->trace("ChunkWriteOperation::{}() enter: idx '{}' path '{}' size '{}' offset '{}'", __func__, idx, path_, size, offset); // sizeof(ssize_t) comes from pwrite's return type auto abt_err = ABT_eventual_create(sizeof(ssize_t), &task_eventuals_[idx]); // written file return value if (abt_err != ABT_SUCCESS) { auto err_str = fmt::format("ChunkWriteOperation::{}() Failed to create ABT eventual with abt_err '{}'", Loading Loading @@ -279,7 +278,7 @@ void ChunkReadOperation::read_file_abt(void* _arg) { path); read = -EIO; } ABT_eventual_set(arg->eventual, &read, sizeof(ssize_t)); ABT_eventual_set(arg->eventual, &read, sizeof(read)); } void ChunkReadOperation::clear_task_args() { Loading @@ -305,7 +304,7 @@ ChunkReadOperation::read_nonblock(size_t idx, const uint64_t chunk_id, char* bul assert(idx < task_args_.size()); GKFS_DATA->spdlogger()->trace("ChunkReadOperation::{}() enter: idx '{}' path '{}' size '{}' offset '{}'", __func__, idx, path_, size, offset); // sizeof(ssize_t) comes from pread's return type auto abt_err = ABT_eventual_create(sizeof(ssize_t), &task_eventuals_[idx]); // read file return value if (abt_err != ABT_SUCCESS) { auto err_str = fmt::format("ChunkReadOperation::{}() Failed to create ABT eventual with abt_err '{}'", Loading