linux-dentry-deletion-for-unlinked-files-22-version-20020721
authorChas Williams <chas@cmf.nrl.navy.mil>
Mon, 22 Jul 2002 04:47:24 +0000 (04:47 +0000)
committerDerrick Brashear <shadow@dementia.org>
Mon, 22 Jul 2002 04:47:24 +0000 (04:47 +0000)
make it work for 2.2 kernels also
also some debugging

src/afs/LINUX/osi_vnodeops.c
src/afs/afs_trace.et
src/afs/afs_vcache.c

index 9bd392f..e18d6b3 100644 (file)
@@ -931,17 +931,23 @@ static int afs_linux_dentry_revalidate(struct dentry *dp)
 /* afs_dentry_iput */
 static void afs_dentry_iput(struct dentry *dp, struct inode *ip)
 {
+    afs_Trace3(afs_iclSetp, CM_TRACE_DENTRYIPUT,
+              ICL_TYPE_POINTER, ip,
+              ICL_TYPE_STRING, dp->d_parent->d_name.name,
+              ICL_TYPE_STRING, dp->d_name.name);
+
     osi_iput(ip);
 }
 
 static int afs_dentry_delete(struct dentry *dp)
 {
-    if (dp->d_inode && (ITOAFS(dp->d_inode)->states & CUnlinked))
-       return 1;               /* bad inode? */
-
     afs_Trace3(afs_iclSetp, CM_TRACE_DENTRYDELETE, ICL_TYPE_POINTER, 
               dp->d_inode, ICL_TYPE_STRING, dp->d_parent->d_name.name,
               ICL_TYPE_STRING, dp->d_name.name);
+
+    if (dp->d_inode && (ITOAFS(dp->d_inode)->states & CUnlinked))
+       return 1;               /* bad inode? */
+
     return 0;
 }
 
@@ -957,7 +963,7 @@ struct dentry_operations afs_dentry_operations = {
        afs_linux_dentry_revalidate,    /* d_validate(struct dentry *) */
        NULL,                   /* d_hash */
        NULL,                   /* d_compare */
-       NULL,                   /* d_delete(struct dentry *) */
+       afs_dentry_delete,      /* d_delete(struct dentry *) */
        NULL,                   /* d_release(struct dentry *) */
        afs_dentry_iput         /* d_iput(struct dentry *, struct inode *) */
 };
index 0d1decf..910f68f 100644 (file)
@@ -157,7 +157,8 @@ error_table 2 ZCM
        ec      CM_TRACE_VNODEREAD, "UFSRead: tdc 0x%x, offset (0x%x, 0x%x) len (0x%x 0x%x)" 
        ec      CM_TRACE_SLEEP, "Sleep: evp 0x%x, count %d seq 0x%x evp->seq 0x%x" 
        ec      CM_TRACE_WAKE, "Wakeup: evp 0x%x, evp->seq 0x%x"
-        ec      CM_TRACE_DENTRYDELETE, "dentry_delete inode 0x%x d_name %s/%s"
-        ec      CM_TRACE_TRYFLUSHDCACHECHILDREN, "TryFlushDcacheChildren tvc 0x%x"
+       ec      CM_TRACE_DENTRYDELETE, "d_delete inode 0x%x d_name %s/%s"
+       ec      CM_TRACE_DENTRYIPUT, "d_iput inode 0x%x d_name %s/%s"
+       ec      CM_TRACE_TRYFLUSHDCACHECHILDREN, "TryFlushDcacheChildren ip 0x%x"
 end
 
index 16bf085..10be5a0 100644 (file)
@@ -482,6 +482,9 @@ static void afs_TryFlushDcacheChildren(struct vcache *tvc)
     struct dentry *dentry;
     
 #if 1
+    afs_Trace1(afs_iclSetp, CM_TRACE_TRYFLUSHDCACHECHILDREN,
+              ICL_TYPE_POINTER, ip);
+
     VN_HOLD(tvc);
     AFS_GUNLOCK();
     d_prune_aliases(ip);