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);
|
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
|
void
|
||||||
NfsFileReader::OnNfsCallback(unsigned status, void *data) noexcept
|
NfsFileReader::OnNfsCallback(unsigned status, void *data) noexcept
|
||||||
{
|
{
|
||||||
@ -217,10 +223,7 @@ NfsFileReader::OnNfsCallback(unsigned status, void *data) noexcept
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case State::READ:
|
case State::READ:
|
||||||
OnNfsFileRead({
|
ReadCallback(static_cast<std::size_t>(status), data);
|
||||||
static_cast<const std::byte *>(data),
|
|
||||||
static_cast<std::size_t>(status),
|
|
||||||
});
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -126,6 +126,7 @@ private:
|
|||||||
|
|
||||||
void OpenCallback(nfsfh *_fh) noexcept;
|
void OpenCallback(nfsfh *_fh) noexcept;
|
||||||
void StatCallback(const struct nfs_stat_64 *st) noexcept;
|
void StatCallback(const struct nfs_stat_64 *st) noexcept;
|
||||||
|
void ReadCallback(std::size_t nbytes, const void *data) noexcept;
|
||||||
|
|
||||||
/* virtual methods from NfsLease */
|
/* virtual methods from NfsLease */
|
||||||
void OnNfsConnectionReady() noexcept final;
|
void OnNfsConnectionReady() noexcept final;
|
||||||
|
Loading…
Reference in New Issue
Block a user