linux-dentry-deletion-for-unlinked-files-22-version-20020721

make it work for 2.2 kernels also
also some debugging
This commit is contained in:
Chas Williams 2002-07-22 04:47:24 +00:00 committed by Derrick Brashear
parent 349c211789
commit 73cdd10a1b
3 changed files with 16 additions and 6 deletions

View File

@ -931,17 +931,23 @@ static int afs_linux_dentry_revalidate(struct dentry *dp)
/* afs_dentry_iput */ /* afs_dentry_iput */
static void afs_dentry_iput(struct dentry *dp, struct inode *ip) 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); osi_iput(ip);
} }
static int afs_dentry_delete(struct dentry *dp) 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, afs_Trace3(afs_iclSetp, CM_TRACE_DENTRYDELETE, ICL_TYPE_POINTER,
dp->d_inode, ICL_TYPE_STRING, dp->d_parent->d_name.name, dp->d_inode, ICL_TYPE_STRING, dp->d_parent->d_name.name,
ICL_TYPE_STRING, dp->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; return 0;
} }
@ -957,7 +963,7 @@ struct dentry_operations afs_dentry_operations = {
afs_linux_dentry_revalidate, /* d_validate(struct dentry *) */ afs_linux_dentry_revalidate, /* d_validate(struct dentry *) */
NULL, /* d_hash */ NULL, /* d_hash */
NULL, /* d_compare */ NULL, /* d_compare */
NULL, /* d_delete(struct dentry *) */ afs_dentry_delete, /* d_delete(struct dentry *) */
NULL, /* d_release(struct dentry *) */ NULL, /* d_release(struct dentry *) */
afs_dentry_iput /* d_iput(struct dentry *, struct inode *) */ afs_dentry_iput /* d_iput(struct dentry *, struct inode *) */
}; };

View 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_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_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_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_DENTRYDELETE, "d_delete inode 0x%x d_name %s/%s"
ec CM_TRACE_TRYFLUSHDCACHECHILDREN, "TryFlushDcacheChildren tvc 0x%x" ec CM_TRACE_DENTRYIPUT, "d_iput inode 0x%x d_name %s/%s"
ec CM_TRACE_TRYFLUSHDCACHECHILDREN, "TryFlushDcacheChildren ip 0x%x"
end end

View File

@ -482,6 +482,9 @@ static void afs_TryFlushDcacheChildren(struct vcache *tvc)
struct dentry *dentry; struct dentry *dentry;
#if 1 #if 1
afs_Trace1(afs_iclSetp, CM_TRACE_TRYFLUSHDCACHECHILDREN,
ICL_TYPE_POINTER, ip);
VN_HOLD(tvc); VN_HOLD(tvc);
AFS_GUNLOCK(); AFS_GUNLOCK();
d_prune_aliases(ip); d_prune_aliases(ip);