aboutsummaryrefslogtreecommitdiff
path: root/Annex/InodeSentinal.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-12-09 17:00:37 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-12-09 17:00:37 -0400
commit76ccac53916d308aa4806d38bb8cfb6a9d1f9081 (patch)
tree10f7618585df73c335c459f9562b04f37a7eb03f /Annex/InodeSentinal.hs
parentb5c8ba7db3ea2eb4f1cd28e49cadb5fd348ca738 (diff)
add inode cache to the db
Renamed the db to keys, since it is various info about a Keys. Dropping a key will update its pointer files, as long as their content can be verified to be unmodified. This falls back to checksum verification, but I want it to use an InodeCache of the key, for speed. But, I have not made anything populate that cache yet.
Diffstat (limited to 'Annex/InodeSentinal.hs')
-rw-r--r--Annex/InodeSentinal.hs9
1 files changed, 9 insertions, 0 deletions
diff --git a/Annex/InodeSentinal.hs b/Annex/InodeSentinal.hs
index 7047a405c..450e3b967 100644
--- a/Annex/InodeSentinal.hs
+++ b/Annex/InodeSentinal.hs
@@ -14,6 +14,15 @@ import qualified Annex
import Utility.InodeCache
import Annex.Perms
+{- If the inodes have changed, only the size and mtime are compared. -}
+compareInodeCaches :: InodeCache -> InodeCache -> Annex Bool
+compareInodeCaches x y
+ | compareStrong x y = return True
+ | otherwise = ifM inodesChanged
+ ( return $ compareWeak x y
+ , return False
+ )
+
{- Some filesystems get new inodes each time they are mounted.
- In order to work on such a filesystem, a sentinal file is used to detect
- when the inodes have changed.