summaryrefslogtreecommitdiff
path: root/Command
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-02-26 16:52:56 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-02-26 16:52:56 -0400
commit8c6099d73c86f8803f08c47fe224cf8398cfd6c2 (patch)
tree7d23c487f323020f4c56a6957c58efe82e839570 /Command
parentb03b8e8cd7977d9a059efe8226b30e90f53be3e6 (diff)
Put non-object tmp files in .git/annex/misctmp, leaving .git/annex/tmp for only partially transferred objects.
This allows eg, putting .git/annex/tmp on a ram disk, if the disk IO of temp object files is too annoying (and if you don't want to keep partially transferred objects across reboots). .git/annex/misctmp must be on the same filesystem as the git work tree, since files are moved to there in a way that will not work cross-device, as well as symlinked into there. I first wanted to put the tmp objects in .git/annex/objects/tmp, but that would pose transition problems on upgrade when partially transferred objects existed. git annex info does not currently show the size of .git/annex/misctemp, since it should stay small. It would also be ok to make something clean it out, periodically.
Diffstat (limited to 'Command')
-rw-r--r--Command/Add.hs2
-rw-r--r--Command/AddUrl.hs4
-rw-r--r--Command/DropUnused.hs2
-rw-r--r--Command/Fsck.hs2
-rw-r--r--Command/Info.hs2
-rw-r--r--Command/Unlock.hs2
-rw-r--r--Command/Unused.hs2
7 files changed, 8 insertions, 8 deletions
diff --git a/Command/Add.hs b/Command/Add.hs
index ea4933748..3361a430a 100644
--- a/Command/Add.hs
+++ b/Command/Add.hs
@@ -96,7 +96,7 @@ lockDown :: FilePath -> Annex (Maybe KeySource)
lockDown file = ifM crippledFileSystem
( liftIO $ catchMaybeIO nohardlink
, do
- tmp <- fromRepo gitAnnexTmpDir
+ tmp <- fromRepo gitAnnexTmpMiscDir
createAnnexDirectory tmp
eitherToMaybe <$> tryAnnexIO (go tmp)
)
diff --git a/Command/AddUrl.hs b/Command/AddUrl.hs
index f45303416..ae56908c1 100644
--- a/Command/AddUrl.hs
+++ b/Command/AddUrl.hs
@@ -114,7 +114,7 @@ addUrlFileQuvi relaxed quviurl videourl file = do
- it later. -}
sizedkey <- addSizeUrlKey videourl key
prepGetViaTmpChecked sizedkey $ do
- tmp <- fromRepo $ gitAnnexTmpLocation key
+ tmp <- fromRepo $ gitAnnexTmpObjectLocation key
showOutput
ok <- Transfer.download webUUID key (Just file) Transfer.forwardRetry $ const $ do
liftIO $ createDirectoryIfMissing True (parentDir tmp)
@@ -162,7 +162,7 @@ download url file = do
- downloads, as the dummy key for a given url is stable. -}
dummykey <- addSizeUrlKey url =<< Backend.URL.fromUrl url Nothing
prepGetViaTmpChecked dummykey $ do
- tmp <- fromRepo $ gitAnnexTmpLocation dummykey
+ tmp <- fromRepo $ gitAnnexTmpObjectLocation dummykey
showOutput
ifM (runtransfer dummykey tmp)
( do
diff --git a/Command/DropUnused.hs b/Command/DropUnused.hs
index a3409ab1b..345d03032 100644
--- a/Command/DropUnused.hs
+++ b/Command/DropUnused.hs
@@ -27,7 +27,7 @@ seek ps = do
withUnusedMaps (start numcopies) ps
start :: NumCopies -> UnusedMaps -> Int -> CommandStart
-start numcopies = startUnused "dropunused" (perform numcopies) (performOther gitAnnexBadLocation) (performOther gitAnnexTmpLocation)
+start numcopies = startUnused "dropunused" (perform numcopies) (performOther gitAnnexBadLocation) (performOther gitAnnexTmpObjectLocation)
perform :: NumCopies -> Key -> CommandPerform
perform numcopies key = maybe droplocal dropremote =<< Remote.byNameWithUUID =<< from
diff --git a/Command/Fsck.hs b/Command/Fsck.hs
index a30e895d0..059f3e91e 100644
--- a/Command/Fsck.hs
+++ b/Command/Fsck.hs
@@ -147,7 +147,7 @@ performRemote key file backend numcopies remote =
]
withtmp a = do
pid <- liftIO getPID
- t <- fromRepo gitAnnexTmpDir
+ t <- fromRepo gitAnnexTmpObjectDir
createAnnexDirectory t
let tmp = t </> "fsck" ++ show pid ++ "." ++ keyFile key
let cleanup = liftIO $ catchIO (removeFile tmp) (const noop)
diff --git a/Command/Info.hs b/Command/Info.hs
index 98cc49efa..f27fdfb1d 100644
--- a/Command/Info.hs
+++ b/Command/Info.hs
@@ -201,7 +201,7 @@ known_annex_size = stat "size of annexed files in working tree" $ json id $
showSizeKeys <$> cachedReferencedData
tmp_size :: Stat
-tmp_size = staleSize "temporary directory size" gitAnnexTmpDir
+tmp_size = staleSize "temporary object directory size" gitAnnexTmpObjectDir
bad_data_size :: Stat
bad_data_size = staleSize "bad keys size" gitAnnexBadDir
diff --git a/Command/Unlock.hs b/Command/Unlock.hs
index 9f2c257fb..4cfe39307 100644
--- a/Command/Unlock.hs
+++ b/Command/Unlock.hs
@@ -36,7 +36,7 @@ perform dest key = do
unlessM (checkDiskSpace Nothing key 0) $ error "cannot unlock"
src <- calcRepo $ gitAnnexLocation key
- tmpdest <- fromRepo $ gitAnnexTmpLocation key
+ tmpdest <- fromRepo $ gitAnnexTmpObjectLocation key
liftIO $ createDirectoryIfMissing True (parentDir tmpdest)
showAction "copying"
ifM (liftIO $ copyFileExternal src tmpdest)
diff --git a/Command/Unused.hs b/Command/Unused.hs
index d48956920..6b4475568 100644
--- a/Command/Unused.hs
+++ b/Command/Unused.hs
@@ -63,7 +63,7 @@ checkUnused :: CommandPerform
checkUnused = chain 0
[ check "" unusedMsg $ findunused =<< Annex.getState Annex.fast
, check "bad" staleBadMsg $ staleKeysPrune gitAnnexBadDir False
- , check "tmp" staleTmpMsg $ staleKeysPrune gitAnnexTmpDir True
+ , check "tmp" staleTmpMsg $ staleKeysPrune gitAnnexTmpObjectDir True
]
where
findunused True = do