fix path root joining

fix path insertion
redo-gragh
Avril 3 years ago
parent 0e407dc375
commit 0e2653c087
Signed by: flanchan
GPG Key ID: 284488987C31F630

@ -69,14 +69,16 @@ pub async fn work_on_all(state: State) -> INodeInfoGraph
for path_comp in comp_children
{
if let Some((res, root)) = path_comp
if let Some((res, _root)) = path_comp
{
for (path, ino) in join_root(&root, res)
for (path, ino) in res.into_iter()
{
// If this inode is not in the map, this is a top-level path.
//if let Some(_) = ino_map.get(&ino) {
//if let Some(_) = ino_map.get(&ino) {
output.insert(path, ino); //XXX: Why does `output` always end up empty???
//} else {
// eprintln!("No ino entry for {:?} ({:?})", path, ino);
//}
@ -118,15 +120,17 @@ fn walk(state: State, root: PathBuf, root_ino: INode) -> BoxFuture<'static, Hash
// Not added, process.
match process_entry(&entry, root_ino).await {
Ok(fsinfo) => {
let path = entry.path();
if fsinfo.is_dir()
{
if let Some(next) = state.deeper()
{
children.push(tokio::spawn(
walk(next, entry.path(), ino)
walk(next, path.clone(), ino)
));
}
}
output.insert(path, ino);
let mut cache = state.cache_sub();
cache.insert(ino, fsinfo).await;
},
@ -147,7 +151,7 @@ fn walk(state: State, root: PathBuf, root_ino: INode) -> BoxFuture<'static, Hash
{
if let Ok(map) = child
{
output.extend(join_root(&root, map));
output.extend(map);//join_root(&root, map));
} else {
eprintln!("Child panic");
}

Loading…
Cancel
Save