[OpenAFS-devel] afs_dentry_iput patch (linux)

Chas Williams chas@cmf.nrl.navy.mil
Wed, 24 Jan 2001 14:07:06 -0500


the code in afs_dentry_iput() looks very similar to osi_iput()
expect for checking to see if the inode is an 'afs' inode.  
i suspect afs_dentry_iput() would never be called w/ a non-afs
inode, anyway.

so i suggest the following:

Index: osi_vnodeops.c
===================================================================
RCS file: /afs/cmf/project/cvsroot/openafs/src/afs/LINUX/osi_vnodeops.c,v
retrieving revision 1.1.1.3
retrieving revision 1.10
diff -u -r1.1.1.3 -r1.10
--- osi_vnodeops.c	2001/01/23 21:24:09	1.1.1.3
+++ osi_vnodeops.c	2001/01/24 18:56:41	1.10
@@ -709,27 +708,7 @@
 /* afs_dentry_iput */
 static void afs_dentry_iput(struct dentry *dp, struct inode *ip)
 {
-#if defined(AFS_LINUX24_ENV)
-    if (atomic_read(&ip->i_count) == 0 || atomic_read(&ip->i_count) & 0xffff0000) {
-#else
-    if (ip->i_count == 0 || ip->i_count & 0xffff0000) {
-#endif
-	osi_Panic("Bad refCount %d on inode 0x%x\n",
-#if defined(AFS_LINUX24_ENV)
-		  atomic_read(&ip->i_count), ip);
-#else
-		  ip->i_count, ip);
-#endif
-    }
-#if defined(AFS_LINUX24_ENV)
-    atomic_dec(&ip->i_count);
-    if (!atomic_read(&ip->i_count)) {
-#else
-    ip->i_count --;
-    if (!ip->i_count) {
-#endif
-	afs_delete_inode(ip);
-    }
+    osi_iput(ip);
 }
 
 #if defined(AFS_LINUX24_ENV)