diff options
Diffstat (limited to 'ripple/fossil')
-rw-r--r-- | ripple/fossil/src/bin/mount.rs | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/ripple/fossil/src/bin/mount.rs b/ripple/fossil/src/bin/mount.rs index 8b03104..75698a5 100644 --- a/ripple/fossil/src/bin/mount.rs +++ b/ripple/fossil/src/bin/mount.rs @@ -149,7 +149,9 @@ impl fuser::Filesystem for Filesystem { memtree::Node::File(f) => { attr = file_attr(ino, Kind::File, f.size as u64); } - memtree::Node::Link { target } => todo!(), + memtree::Node::Link { target } => { + attr = file_attr(ino, Kind::Link, target.len() as u64); + } } reply.entry(&Duration::ZERO, &attr, 0); } @@ -168,7 +170,9 @@ impl fuser::Filesystem for Filesystem { memtree::Node::File(f) => { attr = file_attr(ino, Kind::File, f.size as u64); } - memtree::Node::Link { target } => todo!(), + memtree::Node::Link { target } => { + attr = file_attr(ino, Kind::Link, target.len() as u64); + } } reply.attr(&Duration::ZERO, &attr); } else { @@ -198,8 +202,11 @@ impl fuser::Filesystem for Filesystem { } fn readlink(&mut self, _req: &fuser::Request<'_>, ino: u64, reply: fuser::ReplyData) { - debug!("[Not Implemented] readlink(ino: {:#x?})", ino); - reply.error(ENOSYS); + match self.find(ino) { + Some(memtree::Node::Link { target }) => reply.data(target.as_bytes()), + Some(_) => reply.error(EINVAL), + None => reply.error(ENOENT), + } } fn mknod( |