Skip to content

Commit

Permalink
rafs: get rid of several unimplemented()
Browse files Browse the repository at this point in the history
The nydus-image check for v5 uses some unimplemented methods of
InodeWrapper, which causes panicking at runtime.

Fixes: dragonflyoss#1160

Signed-off-by: Jiang Liu <gerry@linux.alibaba.com>
  • Loading branch information
jiangliu authored and hangvane committed Apr 7, 2023
1 parent 259bf50 commit 6662897
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions rafs/src/metadata/inode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ impl InodeWrapper {
match self {
InodeWrapper::V5(i) => i.i_mtime,
InodeWrapper::V6(i) => i.i_mtime,
InodeWrapper::Ref(_i) => unimplemented!(),
InodeWrapper::Ref(i) => i.get_attr().mtime,
}
}

Expand All @@ -357,7 +357,7 @@ impl InodeWrapper {
match self {
InodeWrapper::V5(i) => i.i_mtime_nsec,
InodeWrapper::V6(i) => i.i_mtime_nsec,
InodeWrapper::Ref(_i) => unimplemented!(),
InodeWrapper::Ref(i) => i.get_attr().mtimensec,
}
}

Expand All @@ -376,7 +376,7 @@ impl InodeWrapper {
match self {
InodeWrapper::V5(i) => i.i_blocks,
InodeWrapper::V6(i) => i.i_blocks,
InodeWrapper::Ref(_i) => unimplemented!(),
InodeWrapper::Ref(i) => i.get_attr().blocks,
}
}

Expand Down Expand Up @@ -424,7 +424,7 @@ impl InodeWrapper {
match self {
InodeWrapper::V5(i) => i.i_nlink,
InodeWrapper::V6(i) => i.i_nlink,
InodeWrapper::Ref(_i) => unimplemented!(),
InodeWrapper::Ref(i) => i.get_attr().nlink,
}
}

Expand Down Expand Up @@ -506,7 +506,7 @@ impl InodeWrapper {
match self {
InodeWrapper::V5(i) => i.i_child_index,
InodeWrapper::V6(_i) => u32::MAX,
InodeWrapper::Ref(_i) => unimplemented!(),
InodeWrapper::Ref(i) => i.get_child_index().unwrap_or(u32::MAX),
}
}

Expand Down

0 comments on commit 6662897

Please sign in to comment.