From 84813af5b938246d9a4a785dfb08b86383ef62ae Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 15 May 2014 11:33:46 +0200 Subject: nix-store --optimise: Remove bogus statistics --- src/libstore/optimise-store.cc | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/libstore/optimise-store.cc') diff --git a/src/libstore/optimise-store.cc b/src/libstore/optimise-store.cc index 39b9e587a..e43dbf31a 100644 --- a/src/libstore/optimise-store.cc +++ b/src/libstore/optimise-store.cc @@ -39,6 +39,7 @@ struct MakeReadOnly } }; + LocalStore::InodeHash LocalStore::loadInodeHash() { printMsg(lvlDebug, "loading hash inodes in memory"); @@ -60,7 +61,8 @@ LocalStore::InodeHash LocalStore::loadInodeHash() return inodeHash; } -Strings LocalStore::readDirectoryIgnoringInodes(const Path & path, const InodeHash & inodeHash, OptimiseStats & stats) + +Strings LocalStore::readDirectoryIgnoringInodes(const Path & path, const InodeHash & inodeHash) { Strings names; @@ -73,7 +75,6 @@ Strings LocalStore::readDirectoryIgnoringInodes(const Path & path, const InodeHa if (inodeHash.count(dirent->d_ino)) { printMsg(lvlDebug, format("`%1%' is already linked") % dirent->d_name); - stats.totalFiles++; continue; } @@ -86,6 +87,7 @@ Strings LocalStore::readDirectoryIgnoringInodes(const Path & path, const InodeHa return names; } + void LocalStore::optimisePath_(OptimiseStats & stats, const Path & path, InodeHash & inodeHash) { checkInterrupt(); @@ -95,7 +97,7 @@ void LocalStore::optimisePath_(OptimiseStats & stats, const Path & path, InodeHa throw SysError(format("getting attributes of path `%1%'") % path); if (S_ISDIR(st.st_mode)) { - Strings names = readDirectoryIgnoringInodes(path, inodeHash, stats); + Strings names = readDirectoryIgnoringInodes(path, inodeHash); foreach (Strings::iterator, i, names) optimisePath_(stats, path + "/" + *i, inodeHash); return; @@ -117,8 +119,6 @@ void LocalStore::optimisePath_(OptimiseStats & stats, const Path & path, InodeHa return; } - stats.totalFiles++; - /* This can still happen on top-level files */ if (st.st_nlink > 1 && inodeHash.count(st.st_ino)) { printMsg(lvlDebug, format("`%1%' is already linked, with %2% other file(s).") % path % (st.st_nlink - 2)); @@ -158,7 +158,6 @@ void LocalStore::optimisePath_(OptimiseStats & stats, const Path & path, InodeHa if (lstat(linkPath.c_str(), &stLink)) throw SysError(format("getting attributes of path `%1%'") % linkPath); - stats.sameContents++; if (st.st_ino == stLink.st_ino) { printMsg(lvlDebug, format("`%1%' is already linked to `%2%'") % path % linkPath); return; -- cgit v1.2.3