summaryrefslogtreecommitdiff
path: root/Annex
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-12-10 14:20:38 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-12-10 14:20:38 -0400
commit1dd612b2b106911433b0d3f6593ba7c2ce48483a (patch)
treef393e7f092d3c9283fd3f80b6dd70d0050b7a664 /Annex
parent511279bfaa3ac15e7685556c2298b7b8ae7729b3 (diff)
move
Diffstat (limited to 'Annex')
-rw-r--r--Annex/Content/Direct.hs15
-rw-r--r--Annex/InodeSentinal.hs19
2 files changed, 18 insertions, 16 deletions
diff --git a/Annex/Content/Direct.hs b/Annex/Content/Direct.hs
index 3d2ab1c58..59bea8f99 100644
--- a/Annex/Content/Direct.hs
+++ b/Annex/Content/Direct.hs
@@ -162,14 +162,6 @@ removeInodeCache key = withInodeCacheFile key $ \f ->
withInodeCacheFile :: Key -> (FilePath -> Annex a) -> Annex a
withInodeCacheFile key a = a =<< calcRepo (gitAnnexInodeCache key)
-{- Checks if a InodeCache matches the current version of a file. -}
-sameInodeCache :: FilePath -> [InodeCache] -> Annex Bool
-sameInodeCache _ [] = return False
-sameInodeCache file old = go =<< withTSDelta (liftIO . genInodeCache file)
- where
- go Nothing = return False
- go (Just curr) = elemInodeCaches curr old
-
{- Checks if a FileStatus matches the recorded InodeCache of a file. -}
sameFileStatus :: Key -> FilePath -> FileStatus -> Annex Bool
sameFileStatus key f status = do
@@ -180,13 +172,6 @@ sameFileStatus key f status = do
([], Nothing) -> return True
_ -> return False
-elemInodeCaches :: InodeCache -> [InodeCache] -> Annex Bool
-elemInodeCaches _ [] = return False
-elemInodeCaches c (l:ls) = ifM (compareInodeCaches c l)
- ( return True
- , elemInodeCaches c ls
- )
-
compareInodeCachesWith :: Annex InodeComparisonType
compareInodeCachesWith = ifM inodesChanged ( return Weakly, return Strongly )
diff --git a/Annex/InodeSentinal.hs b/Annex/InodeSentinal.hs
index 450e3b967..8b48094df 100644
--- a/Annex/InodeSentinal.hs
+++ b/Annex/InodeSentinal.hs
@@ -14,7 +14,8 @@ import qualified Annex
import Utility.InodeCache
import Annex.Perms
-{- If the inodes have changed, only the size and mtime are compared. -}
+{- If the sendinal shows the inodes have changed, only the size and mtime
+ - are compared. -}
compareInodeCaches :: InodeCache -> InodeCache -> Annex Bool
compareInodeCaches x y
| compareStrong x y = return True
@@ -23,6 +24,22 @@ compareInodeCaches x y
, return False
)
+{- Checks if one of the provided old InodeCache matches the current
+ - version of a file. -}
+sameInodeCache :: FilePath -> [InodeCache] -> Annex Bool
+sameInodeCache _ [] = return False
+sameInodeCache file old = go =<< withTSDelta (liftIO . genInodeCache file)
+ where
+ go Nothing = return False
+ go (Just curr) = elemInodeCaches curr old
+
+elemInodeCaches :: InodeCache -> [InodeCache] -> Annex Bool
+elemInodeCaches _ [] = return False
+elemInodeCaches c (l:ls) = ifM (compareInodeCaches c l)
+ ( return True
+ , elemInodeCaches c ls
+ )
+
{- 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.