]> wimlib.net Git - wimlib/blobdiff - include/wimlib/metadata.h
Save memory by consolidating inode flags
[wimlib] / include / wimlib / metadata.h
index af35b539c173c28d2962bc6e1a1507394690678d..00647a1cf6e4f5e0bb614dad8ed3a259d628500c 100644 (file)
@@ -5,10 +5,6 @@
 #include "wimlib/types.h"
 #include "wimlib/wim.h"
 
-#ifdef WITH_NTFS_3G
-struct _ntfs_volume;
-#endif
-
 /* Metadata for a WIM image  */
 struct wim_image_metadata {
 
@@ -26,7 +22,7 @@ struct wim_image_metadata {
        struct blob_descriptor *metadata_blob;
 
        /* Linked list of 'struct wim_inode's for this image. */
-       struct list_head inode_list;
+       struct hlist_head inode_list;
 
        /* Linked list of 'struct blob_descriptor's for blobs that are
         * referenced by this image's dentry tree, but have not had their SHA-1
@@ -39,10 +35,6 @@ struct wim_image_metadata {
         * the WIM file.  If this is the case, the memory for the dentry tree
         * should not be freed when switching to a different WIM image. */
        u8 modified : 1;
-
-#ifdef WITH_NTFS_3G
-       struct _ntfs_volume *ntfs_vol;
-#endif
 };
 
 /* Retrieve the metadata of the image in @wim currently selected with
@@ -71,7 +63,11 @@ wim_get_current_security_data(WIMStruct *wim)
 
 /* Iterate over each inode in a WIM image  */
 #define image_for_each_inode(inode, imd) \
-       list_for_each_entry(inode, &(imd)->inode_list, i_list)
+       hlist_for_each_entry(inode, &(imd)->inode_list, i_hlist)
+
+/* Iterate over each inode in a WIM image (safe against inode removal)  */
+#define image_for_each_inode_safe(inode, tmp, imd) \
+       hlist_for_each_entry_safe(inode, tmp, &(imd)->inode_list, i_hlist)
 
 /* Iterate over each blob in a WIM image that has not yet been hashed */
 #define image_for_each_unhashed_blob(blob, imd) \