浏览代码

give known chunk size to chunk_incref, fixes #2853

chunk_incref was called when dealing with part files without giving the
known chunk size in the size_ parameter.

adjusted LocalCache.chunk_incref to have same signature.
Thomas Waldmann 8 年之前
父节点
当前提交
186123cb68
共有 2 个文件被更改,包括 2 次插入2 次删除
  1. 1 1
      src/borg/archive.py
  2. 1 1
      src/borg/cache.py

+ 1 - 1
src/borg/archive.py

@@ -936,7 +936,7 @@ Utilization of max. archive size: {csize_max:.0%}
                 # if we created part files, we have referenced all chunks from the part files,
                 # but we also will reference the same chunks also from the final, complete file:
                 for chunk in item.chunks:
-                    cache.chunk_incref(chunk.id, stats)
+                    cache.chunk_incref(chunk.id, stats, size_=chunk.size)
 
     def process_stdin(self, path, cache):
         uid, gid = 0, 0

+ 1 - 1
src/borg/cache.py

@@ -877,7 +877,7 @@ class LocalCache(CacheStatsMixin):
                             id, stored_size, size))
         return refcount
 
-    def chunk_incref(self, id, stats):
+    def chunk_incref(self, id, stats, size_=None):
         if not self.txn_active:
             self.begin_txn()
         count, size, csize = self.chunks.incref(id)