* 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
* ^ ^
wimlib_assert(inode->i_nlink == inode_link_count(inode));
+ if (inode->i_nlink > 1 &&
+ (inode->i_attributes & FILE_ATTRIBUTE_DIRECTORY))
+ {
+ ERROR("Found unsupported directory hard link!");
+ return WIMLIB_ERR_INVALID_DENTRY;
+ }
+
LIST_HEAD(dentries_with_data_streams);
LIST_HEAD(dentries_with_no_data_streams);
HLIST_HEAD(true_inodes);
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)
{