WIP: page_cache_priming_writer: bugfixes

This commit is contained in:
Christian Schwarz
2024-03-14 17:15:03 +00:00
parent eb1ccd7988
commit a1f4eb2815
2 changed files with 11 additions and 3 deletions

View File

@@ -1100,7 +1100,11 @@ impl OwnedAsyncWriter for VirtualFile {
}
#[inline(always)]
async fn write_all_borrowed(&mut self, _buf: &[u8], _ctx: &RequestContext) -> std::io::Result<usize> {
async fn write_all_borrowed(
&mut self,
_buf: &[u8],
_ctx: &RequestContext,
) -> std::io::Result<usize> {
// TODO: ensure this through the type system
panic!("this should not happen");
}

View File

@@ -85,9 +85,13 @@ where
.try_into()
.unwrap();
self.cache
.fill_cache(&self.under, self.written / (N as u64), page, ctx)
.fill_cache(
&self.under,
(self.written / (N as u64)) + (page_no_in_buf as u64),
page,
ctx,
)
.await;
self.written += N as u64;
}
self.written += nwritten as u64;
Ok((nwritten, tokio_epoll_uring::Slice::into_inner(buf)))