]> wimlib.net Git - wimlib/blobdiff - src/lookup_table.h
Various minor changes and fixes.
[wimlib] / src / lookup_table.h
index b294d4fc5f71aaa4908949406630145d16ef2c33..6deb86fc531f7a74842b6adf6c1ca4e3a03c6798 100644 (file)
@@ -35,8 +35,17 @@ struct lookup_table_entry {
        /* Number of times this lookup table entry is referenced by dentries. */
        u32 refcnt;
 
-       /* SHA1 hash of the file resource pointed to by this lookup table entry */
-       u8  hash[WIM_HASH_SIZE];
+       union {
+               /* SHA1 hash of the file resource pointed to by this lookup
+                * table entry */
+               u8  hash[WIM_HASH_SIZE];
+
+               /* First 4 or 8 bytes of the SHA1 hash, used for inserting the
+                * entry into the hash table.  Since the SHA1 hashes can be
+                * considered random, we don't really need the full 20 byte hash
+                * just to insert the entry in a hash table. */
+               size_t hash_short;
+       };
 
        /* If @file_on_disk != NULL, the file resource indicated by this lookup
         * table entry is not in the WIM file, but rather a file on disk; this
@@ -47,6 +56,7 @@ struct lookup_table_entry {
        union {
                char *file_on_disk;
                char *staging_file_name;
+               struct lookup_table_entry *next_lte_in_swm;
        };
 
        union {
@@ -89,7 +99,10 @@ struct lookup_table_entry {
         *
         * output_resource_entry is the struct resource_entry for the position of the
         * file resource when written to the output file. */
-       u32 out_refcnt;
+       union {
+               u32 out_refcnt;
+               bool refcnt_is_incremented;
+       };
        struct resource_entry output_resource_entry;
 };
 
@@ -155,8 +168,8 @@ static inline void lookup_table_remove(struct lookup_table *table,
 
 static inline struct resource_entry* wim_metadata_resource_entry(WIMStruct *w)
 {
-       return &w->image_metadata[w->current_image - 1].
-                       lookup_table_entry->resource_entry;
+       return &w->image_metadata[
+                       w->current_image - 1].metadata_lte->resource_entry;
 }
 
 #endif