mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-10 08:16:15 +02:00
Implement overlay store deduplication.
This commit is contained in:
parent
a9510f9502
commit
8ddbcb736a
2 changed files with 18 additions and 3 deletions
|
@ -190,7 +190,23 @@ void LocalOverlayStore::deleteGCPath(const Path & path, uint64_t & bytesFreed)
|
|||
|
||||
void LocalOverlayStore::optimiseStore()
|
||||
{
|
||||
warn("not implemented");
|
||||
Activity act(*logger, actOptimiseStore);
|
||||
|
||||
// Note for LocalOverlayStore, queryAllValidPaths only returns paths in upper layer
|
||||
auto paths = queryAllValidPaths();
|
||||
|
||||
act.progress(0, paths.size());
|
||||
|
||||
uint64_t done = 0;
|
||||
|
||||
for (auto & path : paths) {
|
||||
if (lowerStore->isValidPath(path)) {
|
||||
// Deduplicate store path
|
||||
deletePath(toUpperPath(path));
|
||||
}
|
||||
done++;
|
||||
act.progress(done, paths.size());
|
||||
}
|
||||
}
|
||||
|
||||
bool LocalOverlayStore::verifyStore(bool checkContents, RepairFlag repair)
|
||||
|
|
|
@ -45,8 +45,7 @@ overlayInode=$(stat -c %i "$overlayPath")
|
|||
nix-store --store "$storeB" --optimise
|
||||
remountOverlayfs
|
||||
|
||||
# Check path only exists in lower store
|
||||
stat "$lowerPath"
|
||||
stat "$overlayPath"
|
||||
expect 1 stat "$upperPath"
|
||||
|
||||
#expect 1 stat $(toRealPath "$storeA/nix/store" "$path")
|
||||
|
|
Loading…
Reference in a new issue