aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Slaven <bpk@hoopajoo.net>2009-07-23 22:15:20 (GMT)
committerSteve Slaven <bpk@hoopajoo.net>2009-07-23 22:15:20 (GMT)
commitd7fd21411e7c2168cef2195c613133a71342127e (patch)
tree26b06dfdf2442c39fd83872e2f7359cfb1ee4ba1
parent1b498440e392288ba72190992824fd3ae5d6310f (diff)
downloadfusearchive-d7fd21411e7c2168cef2195c613133a71342127e.zip
fusearchive-d7fd21411e7c2168cef2195c613133a71342127e.tar.gz
fusearchive-d7fd21411e7c2168cef2195c613133a71342127e.tar.bz2
Don't reload a chunk if it's the same chunk we're looking at
-rwxr-xr-xfusearchive.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/fusearchive.py b/fusearchive.py
index 316ff21..2d1f390 100755
--- a/fusearchive.py
+++ b/fusearchive.py
@@ -278,7 +278,7 @@ class FuseArchive(Fuse):
self.modified = False
# This is the current in-memory chunk and offset in to data[]
- self.chunk = None
+ self.chunk = ''
self.chunk_index = 0
self.chunk_modified = False
self.chunk_size = magic_blocksize
@@ -327,6 +327,12 @@ class FuseArchive(Fuse):
dmsg( 3, str(self) + " init complete" )
def _load_chunk( self, index ):
+ # If the current chunk is the same as the chunk we're loading
+ # just return
+ if index == self.chunk_index:
+ dmsg( 3, "Load chunk is same as current chunk, all done" )
+ return
+
# Save this chunk if modified
self._save_chunk()