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/partition_writer.cc b/payload_consumer/partition_writer.cc
index bdc6015..12b206e 100644
--- a/payload_consumer/partition_writer.cc
+++ b/payload_consumer/partition_writer.cc
@@ -351,7 +351,7 @@
for (uint64_t offset = 0; offset < length; offset += zeros.size()) {
uint64_t chunk_length =
std::min(length - offset, static_cast<uint64_t>(zeros.size()));
- TEST_AND_RETURN_FALSE(utils::PWriteAll(
+ TEST_AND_RETURN_FALSE(utils::WriteAll(
target_fd_, zeros.data(), chunk_length, start + offset));
}
}