patch-2.4.0-test6 linux/fs/dcache.c

Next file: linux/fs/devices.c
Previous file: linux/fs/cramfs/inode.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test5/linux/fs/dcache.c linux/fs/dcache.c
@@ -14,6 +14,7 @@
  * the dcache entry is deleted or garbage collected.
  */
 
+#include <linux/config.h>
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/fs.h>
@@ -80,8 +81,7 @@
 	struct inode *inode = dentry->d_inode;
 	if (inode) {
 		dentry->d_inode = NULL;
-		list_del(&dentry->d_alias);
-		INIT_LIST_HEAD(&dentry->d_alias);
+		list_del_init(&dentry->d_alias);
 		spin_unlock(&dcache_lock);
 		if (dentry->d_op && dentry->d_op->d_iput)
 			dentry->d_op->d_iput(dentry, inode);
@@ -152,7 +152,7 @@
 	return;
 
 unhash_it:
-	list_del(&dentry->d_hash);
+	list_del_init(&dentry->d_hash);
 
 kill_it: {
 		struct dentry *parent;
@@ -217,8 +217,7 @@
 		}
 	}
 
-	list_del(&dentry->d_hash);
-	INIT_LIST_HEAD(&dentry->d_hash);
+	list_del_init(&dentry->d_hash);
 	spin_unlock(&dcache_lock);
 	return 0;
 }
@@ -306,7 +305,7 @@
 {
 	struct dentry * parent;
 
-	list_del(&dentry->d_hash);
+	list_del_init(&dentry->d_hash);
 	list_del(&dentry->d_child);
 	dentry_iput(dentry);
 	parent = dentry->d_parent;
@@ -341,8 +340,7 @@
 		if (tmp == &dentry_unused)
 			break;
 		dentry_stat.nr_unused--;
-		list_del(tmp);
-		INIT_LIST_HEAD(tmp);
+		list_del_init(tmp);
 		dentry = list_entry(tmp, struct dentry, d_lru);
 
 		/* Unused dentry with a count? */

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)