diff --git a/.gitignore b/.gitignore index 028febb19..13717d20a 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ src/borg/compress.c src/borg/crypto/low_level.c src/borg/item.c src/borg/chunkers/buzhash.c +src/borg/chunkers/buzhash64.c src/borg/chunkers/reader.c src/borg/checksums.c src/borg/platform/darwin.c diff --git a/scripts/make.py b/scripts/make.py index 05b4072de..0a64493ca 100644 --- a/scripts/make.py +++ b/scripts/make.py @@ -543,6 +543,7 @@ cython_sources = """ src/borg/compress.pyx src/borg/crypto/low_level.pyx src/borg/chunkers/buzhash.pyx +src/borg/chunkers/buzhash64.pyx src/borg/chunkers/reader.pyx src/borg/hashindex.pyx src/borg/item.pyx diff --git a/setup.py b/setup.py index 19f403583..859d34690 100644 --- a/setup.py +++ b/setup.py @@ -51,6 +51,7 @@ cflags = ["-Wall", "-Wextra", "-Wpointer-arith", "-Wno-unreachable-code-fallthro compress_source = "src/borg/compress.pyx" crypto_ll_source = "src/borg/crypto/low_level.pyx" buzhash_source = "src/borg/chunkers/buzhash.pyx" +buzhash64_source = "src/borg/chunkers/buzhash64.pyx" reader_source = "src/borg/chunkers/reader.pyx" hashindex_source = "src/borg/hashindex.pyx" item_source = "src/borg/item.pyx" @@ -66,6 +67,7 @@ cython_sources = [ compress_source, crypto_ll_source, buzhash_source, + buzhash64_source, reader_source, hashindex_source, item_source, @@ -185,6 +187,7 @@ if not on_rtd: Extension("borg.hashindex", [hashindex_source], extra_compile_args=cflags), Extension("borg.item", [item_source], extra_compile_args=cflags), Extension("borg.chunkers.buzhash", [buzhash_source], extra_compile_args=cflags, undef_macros=["NDEBUG"]), + Extension("borg.chunkers.buzhash64", [buzhash64_source], extra_compile_args=cflags, undef_macros=["NDEBUG"]), Extension("borg.chunkers.reader", [reader_source], extra_compile_args=cflags, undef_macros=["NDEBUG"]), Extension("borg.checksums", **checksums_ext_kwargs), ] diff --git a/src/borg/chunkers/__init__.py b/src/borg/chunkers/__init__.py index 7f7833b8c..5f3ded4fc 100644 --- a/src/borg/chunkers/__init__.py +++ b/src/borg/chunkers/__init__.py @@ -1,4 +1,5 @@ from .buzhash import Chunker +from .buzhash64 import ChunkerBuzHash64 from .failing import ChunkerFailing from .fixed import ChunkerFixed from .reader import * # noqa @@ -11,6 +12,10 @@ def get_chunker(algo, *params, **kw): seed = kw["seed"] sparse = kw["sparse"] return Chunker(seed, *params, sparse=sparse) + if algo == "buzhash64": + seed = kw["seed"] + sparse = kw["sparse"] + return ChunkerBuzHash64(seed, *params, sparse=sparse) if algo == "fixed": sparse = kw["sparse"] return ChunkerFixed(*params, sparse=sparse)