Skip to content

Commit

Permalink
tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
sharpeye committed Jan 30, 2025
1 parent 4780db4 commit e20922c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class TIORequestParserActor: public TActor<TIORequestParserActor>
TStorageBufferAllocator Allocator;

public:
explicit TIORequestParserActor(
TIORequestParserActor(
const TActorId& owner,
TStorageBufferAllocator allocator)
: TActor(&TIORequestParserActor::StateWork)
Expand Down Expand Up @@ -81,16 +81,18 @@ class TIORequestParserActor: public TActor<TIORequestParserActor>
request->Record.Swap(&msg->Record);

if (Allocator) {
const auto& buffers = request->Record.GetBlocks().GetBuffers();

ui64 bytesCount = 0;
for (const auto& buffer: request->Record.GetBlocks().GetBuffers()) {
for (const auto& buffer: buffers) {
bytesCount += buffer.size();
}

request->Storage = Allocator(bytesCount);
request->StorageSize = bytesCount;

char* dst = request->Storage.get();
for (const auto& buffer: request->Record.GetBlocks().GetBuffers()) {
for (const auto& buffer: buffers) {
std::memcpy(dst, buffer.data(), buffer.size());
dst += buffer.size();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace {
ui64 GetVolumeRequestId(
const TEvDiskAgentPrivate::TParsedWriteDeviceBlocksRequest& request)
{
return request.Record.GetVolumeRequestId();
return NStorage::GetVolumeRequestId(request.Record);
}

TBlockRange64 BuildRequestBlockRange(
Expand Down

0 comments on commit e20922c

Please sign in to comment.