Commit c8988c682e5eb92c15cee0aa628517b6e3fdfc13

Stefan Sperling 2018-03-09T21:43:05

file index entries are variable in size; use a tailq

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/lib/got_file_index_priv.h b/lib/got_file_index_priv.h
index b0d1cc7..84aa5d3 100644
--- a/lib/got_file_index_priv.h
+++ b/lib/got_file_index_priv.h
@@ -22,6 +22,7 @@
  * applied back to the filesystem.
  */
 struct got_file_index_entry {
+	TAILQ_ENTRY(, got_file_index_entry) entry;
 	uint64_t ctime_sec;
 	uint64_t ctime_nsec;
 	uint64_t mtime_sec;
@@ -64,6 +65,6 @@ struct got_file_index_hdr {
 	uint32_t signature;	/* big-endian on disk */
 	uint32_t version;	/* big-endian on disk */
 	uint32_t nentries;	/* big-endian on disk */
-	struct got_file_index_entry *entries; /* big-endian on disk */
+	TAILQ_HEAD(, got_file_index_entry) entries;
 	uint8_t sha1[SHA1_DIGEST_LENGTH]; /* checksum of above on-disk data */
 };