summary refs log tree commit diff
path: root/nix/libstore/local-store.hh
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-01-04 23:27:34 +0100
committerLudovic Courtès <ludo@gnu.org>2015-01-04 23:27:34 +0100
commit15ddeff532b517843668eef8f615838d15b4f75c (patch)
tree2d11b350f4a83b28cf72e3ba37cfe218ac74f868 /nix/libstore/local-store.hh
parent828c0bec6b95a6dcfffd28d0a28caecf4f69addf (diff)
downloadguix-15ddeff532b517843668eef8f615838d15b4f75c.tar.gz
Merge commit a1dd396cc02922372314c35c8035a38bfeea08df of branch 'nix'.
Diffstat (limited to 'nix/libstore/local-store.hh')
-rw-r--r--nix/libstore/local-store.hh19
1 files changed, 15 insertions, 4 deletions
diff --git a/nix/libstore/local-store.hh b/nix/libstore/local-store.hh
index 09639e74cf..54331e448a 100644
--- a/nix/libstore/local-store.hh
+++ b/nix/libstore/local-store.hh
@@ -6,6 +6,11 @@
 #include "util.hh"
 #include "pathlocks.hh"
 
+#if HAVE_TR1_UNORDERED_SET
+#include <tr1/unordered_set>
+#endif
+
+
 
 class sqlite3;
 class sqlite3_stmt;
@@ -29,14 +34,12 @@ struct Derivation;
 
 struct OptimiseStats
 {
-    unsigned long totalFiles;
-    unsigned long sameContents;
     unsigned long filesLinked;
     unsigned long long bytesFreed;
     unsigned long long blocksFreed;
     OptimiseStats()
     {
-        totalFiles = sameContents = filesLinked = 0;
+        filesLinked = 0;
         bytesFreed = blocksFreed = 0;
     }
 };
@@ -303,7 +306,15 @@ private:
 
     void checkDerivationOutputs(const Path & drvPath, const Derivation & drv);
 
-    void optimisePath_(OptimiseStats & stats, const Path & path);
+#if HAVE_TR1_UNORDERED_SET
+    typedef std::tr1::unordered_set<ino_t> InodeHash;
+#else
+    typedef std::set<ino_t> InodeHash;
+#endif
+
+    InodeHash loadInodeHash();
+    Strings readDirectoryIgnoringInodes(const Path & path, const InodeHash & inodeHash);
+    void optimisePath_(OptimiseStats & stats, const Path & path, InodeHash & inodeHash);
 
     // Internal versions that are not wrapped in retry_sqlite.
     bool isValidPath_(const Path & path);