Skip to content

Commit

Permalink
feat(ofs): support getattr
Browse files Browse the repository at this point in the history
  • Loading branch information
oowl committed Mar 25, 2024
1 parent 64ec26e commit 30ae3c2
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions bin/ofs/src/fuse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ use std::time::Duration;
use std::time::SystemTime;

use bytes::Bytes;


use fuse3::async_trait;
use fuse3::path::prelude::*;
use fuse3::Errno;
Expand Down Expand Up @@ -207,7 +209,8 @@ impl PathFilesystem for Fuse {
fh,
set_attr
);
Err(libc::EOPNOTSUPP.into())

self.getattr(_req, path, fh, 0).await
}

async fn symlink(
Expand Down Expand Up @@ -664,7 +667,13 @@ impl PathFilesystem for Fuse {
offset: u64,
whence: u32,
) -> Result<ReplyLSeek> {
log::debug!("lseek(path={:?}, fh={}, offset={}, whence={})", path, _fh, offset, whence);
log::debug!(
"lseek(path={:?}, fh={}, offset={}, whence={})",
path,
_fh,
offset,
whence
);

let whence = whence as i32;

Expand All @@ -677,7 +686,7 @@ impl PathFilesystem for Fuse {
.await
.map_err(opendal_error2errno)?;
let content_size = metadata.content_length();

if content_size >= offset as _ {
content_size as u64 - offset
} else {
Expand All @@ -690,7 +699,6 @@ impl PathFilesystem for Fuse {
Ok(ReplyLSeek { offset })
}


async fn copy_file_range(
&self,
req: Request,
Expand Down

0 comments on commit 30ae3c2

Please sign in to comment.