lib/nfs/FileReader: move code to ReadCallback()
This commit is contained in:
parent
98f53b6d3d
commit
0ac24e5a24
|
@ -197,6 +197,12 @@ NfsFileReader::StatCallback(const struct nfs_stat_64 *st) noexcept
|
|||
OnNfsFileOpen(st->nfs_size);
|
||||
}
|
||||
|
||||
inline void
|
||||
NfsFileReader::ReadCallback(std::size_t nbytes, const void *data) noexcept
|
||||
{
|
||||
OnNfsFileRead({static_cast<const std::byte *>(data), nbytes});
|
||||
}
|
||||
|
||||
void
|
||||
NfsFileReader::OnNfsCallback(unsigned status, void *data) noexcept
|
||||
{
|
||||
|
@ -217,10 +223,7 @@ NfsFileReader::OnNfsCallback(unsigned status, void *data) noexcept
|
|||
break;
|
||||
|
||||
case State::READ:
|
||||
OnNfsFileRead({
|
||||
static_cast<const std::byte *>(data),
|
||||
static_cast<std::size_t>(status),
|
||||
});
|
||||
ReadCallback(static_cast<std::size_t>(status), data);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -126,6 +126,7 @@ private:
|
|||
|
||||
void OpenCallback(nfsfh *_fh) noexcept;
|
||||
void StatCallback(const struct nfs_stat_64 *st) noexcept;
|
||||
void ReadCallback(std::size_t nbytes, const void *data) noexcept;
|
||||
|
||||
/* virtual methods from NfsLease */
|
||||
void OnNfsConnectionReady() noexcept final;
|
||||
|
|
Loading…
Reference in New Issue