]> wimlib.net Git - wimlib/blobdiff - src/lookup_table.h
Specify hard_remove option to fuse_main() when possible
[wimlib] / src / lookup_table.h
index c870a114cd28cb47826e797e1b84d7368e5d6263..05ffbe6ed194ae3751ecf179708d69b36a1621c6 100644 (file)
@@ -185,23 +185,22 @@ struct lookup_table_entry {
                struct resource_entry output_resource_entry;
 
                struct list_head msg_list;
+               struct list_head inode_list;
        };
 
-       union {
-               /* This field is used for the special hardlink or symlink image
-                * extraction mode.   In these mode, all identical files are linked
-                * together, and @extracted_file will be set to the filename of the
-                * first extracted file containing this stream.  */
-               char *extracted_file;
-
-               /* List of lookup table entries that correspond to streams that have
-                * been extracted to the staging directory when modifying a read-write
-                * mounted WIM. */
-               struct list_head staging_list;
-
-               /* Temporary field for creating a singly linked list. */
-               struct lookup_table_entry *next_lte_in_swm;
-       };
+       /* List of lookup table entries that correspond to streams that have
+        * been extracted to the staging directory when modifying a read-write
+        * mounted WIM.
+        *
+        * This field is also used to make other lists of lookup table entries.
+        * */
+       struct list_head staging_list;
+
+       /* This field is used for the special hardlink or symlink image
+        * extraction mode.   In these mode, all identical files are linked
+        * together, and @extracted_file will be set to the filename of the
+        * first extracted file containing this stream.  */
+       char *extracted_file;
 };
 
 static inline u64 wim_resource_size(const struct lookup_table_entry *lte)
@@ -229,7 +228,7 @@ wim_resource_compression_type(const struct lookup_table_entry *lte)
 {
        if (!(lte->resource_entry.flags & WIM_RESHDR_FLAG_COMPRESSED)
            || lte->resource_location != RESOURCE_IN_WIM)
-               return WIM_COMPRESSION_TYPE_NONE;
+               return WIMLIB_COMPRESSION_TYPE_NONE;
        return wimlib_get_compression_type(lte->wim);
 }
 
@@ -285,22 +284,16 @@ extern int write_lookup_table_entry(struct lookup_table_entry *lte, void *__out)
 
 extern void free_lookup_table_entry(struct lookup_table_entry *lte);
 
+extern void inode_resolve_ltes(struct inode *inode,
+                              struct lookup_table *table);
+
 extern int dentry_resolve_ltes(struct dentry *dentry, void *__table);
-extern int dentry_unresolve_ltes(struct dentry *dentry, void *ignore);
 
-/* Writes the lookup table to the output file. */
-static inline int write_lookup_table(struct lookup_table *table, FILE *out)
-{
-       return for_lookup_table_entry(table, write_lookup_table_entry, out);
-}
+extern void inode_unresolve_ltes(struct inode *inode);
+extern int dentry_unresolve_ltes(struct dentry *dentry, void *ignore);
 
-/* Unlinks and frees an entry from a lookup table. */
-static inline void lookup_table_remove(struct lookup_table *table,
-                                      struct lookup_table_entry *lte)
-{
-       lookup_table_unlink(table, lte);
-       free_lookup_table_entry(lte);
-}
+int write_lookup_table(struct lookup_table *table, FILE *out,
+                      struct resource_entry *out_res_entry);
 
 static inline struct resource_entry* wim_metadata_resource_entry(WIMStruct *w)
 {
@@ -334,23 +327,10 @@ inode_stream_lte_unresolved(const struct inode *inode, unsigned stream_idx,
                                         inode->ads_entries[
                                                stream_idx - 1].hash);
 }
-/*
- * Returns the lookup table entry for stream @stream_idx of the inode, where
- * stream_idx = 0 means the default un-named file stream, and stream_idx >= 1
- * corresponds to an alternate data stream.
- *
- * This works for both resolved and un-resolved dentries.
- */
-static inline struct lookup_table_entry *
-inode_stream_lte(const struct inode *inode, unsigned stream_idx,
-                const struct lookup_table *table)
-{
-       if (inode->resolved)
-               return inode_stream_lte_resolved(inode, stream_idx);
-       else
-               return inode_stream_lte_unresolved(inode, stream_idx, table);
-}
 
+extern struct lookup_table_entry *
+inode_stream_lte(const struct inode *inode, unsigned stream_idx,
+                const struct lookup_table *table);
 
 static inline const u8 *inode_stream_hash_unresolved(const struct inode *inode,
                                                     unsigned stream_idx)
@@ -428,5 +408,7 @@ extern struct lookup_table_entry *
 inode_unnamed_lte(const struct inode *inode,
                  const struct lookup_table *table);
 
+extern u64 lookup_table_total_stream_size(struct lookup_table *table);
+
 
 #endif