Skip to content

Commit

Permalink
add comment about ABI
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Hagemeier <chagem@amazon.com>
  • Loading branch information
c-hagem committed Nov 12, 2024
1 parent 65c4e92 commit 56ce3a4
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions mountpoint-s3/src/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use tracing::{debug, trace, Level};

use fuser::consts::FOPEN_DIRECT_IO;
//use fuser::consts::FOPEN_NOFLUSH;
const FUSE_FOPEN_NOFLUSH: u32 = 1 << 5; // c.f. https://github.com/torvalds/linux/blob/master/include/uapi/linux/fuse.h#L372
use fuser::{FileAttr, KernelConfig};
use mountpoint_s3_client::ObjectClient;

Expand Down Expand Up @@ -334,11 +335,7 @@ where
FileHandleState::new_read_handle(&lookup, self).await?
};

let is_read_filehandle = match state {
FileHandleState::Read { .. } => true,
_ => false,
};

let is_read_filehandle = matches!(state, FileHandleState::Read { .. });
let fh = self.next_handle();
let handle = FileHandle {
inode,
Expand All @@ -347,9 +344,9 @@ where
};
debug!(fh, ino, "new file handle created");
self.file_handles.write().await.insert(fh, Arc::new(handle));

let reply_flags = (if direct_io { FOPEN_DIRECT_IO } else { 0 }) | (if is_read_filehandle { 1 << 5 } else { 0 });
debug!("Set read file flags as {reply_flags}");
// TODO: Maybe perform some check against ABI version here (?)
let mut reply_flags = if direct_io { FOPEN_DIRECT_IO } else { 0 };
reply_flags |= if is_read_filehandle { FUSE_FOPEN_NOFLUSH } else { 0 };
Ok(Opened { fh, flags: reply_flags })
}

Expand Down

0 comments on commit 56ce3a4

Please sign in to comment.