public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fs/inode.c list_del_init
@ 2002-06-05  4:06 Brian Gerst
  0 siblings, 0 replies; only message in thread
From: Brian Gerst @ 2002-06-05  4:06 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Linux-Kernel

[-- Attachment #1: Type: text/plain, Size: 111 bytes --]

A few cases of list_del(x) + INIT_LIST_HEAD(x) crept in recently which 
can be replaced with list_del_init(x).

[-- Attachment #2: inode-list-1 --]
[-- Type: text/plain, Size: 974 bytes --]

diff -urN linux-bk/fs/inode.c linux/fs/inode.c
--- linux-bk/fs/inode.c	Tue Jun  4 23:54:33 2002
+++ linux/fs/inode.c	Tue Jun  4 23:57:37 2002
@@ -390,8 +390,7 @@
 		if (atomic_read(&inode->i_count))
 			continue;
 		list_del(tmp);
-		list_del(&inode->i_hash);
-		INIT_LIST_HEAD(&inode->i_hash);
+		list_del_init(&inode->i_hash);
 		list_add(tmp, freeable);
 		inode->i_state |= I_FREEING;
 		count++;
@@ -777,8 +776,7 @@
 void remove_inode_hash(struct inode *inode)
 {
 	spin_lock(&inode_lock);
-	list_del(&inode->i_hash);
-	INIT_LIST_HEAD(&inode->i_hash);
+	list_del_init(&inode->i_hash);
 	spin_unlock(&inode_lock);
 }
 
@@ -786,10 +784,8 @@
 {
 	struct super_operations *op = inode->i_sb->s_op;
 
-	list_del(&inode->i_hash);
-	INIT_LIST_HEAD(&inode->i_hash);
-	list_del(&inode->i_list);
-	INIT_LIST_HEAD(&inode->i_list);
+	list_del_init(&inode->i_hash);
+	list_del_init(&inode->i_list);
 	inode->i_state|=I_FREEING;
 	inodes_stat.nr_inodes--;
 	spin_unlock(&inode_lock);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-06-05  4:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-06-05  4:06 [PATCH] fs/inode.c list_del_init Brian Gerst

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox