summaryrefslogtreecommitdiffstats
path: root/src/server/helper.h
diff options
context:
space:
mode:
authorsr2013-07-11 19:43:24 +0200
committersr2013-07-11 19:43:24 +0200
commitf10e60d3c16252cd448cc394ee2eb324e8a45572 (patch)
tree2d5ba7fcd0b38daf4cbd31251ee94b76d4430414 /src/server/helper.h
parentRewrite in progres.... (diff)
downloaddnbd3-f10e60d3c16252cd448cc394ee2eb324e8a45572.tar.gz
dnbd3-f10e60d3c16252cd448cc394ee2eb324e8a45572.tar.xz
dnbd3-f10e60d3c16252cd448cc394ee2eb324e8a45572.zip
Rewrite still in progres....
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