From f758f6d5cbef989bff75fcd140edb8e0b8899b84 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 6 Apr 2013 16:01:39 -0400 Subject: Bugfix: Direct mode no longer repeatedly checksums duplicated files. Fixed by storing a list of cached inodes for a key, instead of just one. Backwards compatability note: An old git-annex version will fail to parse an inode cache file that has been written by a new version, and has multiple items. It will succees if just one. So old git-annexes will have even worse behavior when there are duplicated files, if that is possible. I don't think it will be a problem. (Famous last words.) Also, note that it doesn't expire old and unused inode caches for a key. It would be possible to add this if needed; just look through the associated files for a key and if there are more cached inodes, throw out any not corresponding to associated files. Unless a file is being copied repeatedly and the old copy deleted, this lack of expiry should not be a problem. --- Assistant/Threads/Committer.hs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'Assistant/Threads/Committer.hs') diff --git a/Assistant/Threads/Committer.hs b/Assistant/Threads/Committer.hs index bee359d59..727b85840 100644 --- a/Assistant/Threads/Committer.hs +++ b/Assistant/Threads/Committer.hs @@ -297,13 +297,10 @@ handleAdds delayadd cs = returnWhen (null incomplete) $ do removedKeysMap ct l = do mks <- forM (filter isRmChange l) $ \c -> catKeyFile $ changeFile c - M.fromList . catMaybes <$> forM (catMaybes mks) mkpair + M.fromList . concat <$> mapM mkpairs (catMaybes mks) where - mkpair k = do - mcache <- recordedInodeCache k - case mcache of - Just cache -> return $ Just (inodeCacheToKey ct cache, k) - Nothing -> return Nothing + mkpairs k = map (\c -> (inodeCacheToKey ct c, k)) <$> + recordedInodeCache k failedingest = do liftAnnex showEndFail -- cgit v1.2.3