| 447 | int32_t indexOfFirstMismatch(char* x, char* y, int n) { |
| 448 | for (auto i = 0; i < n; ++i) { |
| 449 | if (x[i] != y[i]) { |
| 450 | return i; |
| 451 | } |
| 452 | } |
| 453 | return -1; |
| 454 | } |
| 455 | } // namespace |
| 456 | |
| 457 | void SsdFile::verifyWrite(AsyncDataCacheEntry& entry, SsdRun ssdRun) { |
| 458 | auto testData = std::make_unique<char[]>(entry.size()); |
| 459 | const auto rc = ::pread(fd_, testData.get(), entry.size(), ssdRun.offset()); |