summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2010-06-29 21:45:15 +1200
committerLars Wirzenius <liw@liw.fi>2010-06-29 21:45:15 +1200
commitf2534b6b472644034a1b6d641b44bed5c7df1d34 (patch)
treee6a1ac4c34c05aea33c4789cdfb2bd40bcb66876
parent6783ff0d6c8aaea7cfcd74542b6a4ce7313f19fd (diff)
downloadobnam-f2534b6b472644034a1b6d641b44bed5c7df1d34.tar.gz
Simplify chunk directory hierarchy.
Modern filesystems can handle large numbers of files in a directory, as long as things don't get excessive, and having many small dirs is wasteful of disk space.
-rw-r--r--obnamlib/store.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/obnamlib/store.py b/obnamlib/store.py
index 9040fb80..13f68d68 100644
--- a/obnamlib/store.py
+++ b/obnamlib/store.py
@@ -839,9 +839,8 @@ class Store(object):
def _chunk_filename(self, chunkid):
basename = '%06d' % chunkid
- subdir_1 = basename[-6:-3]
- subdir_2 = basename[-3:]
- return os.path.join('chunks', subdir_1, subdir_2, basename)
+ subdir = '%d' % (chunkid / 10000)
+ return os.path.join('chunks', subdir, basename)
@require_started_generation
def put_chunk(self, data, checksum):