From: Joey Hess Date: Wed, 22 Jun 2022 20:20:08 +0000 (-0400) Subject: RawFilePath optimisations X-Git-Tag: archive/raspbian/10.20250416-2+rpi1~1^2~72^2~152 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=d00e23cac9c93994cf84efeae6b1e0c4334ec5a7;p=git-annex.git RawFilePath optimisations --- diff --git a/Annex/Content.hs b/Annex/Content.hs index 6e31ef0ea5..754127bd55 100644 --- a/Annex/Content.hs +++ b/Annex/Content.hs @@ -898,12 +898,12 @@ getKeyStatus key = catchDefaultIO KeyMissing $ do then KeyUnlockedThin else KeyPresent -getKeyFileStatus :: Key -> FilePath -> Annex KeyStatus +getKeyFileStatus :: Key -> RawFilePath -> Annex KeyStatus getKeyFileStatus key file = do s <- getKeyStatus key case s of KeyUnlockedThin -> catchDefaultIO KeyUnlockedThin $ - ifM (isJust <$> isAnnexLink (toRawFilePath file)) + ifM (isJust <$> isAnnexLink file) ( return KeyLockedThin , return KeyUnlockedThin ) diff --git a/Annex/Content/PointerFile.hs b/Annex/Content/PointerFile.hs index 10a6b3b2cc..8d3edf6bd0 100644 --- a/Annex/Content/PointerFile.hs +++ b/Annex/Content/PointerFile.hs @@ -68,5 +68,5 @@ depopulatePointerFile key file = do (\t -> touch tmp' t False) (fmap Posix.modificationTimeHiRes st) #endif - withTSDelta (liftIO . genInodeCache (toRawFilePath tmp)) + withTSDelta (liftIO . genInodeCache tmp') maybe noop (restagePointerFile (Restage True) file) ic diff --git a/Command/Fsck.hs b/Command/Fsck.hs index f34640b087..d93c6f1707 100644 --- a/Command/Fsck.hs +++ b/Command/Fsck.hs @@ -132,7 +132,7 @@ start from inc si file key = Backend.getBackend (fromRawFilePath file) key >>= \ perform :: Key -> RawFilePath -> Backend -> NumCopies -> Annex Bool perform key file backend numcopies = do - keystatus <- getKeyFileStatus key (fromRawFilePath file) + keystatus <- getKeyFileStatus key file check -- order matters [ fixLink key file