]> wimlib.net Git - wimlib/blobdiff - src/inode_fixup.c
Remove unnecessary argument to hlist iteration macros
[wimlib] / src / inode_fixup.c
index 115779a410564c1e0c6bbeb937af907802313e76..5e8a58afaa8cf75e4736bf86112998807adec8c8 100644 (file)
@@ -5,20 +5,18 @@
 /*
  * 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
@@ -29,7 +27,6 @@
 #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;
@@ -56,8 +53,8 @@ inodes_consistent(const struct wim_inode *inode_1,
         * 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
@@ -68,7 +65,6 @@ inode_table_insert(struct wim_dentry *dentry, void *_params)
        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);
@@ -77,7 +73,7 @@ inode_table_insert(struct wim_dentry *dentry, void *_params)
 
        /* 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;
                }
@@ -105,10 +101,8 @@ inode_table_insert(struct wim_dentry *dentry, void *_params)
                        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;
        }