lib/nfs/FileReader: pass std::span to OnNfsFileRead()

This commit is contained in:
Max Kellermann
2022-11-17 06:13:40 +01:00
parent 3278ad2ed8
commit 73dc8ff6bd
3 changed files with 10 additions and 6 deletions

View File

@@ -239,7 +239,10 @@ NfsFileReader::OnNfsCallback(unsigned status, void *data) noexcept
break;
case State::READ:
OnNfsFileRead(data, status);
OnNfsFileRead({
static_cast<const std::byte *>(data),
static_cast<std::size_t>(status),
});
break;
}
}

View File

@@ -28,6 +28,7 @@
#include <cstddef>
#include <cstdint>
#include <exception>
#include <span>
#include <string>
#include <sys/stat.h>
@@ -125,7 +126,7 @@ protected:
*
* This method will be called from within the I/O thread.
*/
virtual void OnNfsFileRead(const void *data, size_t size) noexcept = 0;
virtual void OnNfsFileRead(std::span<const std::byte> src) noexcept = 0;
/**
* An error has occurred, which can be either while waiting