
From: Christoph Hellwig <hch@lst.de>

->clear_inode is the right place to free private inode parts.  No idea what
I though when using ->put_inode and i_count check.

Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/fs/freevxfs/vxfs_extern.h |    2 +-
 25-akpm/fs/freevxfs/vxfs_inode.c  |   11 +++++------
 25-akpm/fs/freevxfs/vxfs_super.c  |    2 +-
 3 files changed, 7 insertions(+), 8 deletions(-)

diff -puN fs/freevxfs/vxfs_extern.h~stop-put_inode-abuse-in-vxfs fs/freevxfs/vxfs_extern.h
--- 25/fs/freevxfs/vxfs_extern.h~stop-put_inode-abuse-in-vxfs	Wed Sep  1 14:45:35 2004
+++ 25-akpm/fs/freevxfs/vxfs_extern.h	Wed Sep  1 14:45:35 2004
@@ -59,7 +59,7 @@ extern void			vxfs_put_fake_inode(struct
 extern struct vxfs_inode_info *	vxfs_blkiget(struct super_block *, u_long, ino_t);
 extern struct vxfs_inode_info *	vxfs_stiget(struct super_block *, ino_t);
 extern void			vxfs_read_inode(struct inode *);
-extern void			vxfs_put_inode(struct inode *);
+extern void			vxfs_clear_inode(struct inode *);
 
 /* vxfs_lookup.c */
 extern struct inode_operations	vxfs_dir_inode_ops;
diff -puN fs/freevxfs/vxfs_inode.c~stop-put_inode-abuse-in-vxfs fs/freevxfs/vxfs_inode.c
--- 25/fs/freevxfs/vxfs_inode.c~stop-put_inode-abuse-in-vxfs	Wed Sep  1 14:45:35 2004
+++ 25-akpm/fs/freevxfs/vxfs_inode.c	Wed Sep  1 14:45:35 2004
@@ -337,16 +337,15 @@ vxfs_read_inode(struct inode *ip)
 }
 
 /**
- * vxfs_put_inode - remove inode from main memory
+ * vxfs_clear_inode - remove inode from main memory
  * @ip:		inode to discard.
  *
  * Description:
- *  vxfs_put_inode() is called on each iput.  If we are the last
- *  link in memory, free the fspriv inode area.
+ *  vxfs_clear_inode() is called on the final iput and frees the private
+ *  inode area.
  */
 void
-vxfs_put_inode(struct inode *ip)
+vxfs_clear_inode(struct inode *ip)
 {
-	if (atomic_read(&ip->i_count) == 1)
-		kmem_cache_free(vxfs_inode_cachep, ip->u.generic_ip);
+	kmem_cache_free(vxfs_inode_cachep, ip->u.generic_ip);
 }
diff -puN fs/freevxfs/vxfs_super.c~stop-put_inode-abuse-in-vxfs fs/freevxfs/vxfs_super.c
--- 25/fs/freevxfs/vxfs_super.c~stop-put_inode-abuse-in-vxfs	Wed Sep  1 14:45:35 2004
+++ 25-akpm/fs/freevxfs/vxfs_super.c	Wed Sep  1 14:45:35 2004
@@ -60,7 +60,7 @@ static int		vxfs_remount(struct super_bl
 
 static struct super_operations vxfs_super_ops = {
 	.read_inode =		vxfs_read_inode,
-	.put_inode =		vxfs_put_inode,
+	.clear_inode =		vxfs_clear_inode,
 	.put_super =		vxfs_put_super,
 	.statfs =		vxfs_statfs,
 	.remount_fs =		vxfs_remount,
_
