summaryrefslogtreecommitdiff
path: root/Annex/Content.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-10-09 15:48:02 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-10-09 15:48:02 -0400
commit3c43af79d56a25bfff3eae1c1342c9a308223347 (patch)
treee52a095b8963ca42d6530d40bee5858ea8bfcf3c /Annex/Content.hs
parente36bfabb0e56087771d385a9f4ecdb342f1f14db (diff)
fix local dropping to not require extra locking of copies, but only that the local copy be locked for removal
Diffstat (limited to 'Annex/Content.hs')
-rw-r--r--Annex/Content.hs15
1 files changed, 7 insertions, 8 deletions
diff --git a/Annex/Content.hs b/Annex/Content.hs
index 40c78fd34..0dc47d9e2 100644
--- a/Annex/Content.hs
+++ b/Annex/Content.hs
@@ -13,7 +13,8 @@ module Annex.Content (
inAnnexSafe,
inAnnexCheck,
lockContentShared,
- lockContentExclusive,
+ lockContentForRemoval,
+ ContentRemovalLock,
getViaTmp,
getViaTmp',
checkDiskSpaceToGet,
@@ -192,14 +193,12 @@ lockContentShared key a = lockContentUsing lock key $ do
lock = winLocker lockShared
#endif
-newtype ContentLockExclusive = ContentLockExclusive Key
-
{- Exclusively locks content, while performing an action that
- might remove it.
-}
-lockContentExclusive :: Key -> (ContentLockExclusive -> Annex a) -> Annex a
-lockContentExclusive key a = lockContentUsing lock key $
- a (ContentLockExclusive key)
+lockContentForRemoval :: Key -> (ContentRemovalLock -> Annex a) -> Annex a
+lockContentForRemoval key a = lockContentUsing lock key $
+ a (ContentRemovalLock key)
where
#ifndef mingw32_HOST_OS
{- Since content files are stored with the write bit disabled, have
@@ -547,8 +546,8 @@ cleanObjectLoc key cleaner = do
- In direct mode, deletes the associated files or files, and replaces
- them with symlinks.
-}
-removeAnnex :: ContentLockExclusive -> Annex ()
-removeAnnex (ContentLockExclusive key) = withObjectLoc key remove removedirect
+removeAnnex :: ContentRemovalLock -> Annex ()
+removeAnnex (ContentRemovalLock key) = withObjectLoc key remove removedirect
where
remove file = cleanObjectLoc key $ do
secureErase file