summaryrefslogtreecommitdiff
path: root/Command/Drop.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-10-08 14:27:37 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-10-08 14:29:35 -0400
commitbab88f3596c570346a3d069af9e3c8ed92e473c9 (patch)
tree32384db58de249ef11c524446d1e0bf757c5fa10 /Command/Drop.hs
parent5434414bff35367aa62a4aaab0c4731a38dbe76e (diff)
add lockContentShared
Also, rename lockContent to lockContentExclusive inAnnexSafe should perhaps be eliminated, and instead use `lockContentShared inAnnex`. However, I'm waiting on that, as there are only 2 call sites for inAnnexSafe and it's fiddly.
Diffstat (limited to 'Command/Drop.hs')
-rw-r--r--Command/Drop.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/Command/Drop.hs b/Command/Drop.hs
index b23f81758..6bbdb58fd 100644
--- a/Command/Drop.hs
+++ b/Command/Drop.hs
@@ -88,12 +88,12 @@ startRemote afile numcopies key remote = do
showStart' ("drop " ++ Remote.name remote) key afile
next $ performRemote key afile numcopies remote
--- Note that lockContent is called before checking if the key is present
--- on enough remotes to allow removal. This avoids a scenario where two
+-- Note that lockContentExclusive is called before checking if the key is
+-- present on enough remotes to allow removal. This avoids a scenario where two
-- or more remotes are trying to remove a key at the same time, and each
-- see the key is present on the other.
performLocal :: Key -> AssociatedFile -> NumCopies -> Maybe Remote -> CommandPerform
-performLocal key afile numcopies knownpresentremote = lockContent key $ \contentlock -> do
+performLocal key afile numcopies knownpresentremote = lockContentExclusive key $ \contentlock -> do
(remotes, trusteduuids) <- Remote.keyPossibilitiesTrusted key
let trusteduuids' = case knownpresentremote of
Nothing -> trusteduuids