]> wimlib.net Git - wimlib/blobdiff - include/wimlib/inode.h
Save memory by consolidating inode flags
[wimlib] / include / wimlib / inode.h
index 777a05b5440501e66a247bc99bef57d10e9ee835..f9b97cf858d0054f00ec5f7d4f395c297ce28a8b 100644 (file)
@@ -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_dentry;
 
        /* 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
@@ -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_dentry, d_alias)
 
 /* 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_dentry.first, struct wim_dentry, d_alias)
 
 /* Return the full path of an alias of the specified inode, or NULL if a full
  * path could not be determined.  */