]> wimlib.net Git - wimlib/blobdiff - src/hardlink.c
Refactor headers
[wimlib] / src / hardlink.c
index 388d125a6e099a8438f751ab5a1399ccd2b36a45..7c82f4bae09487aae4638c58ce9e738d999db610 100644 (file)
  * along with wimlib; if not, see http://www.gnu.org/licenses/.
  */
 
-#include "wimlib_internal.h"
-#include "dentry.h"
-#include "list.h"
-#include "lookup_table.h"
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#include "wimlib/capture.h"
+#include "wimlib/dentry.h"
+#include "wimlib/error.h"
+#include "wimlib/lookup_table.h"
 
 /*                             NULL        NULL
  *                              ^           ^
@@ -545,7 +549,13 @@ inode_table_prepare_inode_list(struct wim_inode_table *table,
        struct hlist_node *cur, *tmp;
        u64 cur_ino = 1;
 
-       INIT_LIST_HEAD(head);
+       list_for_each_entry(inode, head, i_list) {
+               if (inode->i_nlink > 1)
+                       inode->i_ino = cur_ino++;
+               else
+                       inode->i_ino = 0;
+       }
+
        for (size_t i = 0; i < table->capacity; i++) {
                hlist_for_each_entry_safe(inode, cur, tmp, &table->array[i], i_hlist)
                {