/*
* Copyright (C) 2012, 2013, 2014 Eric Biggers
*
- * This file is part of wimlib, a library for working with WIM files.
+ * This file is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 3 of the License, or (at your option) any
+ * later version.
*
- * wimlib is free software; you can redistribute it and/or modify it under the
- * terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 3 of the License, or (at your option)
- * any later version.
- *
- * wimlib is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
- * A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * This file is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*
- * You should have received a copy of the GNU General Public License
- * along with wimlib; if not, see http://www.gnu.org/licenses/.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this file; if not, see http://www.gnu.org/licenses/.
*/
#ifdef HAVE_CONFIG_H
#include "wimlib/error.h"
#include "wimlib/inode.h"
#include "wimlib/inode_table.h"
-#include "wimlib/lookup_table.h"
struct inode_fixup_params {
struct wim_inode_table inode_table;
* doesn't link the dentries.)
*
* For non-buggy WIMs this function will always return true. */
- return hashes_equal(inode_unnamed_stream_hash(inode_1),
- inode_unnamed_stream_hash(inode_2));
+ return hashes_equal(inode_get_hash_of_unnamed_data_stream(inode_1),
+ inode_get_hash_of_unnamed_data_stream(inode_2));
}
static int
struct wim_inode *d_inode = dentry->d_inode;
size_t pos;
struct wim_inode *inode;
- struct hlist_node *cur;
if (d_inode->i_ino == 0) {
list_add_tail(&d_inode->i_list, &table->extra_inodes);
/* Try adding this dentry to an existing inode. */
pos = d_inode->i_ino % table->capacity;
- hlist_for_each_entry(inode, cur, &table->array[pos], i_hlist) {
+ hlist_for_each_entry(inode, &table->array[pos], i_hlist) {
if (inode->i_ino != d_inode->i_ino) {
continue;
}
continue;
}
/* Transfer this dentry to the existing inode. */
- free_inode(d_inode);
- dentry->d_inode = inode;
- inode->i_nlink++;
- inode_add_dentry(dentry, inode);
+ d_disassociate(dentry);
+ d_associate(dentry, inode);
return 0;
}