mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-27 08:16:14 +02:00
More sensible to have deleteGCPath in LocalStore.
This commit is contained in:
parent
a48acfd684
commit
8a9baa0a30
5 changed files with 14 additions and 14 deletions
|
@ -97,13 +97,6 @@ struct GcStore : public virtual Store
|
||||||
* Perform a garbage collection.
|
* Perform a garbage collection.
|
||||||
*/
|
*/
|
||||||
virtual void collectGarbage(const GCOptions & options, GCResults & results) = 0;
|
virtual void collectGarbage(const GCOptions & options, GCResults & results) = 0;
|
||||||
|
|
||||||
/**
|
|
||||||
* Called by `collectGarbage` to recursively delete a path.
|
|
||||||
* The default implementation simply calls `deletePath`, but it can be
|
|
||||||
* overridden by stores that wish to provide their own deletion behaviour.
|
|
||||||
*/
|
|
||||||
virtual void deleteGCPath(const Path & path, uint64_t & bytesFreed);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -891,12 +891,6 @@ void LocalStore::collectGarbage(const GCOptions & options, GCResults & results)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void GcStore::deleteGCPath(const Path & path, uint64_t & bytesFreed)
|
|
||||||
{
|
|
||||||
deletePath(path, bytesFreed);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void LocalStore::autoGC(bool sync)
|
void LocalStore::autoGC(bool sync)
|
||||||
{
|
{
|
||||||
static auto fakeFreeSpaceFile = getEnv("_NIX_TEST_FREE_SPACE_FILE");
|
static auto fakeFreeSpaceFile = getEnv("_NIX_TEST_FREE_SPACE_FILE");
|
||||||
|
|
|
@ -222,7 +222,7 @@ void LocalOverlayStore::deleteGCPath(const Path & path, uint64_t & bytesFreed)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (pathExists(toUpperPath({path.substr(mergedDir.length())}))) {
|
if (pathExists(toUpperPath({path.substr(mergedDir.length())}))) {
|
||||||
GcStore::deleteGCPath(path, bytesFreed);
|
LocalStore::deleteGCPath(path, bytesFreed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -457,6 +457,12 @@ AutoCloseFD LocalStore::openGCLock()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void LocalStore::deleteGCPath(const Path & path, uint64_t & bytesFreed)
|
||||||
|
{
|
||||||
|
deletePath(path, bytesFreed);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
LocalStore::~LocalStore()
|
LocalStore::~LocalStore()
|
||||||
{
|
{
|
||||||
std::shared_future<void> future;
|
std::shared_future<void> future;
|
||||||
|
|
|
@ -222,6 +222,13 @@ public:
|
||||||
|
|
||||||
void collectGarbage(const GCOptions & options, GCResults & results) override;
|
void collectGarbage(const GCOptions & options, GCResults & results) override;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called by `collectGarbage` to recursively delete a path.
|
||||||
|
* The default implementation simply calls `deletePath`, but it can be
|
||||||
|
* overridden by stores that wish to provide their own deletion behaviour.
|
||||||
|
*/
|
||||||
|
virtual void deleteGCPath(const Path & path, uint64_t & bytesFreed);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Optimise the disk space usage of the Nix store by hard-linking
|
* Optimise the disk space usage of the Nix store by hard-linking
|
||||||
* files with the same contents.
|
* files with the same contents.
|
||||||
|
|
Loading…
Reference in a new issue