Skip to content

Commit

Permalink
Add TODO for fscache blob gc
Browse files Browse the repository at this point in the history
Signed-off-by: Qi Wang <[email protected]>
  • Loading branch information
yawqi committed Jul 1, 2022
1 parent 5f32d3b commit a6eed6e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/bin/nydusd/fs_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,7 @@ impl FsCacheHandler {
let filetype = metadata.file_type();
let filename = entry.file_name().to_str().unwrap().to_string();
let objtype = FsCacheObjType::get_fscache_objtype(&filename);
// TODO skip chunk map and blob meta file
// If objtype is not valid, skip this file.
// If file is not dir but the objtype is Index or Intermediate, skip this file.
// if neither directory nor regular file, skip this file.
Expand All @@ -589,6 +590,7 @@ impl FsCacheHandler {
entry,
));
}

Ok(file_atime_pq)
}

Expand Down Expand Up @@ -633,12 +635,17 @@ impl FsCacheHandler {
}
FsCacheObjType::Data | FsCacheObjType::Special => {
inuse = self.check_if_in_use(&entry.filepath);
if !inuse {
// TODO extract the blobid from the blob file path.
// TODO mark corresponding chunk map file as deleted and delete it.
}
}
_ => {
// TODO this should be an error
}
}
if !inuse {
// self.remove_blob_entry();
self.cull_file(entry.filepath.as_path());
}
}
Expand Down

0 comments on commit a6eed6e

Please sign in to comment.