diff --git a/pageserver/src/virtual_file.rs b/pageserver/src/virtual_file.rs index 2cd11f8f04..55d5e57cfc 100644 --- a/pageserver/src/virtual_file.rs +++ b/pageserver/src/virtual_file.rs @@ -140,7 +140,7 @@ impl VirtualFile { pub async fn open_with_options_v2>( path: P, - open_options: &mut OpenOptions, // Uses `&mut` here to add `O_DIRECT`. + open_options: &OpenOptions, ctx: &RequestContext, /* TODO: carry a pointer to the metrics in the RequestContext instead of the parsing https://github.com/neondatabase/neon/issues/6107 */ ) -> Result { let file = match get_io_mode() { @@ -152,7 +152,7 @@ impl VirtualFile { IoMode::Direct => { let file = VirtualFileInner::open_with_options( path, - open_options.custom_flags(nix::libc::O_DIRECT), + open_options.clone().custom_flags(nix::libc::O_DIRECT), ctx, ) .await?;