about summary refs log tree commit diff
path: root/src/libstore/local-store.hh
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2008-06-18T09·34+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2008-06-18T09·34+0000
commita72709afd8ffe35613a6bacd698a36395e095a48 (patch)
tree2f549bafbed92a53bd6faea1da43667307af7593 /src/libstore/local-store.hh
parent934c58aa381f5eacc86304ba7f5c6775ff456cd5 (diff)
* Some refactoring: put the GC options / results in separate structs.
* The garbage collector now also prints the number of blocks freed.

Diffstat (limited to 'src/libstore/local-store.hh')
-rw-r--r--src/libstore/local-store.hh18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/libstore/local-store.hh b/src/libstore/local-store.hh
index 444a5f3402df..1957b9f57948 100644
--- a/src/libstore/local-store.hh
+++ b/src/libstore/local-store.hh
@@ -25,10 +25,11 @@ struct OptimiseStats
     unsigned long sameContents;
     unsigned long filesLinked;
     unsigned long long bytesFreed;
+    unsigned long long blocksFreed;
     OptimiseStats()
     {
         totalFiles = sameContents = filesLinked = 0;
-        bytesFreed = 0;
+        bytesFreed = blocksFreed = 0;
     }
 };
 
@@ -89,11 +90,11 @@ public:
 
     Roots findRoots();
 
-    void collectGarbage(GCAction action, const PathSet & pathsToDelete,
-        bool ignoreLiveness, PathSet & result, unsigned long long & bytesFreed);
+    void collectGarbage(const GCOptions & options, GCResults & results);
 
     /* Delete a path from the Nix store. */
-    void deleteFromStore(const Path & path, unsigned long long & bytesFreed);
+    void deleteFromStore(const Path & path, unsigned long long & bytesFreed,
+        unsigned long long & blocksFreed);
     
     /* Optimise the disk space usage of the Nix store by hard-linking
        files with the same contents. */
@@ -143,10 +144,9 @@ private:
     
     void upgradeStore12();
 
-    void tryToDelete(GCAction action, const PathSet & livePaths,
-        const PathSet & tempRootsClosed, PathSet & done, PathSet & deleted,
-        const Path & path, unsigned long long & bytesFreed);
-    
+    void tryToDelete(const GCOptions & options, GCResults & results,
+        const PathSet & livePaths, const PathSet & tempRootsClosed, PathSet & done, 
+        const Path & path);
 };
 
 
@@ -179,7 +179,7 @@ void getOwnership(const Path & path);
 /* Like deletePath(), but changes the ownership of `path' using the
    setuid wrapper if necessary (and possible). */
 void deletePathWrapped(const Path & path,
-    unsigned long long & bytesFreed);
+    unsigned long long & bytesFreed, unsigned long long & blocksFreed);
 
 void deletePathWrapped(const Path & path);