aboutsummaryrefslogtreecommitdiffstats
path: root/FuseArchive/ChunkFile.py
diff options
context:
space:
mode:
authorSteve Slaven <bpk@hoopajoo.net>2009-08-07 17:02:55 (GMT)
committerSteve Slaven <bpk@hoopajoo.net>2009-08-07 17:02:55 (GMT)
commit13865ca284e1c05069ae9e37cbd9e35a95e3e22a (patch)
tree7bbafe8cf32d3369b6301f0d1b3ddabf21cd9dbc /FuseArchive/ChunkFile.py
parenta6fd32baae39a6171ea1d170ba597d667cf357e6 (diff)
downloadfusearchive-13865ca284e1c05069ae9e37cbd9e35a95e3e22a.zip
fusearchive-13865ca284e1c05069ae9e37cbd9e35a95e3e22a.tar.gz
fusearchive-13865ca284e1c05069ae9e37cbd9e35a95e3e22a.tar.bz2
Added a method to free blocks before unlink, just doing ftruncate then
unlink left the "empty" file and "empty" block with an extra ref for every unlink since we never freed those blocks
Diffstat (limited to 'FuseArchive/ChunkFile.py')
-rw-r--r--FuseArchive/ChunkFile.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/FuseArchive/ChunkFile.py b/FuseArchive/ChunkFile.py
index 7cc8e07..e19a9fb 100644
--- a/FuseArchive/ChunkFile.py
+++ b/FuseArchive/ChunkFile.py
@@ -476,6 +476,13 @@ class ChunkFile(object):
logging.debug( "_fflush exit" )
return 1
+ def pre_unlink(self):
+ # Release all our blocks and our main file key
+ logging.debug( "Unlocking all our chunks for unlink" )
+ for key in self.chunks:
+ unlock_chunk( key )
+
+ unlock_chunk( self.original_key )
# Currently we treat fsync as flush since we don't keep any data
# hanging around anyway in fh stuff