commit 144b179f6b08a913d12290dc05606eee21e757de
parent 893e7bbe929d2b1aa1f711eeedec9f1e022a651f
Author: sin <sin@2f30.org>
Date: Mon, 25 Feb 2019 14:05:15 +0000
Merge types.h with dedup.h
Diffstat:
M | Makefile | | | 1 | - |
M | dedup.h | | | 46 | +++++++++++++++++++++++++++++++++++++++++++++- |
D | types.h | | | 44 | -------------------------------------------- |
3 files changed, 45 insertions(+), 46 deletions(-)
diff --git a/Makefile b/Makefile
@@ -14,7 +14,6 @@ DISTFILES = \
$(BIN).1 \
dedup.h \
tree.h \
- types.h \
CFLAGS = -g -Wall
CPPFLAGS = -I/usr/local/include -D_FILE_OFFSET_BITS=64
diff --git a/dedup.h b/dedup.h
@@ -1,9 +1,53 @@
#include "config.h"
-#include "types.h"
+
+#define MSGSIZE 256
+#define MDSIZE 32
+
+/* snashot file format version */
+#define VER_MIN 1
+#define VER_MAJ 0
struct cache;
struct chunker;
+struct stats {
+ uint64_t orig_size;
+ uint64_t comp_size;
+ uint64_t dedup_size;
+ uint64_t min_blk_size;
+ uint64_t max_blk_size;
+ uint64_t nr_blks;
+ uint64_t reserved[6];
+};
+
+struct snapshot_hdr {
+ uint64_t flags;
+ uint64_t nr_snapshots;
+ uint64_t store_size;
+ uint64_t reserved[4];
+ struct stats st;
+};
+
+struct blk_desc {
+ uint8_t md[MDSIZE];
+ uint64_t offset;
+ uint64_t size;
+};
+
+struct snapshot {
+ uint64_t size;
+ uint8_t msg[MSGSIZE];
+ uint8_t md[MDSIZE]; /* hash of snapshot */
+ uint64_t nr_blk_descs;
+ struct blk_desc blk_desc[];
+};
+
+struct cache_entry {
+ uint8_t md[MDSIZE];
+ uint64_t offset;
+ uint64_t size;
+};
+
/* cache.c */
void add_cache_entry(struct cache *cache, struct cache_entry *ent);
int lookup_cache_entry(struct cache *cache, struct cache_entry *ent);
diff --git a/types.h b/types.h
@@ -1,44 +0,0 @@
-#define MSGSIZE 256
-#define MDSIZE 32
-
-/* snashot file format version */
-#define VER_MIN 1
-#define VER_MAJ 0
-
-struct stats {
- uint64_t orig_size;
- uint64_t comp_size;
- uint64_t dedup_size;
- uint64_t min_blk_size;
- uint64_t max_blk_size;
- uint64_t nr_blks;
- uint64_t reserved[6];
-};
-
-struct snapshot_hdr {
- uint64_t flags;
- uint64_t nr_snapshots;
- uint64_t store_size;
- uint64_t reserved[4];
- struct stats st;
-};
-
-struct blk_desc {
- uint8_t md[MDSIZE];
- uint64_t offset;
- uint64_t size;
-};
-
-struct snapshot {
- uint64_t size;
- uint8_t msg[MSGSIZE];
- uint8_t md[MDSIZE]; /* hash of snapshot */
- uint64_t nr_blk_descs;
- struct blk_desc blk_desc[];
-};
-
-struct cache_entry {
- uint8_t md[MDSIZE];
- uint64_t offset;
- uint64_t size;
-};