Rename PReadAll/PWriteAll for file descriptor ptr to ReadAll/WriteAll
Utils.cc contain 2 implementation of PReadAll: 1 for unix fd, and 1 for
FileDescriptorPtr. However, the implementation for unix fd calls pread
syscall under the hood, which does not change file offset. The
implementation for FileDescriptorPtr DOES change file offset, making
code inconsistent. For now we rename inconsistent functions to
ReadAll/WriteAll. The next CL adds PReadAll/PWriteAll implementation for
FileDescriptorPtr.
Test: treehugger
Change-Id: I2781b294f0f8e866275e1649e9b45d565d4cd5b8
diff --git a/payload_consumer/vabc_partition_writer.cc b/payload_consumer/vabc_partition_writer.cc
index 73bf413..e8994b4 100644
--- a/payload_consumer/vabc_partition_writer.cc
+++ b/payload_consumer/vabc_partition_writer.cc
@@ -115,11 +115,11 @@
break;
case CowOperation::CowReplace:
ssize_t bytes_read = 0;
- TEST_AND_RETURN_FALSE(utils::PReadAll(source_fd,
- buffer.data(),
- block_size,
- cow_op.src_block * block_size,
- &bytes_read));
+ TEST_AND_RETURN_FALSE(utils::ReadAll(source_fd,
+ buffer.data(),
+ block_size,
+ cow_op.src_block * block_size,
+ &bytes_read));
if (bytes_read <= 0 || static_cast<size_t>(bytes_read) != block_size) {
LOG(ERROR) << "source_fd->Read failed: " << bytes_read;
return false;