split out Utility.InodeCache

This commit is contained in:
Joey Hess 2013-02-14 16:17:40 -04:00
parent 47477b2807
commit a52f8f382b
8 changed files with 95 additions and 88 deletions

View file

@ -95,7 +95,7 @@ ingest (Just source) = do
( do
mstat <- liftIO $ catchMaybeIO $ getSymbolicLinkStatus $ keyFilename source
k <- genKey source backend
godirect k (toCache =<< mstat)
godirect k (toInodeCache =<< mstat)
, go =<< genKey source backend
)
where
@ -107,9 +107,9 @@ ingest (Just source) = do
go Nothing = failure
godirect (Just (key, _)) (Just cache) =
ifM (compareCache (keyFilename source) $ Just cache)
ifM (liftIO $ compareInodeCache (keyFilename source) $ Just cache)
( do
writeCache key cache
writeInodeCache key cache
void $ addAssociatedFile key $ keyFilename source
unlessM crippledFileSystem $
liftIO $ allowWrite $ keyFilename source