Skip to content

Commit

Permalink
Fix clippy error of scorpio
Browse files Browse the repository at this point in the history
Signed-off-by: Quanyi Ma <[email protected]>
  • Loading branch information
genedna committed Jan 24, 2025
1 parent df3b015 commit f2e45cd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scorpio/src/overlayfs/layer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub trait Layer: Filesystem {
async fn create_whiteout(&self, ctx: Request, parent: Inode, name: &OsStr) -> Result<ReplyEntry> {
// Use temp value to avoid moved 'parent'.
let ino: u64 = parent;
match self.lookup(ctx, ino, name).await {//FXIME: errir
match self.lookup(ctx, ino, name).await {//FXIME: errir
Ok(v) => {
// Find whiteout char dev.
if is_whiteout(&v.attr) {
Expand All @@ -46,7 +46,7 @@ pub trait Layer: Filesystem {
}
None => return Err(e.into()),
}

},
}

Expand Down Expand Up @@ -126,15 +126,15 @@ pub trait Layer: Filesystem {
return Err(Error::from_raw_os_error(libc::ENOTDIR).into());
}


// Return Result<is_opaque>.
let check_attr = |inode: Inode, attr_name: &'static str, attr_size: u32| async move {
let cname = OsStr::new(attr_name);
match self.getxattr(ctx, inode, cname, attr_size).await {
Ok(v) => {
// xattr name exists and we get value.
if let ReplyXAttr::Data(bufs) = v {
if bufs.len() == 1 && bufs[0].to_ascii_lowercase() == b'y' {
if bufs.len() == 1 && bufs[0].eq_ignore_ascii_case(&b'y') {
return Ok(true);
}
}
Expand Down

0 comments on commit f2e45cd

Please sign in to comment.