- size_t pos;
-
- /* File that can be hardlinked--- search the table for an
- * existing inode matching the inode number and device. */
- pos = hash_u64(hash_u64(ino) + hash_u64(devno)) % table->capacity;
- hlist_for_each_entry(inode, &table->array[pos], i_hlist_node) {
- if (inode->i_ino == ino && inode->i_devno == devno) {
- /* Found; use the existing inode. */
- return new_dentry_with_existing_inode(name, inode,
- dentry_ret);
+ /* Hard link detection */
+ list = &table->array[hash_u64(hash_u64(ino) + hash_u64(devno))
+ % table->capacity];
+ hlist_for_each_entry(inode, list, i_hlist_node) {
+ if (inode->i_ino != ino || inode->i_devno != devno)
+ continue;
+ if (inode->i_attributes & FILE_ATTRIBUTE_DIRECTORY) {
+ WARNING("Not honoring directory hard link "
+ "of \"%"TS"\"",
+ inode_any_full_path(inode));
+ continue;