Skip to content

Commit

Permalink
feat(ofs): fix code
Browse files Browse the repository at this point in the history
  • Loading branch information
oowl committed Mar 26, 2024
1 parent 83055c9 commit 63f4e86
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions bin/ofs/src/fuse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -661,18 +661,24 @@ impl PathFilesystem for Fuse {
&self,
_req: Request,
path: Option<&OsStr>,
_fh: u64,
fh: u64,
offset: u64,
whence: u32,
) -> Result<ReplyLSeek> {
log::debug!(
"lseek(path={:?}, fh={}, offset={}, whence={})",
path,
_fh,
fh,
offset,
whence
);

let file = self.get_opened_file(FileKey::try_from(fh)?, path)?;

if !file.is_read && !file.is_write {
Err(Errno::from(libc::EACCES))?;
}

let whence = whence as i32;

let offset = if whence == libc::SEEK_CUR || whence == libc::SEEK_SET {
Expand Down

0 comments on commit 63f4e86

Please sign in to comment.