summaryrefslogtreecommitdiffstats
path: root/src/server/helper.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/helper.h')
-rw-r--r--src/server/helper.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/server/helper.h b/src/server/helper.h
index 1df86e8..f0285a2 100644
--- a/src/server/helper.h
+++ b/src/server/helper.h
@@ -100,4 +100,8 @@ static inline int strend(char *string, char *suffix)
// but you actually need 2 bytes to have a complete cache map
#define IMGSIZE_TO_MAPBYTES(bytes) ((int)(((bytes) + (1 << 15) - 1) >> 15))
+// calculate number of hash blocks in file. One hash block is 16MiB
+#define HASH_BLOCK_SIZE (1 << 24)
+#define IMGSIZE_TO_HASHBLOCKS(bytes) ((int)(((bytes) + HASH_BLOCK_SIZE - 1) / HASH_BLOCK_SIZE))
+
#endif