From d2d501503d9aa19787466129394141c794bb84e6 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 9 Dec 2015 17:47:05 -0400 Subject: use InodeCache when dropping a key to see if a pointer file can be safely reset The Keys database can hold multiple inode caches for a given key. One for the annex object, and one for each pointer file, which may not be hard linked to it. Inode caches for a key are recorded when its content is added to the annex, but only if it has known pointer files. This is to avoid the overhead of maintaining the database when not needed. When the smudge filter outputs a file's content, the inode cache is not updated, because git's smudge interface doesn't let us write the file. So, dropping will fall back to doing an expensive verification then. Ideally, git's interface would be improved, and then the inode cache could be updated then too. --- Annex/Action.hs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Annex/Action.hs') diff --git a/Annex/Action.hs b/Annex/Action.hs index f59c9c2f4..348487e7c 100644 --- a/Annex/Action.hs +++ b/Annex/Action.hs @@ -17,6 +17,7 @@ import System.Posix.Signals import Common.Annex import qualified Annex import Annex.Content +import qualified Database.Keys {- Actions to perform each time ran. -} startup :: Annex () @@ -32,4 +33,5 @@ shutdown :: Bool -> Annex () shutdown nocommit = do saveState nocommit sequence_ =<< M.elems <$> Annex.getState Annex.cleanup + Database.Keys.shutdown liftIO reapZombies -- zombies from long-running git processes -- cgit v1.2.3