]> wimlib.net Git - wimlib/blobdiff - include/wimlib/inode.h
Rename i_dentry => i_alias_list and d_alias => d_alias_node
[wimlib] / include / wimlib / inode.h
index 3fbb4039d658af19289762946dd16cd127f7bf60..01254c82d1ccd9a7f9453ba7c345727e934ddc34 100644 (file)
@@ -70,7 +70,7 @@ struct wim_inode_stream {
        union {
                u8 _stream_hash[SHA1_HASH_SIZE];
                struct blob_descriptor *_stream_blob;
-       };
+       } _packed_attribute; /* union is SHA1_HASH_SIZE bytes */
 
        /* 'stream_resolved' determines whether 'stream_hash' or 'stream_blob'
         * is valid as described above.  */
@@ -119,7 +119,7 @@ struct wim_inode {
 
        /* List of dentries that are aliases for this inode.  There will be
         * i_nlink dentries in this list.  */
-       struct list_head i_dentry;
+       struct hlist_head i_alias_list;
 
        /* Field to place this inode into a list.  While reading a WIM image or
         * adding files to a WIM image this is owned by the inode table;
@@ -127,16 +127,16 @@ struct wim_inode {
        struct hlist_node i_hlist;
 
        /* Number of dentries that are aliases for this inode.  */
-       u32 i_nlink;
+       u32 i_nlink : 30;
 
        /* Flag used to mark this inode as visited; this is used when visiting
         * all the inodes in a dentry tree exactly once.  It will be 0 by
         * default and must be cleared following the tree traversal, even in
         * error paths.  */
-       u8 i_visited : 1;
+       u32 i_visited : 1;
 
        /* Cached value  */
-       u8 i_can_externally_back : 1;
+       u32 i_can_externally_back : 1;
 
        /* If not NULL, a pointer to the extra data that was read from the
         * dentry.  This should be a series of tagged items, each of which
@@ -180,19 +180,19 @@ struct wim_inode {
                /* Device number, used only during image capture, so we can
                 * identify hard linked files by the combination of inode number
                 * and device number (rather than just inode number, which could
-                * be ambigious if the captured tree spans a mountpoint).  Set
+                * be ambiguous if the captured tree spans a mountpoint).  Set
                 * to 0 otherwise.  */
                u64 i_devno;
 
                /* Fields used only during extraction  */
                struct {
-                       /* List of aliases of this dentry that are being
-                        * extracted in the current extraction operation.  This
-                        * will be a (possibly nonproper) subset of the dentries
-                        * in the i_dentry list.  This list will be constructed
+                       /* A singly linked list of aliases of this inode that
+                        * are being extracted in the current extraction
+                        * operation.  This list may be shorter than the inode's
+                        * full alias list.  This list will be constructed
                         * regardless of whether the extraction backend supports
                         * hard links or not.  */
-                       struct list_head i_extraction_aliases;
+                       struct wim_dentry *i_first_extraction_alias;
 
                #ifdef WITH_NTFS_3G
                        /* In NTFS-3g extraction mode, this is set to the Master
@@ -206,7 +206,7 @@ struct wim_inode {
                 * WIMLIB_WRITE_FLAG_SEND_DONE_WITH_FILE_MESSAGES:  the number
                 * of streams this inode has that have not yet been fully read.
                 * */
-               u32 num_remaining_streams;
+               u32 i_num_remaining_streams;
 
 #ifdef WITH_FUSE
                struct {
@@ -268,11 +268,11 @@ new_inode(struct wim_dentry *dentry, bool set_timestamps);
 
 /* Iterate through each alias of the specified inode.  */
 #define inode_for_each_dentry(dentry, inode) \
-       list_for_each_entry((dentry), &(inode)->i_dentry, d_alias)
+       hlist_for_each_entry((dentry), &(inode)->i_alias_list, d_alias_node)
 
 /* Return an alias of the specified inode.  */
 #define inode_first_dentry(inode) \
-       container_of(inode->i_dentry.next, struct wim_dentry, d_alias)
+       hlist_entry(inode->i_alias_list.first, struct wim_dentry, d_alias_node)
 
 /* Return the full path of an alias of the specified inode, or NULL if a full
  * path could not be determined.  */