Skip to content

Commit

Permalink
Make read_at async fn
Browse files Browse the repository at this point in the history
  • Loading branch information
arpad-m committed Sep 2, 2023
1 parent d04ee8c commit 3ea1e53
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pageserver/src/virtual_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ impl VirtualFile {
// Copied from https://doc.rust-lang.org/1.72.0/src/std/os/unix/fs.rs.html#117-135
pub async fn read_exact_at(&self, mut buf: &mut [u8], mut offset: u64) -> Result<(), Error> {
while !buf.is_empty() {
match self.read_at(buf, offset) {
match self.read_at(buf, offset).await {
Ok(0) => {
return Err(Error::new(
std::io::ErrorKind::UnexpectedEof,
Expand Down Expand Up @@ -468,7 +468,7 @@ impl VirtualFile {
Ok(())
}

pub fn read_at(&self, buf: &mut [u8], offset: u64) -> Result<usize, Error> {
pub async fn read_at(&self, buf: &mut [u8], offset: u64) -> Result<usize, Error> {
let result = self.with_file("read", |file| file.read_at(buf, offset))?;
if let Ok(size) = result {
STORAGE_IO_SIZE
Expand Down

0 comments on commit 3ea1e53

Please sign in to comment.