From 4e1309475c5761e5b72d017f8a709a4455000dfe Mon Sep 17 00:00:00 2001 From: Yuchen Liang Date: Tue, 8 Oct 2024 12:57:58 -0400 Subject: [PATCH] review: clone open_options instead of taking mut Signed-off-by: Yuchen Liang --- pageserver/src/virtual_file.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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?;