From 15ddeff532b517843668eef8f615838d15b4f75c Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 4 Jan 2015 23:27:34 +0100 Subject: Merge commit a1dd396cc02922372314c35c8035a38bfeea08df of branch 'nix'. --- nix/libstore/local-store.hh | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'nix/libstore/local-store.hh') 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 +#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 InodeHash; +#else + typedef std::set 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); -- cgit 1.4.1