patch-2.1.80 linux/fs/inode.c

Next file: linux/fs/nfs/dir.c
Previous file: linux/fs/filesystems.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.79/linux/fs/inode.c linux/fs/inode.c
@@ -127,6 +127,7 @@
 	memset(inode, 0, sizeof(*inode));
 	init_waitqueue(&inode->i_wait);
 	INIT_LIST_HEAD(&inode->i_hash);
+	INIT_LIST_HEAD(&inode->i_dentry);
 	sema_init(&inode->i_sem, 1);
 }
 
@@ -647,7 +648,17 @@
 void insert_inode_hash(struct inode *inode)
 {
 	struct list_head *head = inode_hashtable + hash(inode->i_sb, inode->i_ino);
+	spin_lock(&inode_lock);
 	list_add(&inode->i_hash, head);
+	spin_unlock(&inode_lock);
+}
+
+void remove_inode_hash(struct inode *inode)
+{
+	spin_lock(&inode_lock);
+	list_del(&inode->i_hash);
+	INIT_LIST_HEAD(&inode->i_hash);
+	spin_unlock(&inode_lock);
 }
 
 void iput(struct inode *inode)
@@ -688,6 +699,9 @@
 				list_add(&inode->i_list, inode_in_use.prev);
 			}
 #ifdef INODE_PARANOIA
+if (!list_empty(&inode->i_dentry))
+printk("iput: device %s inode %ld still has aliases!\n",
+kdevname(inode->i_dev), inode->i_ino);
 if (inode->i_count)
 printk("iput: device %s inode %ld count changed, count=%d\n",
 kdevname(inode->i_dev), inode->i_ino, inode->i_count);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov