static int afs_linux_dentry_revalidate(struct dentry *dp)
#endif
{
- /* Force revalidation as this may be a different client than the
- one which caused an entry to get cached */
+ int code;
+ cred_t *credp;
+ struct vrequest treq;
+ struct inode *ip = (struct inode *)dp->d_inode;
+
+ unsigned long timeout = 3*HZ; /* 3 seconds */
+
+ if (!(flags & LOOKUP_CONTINUE)) {
+ long diff = CURRENT_TIME - dp->d_parent->d_inode->i_mtime;
+
+ if (diff < 15*60)
+ timeout = 0;
+ }
+
+ if (time_after(jiffies, dp->d_time + timeout))
+ goto out_bad;
+
+ out_valid:
+ return 1;
+
+ out_bad:
return 0;
}
#endif
dp->d_op = afs_dops;
- /* This DV is probably wrong, unfortunately, Perhaps we should
- VerifyVCache the directory */
- dp->d_time=hgetlo(((struct vcache *)dip)->m.DataVersion);
+ dp->d_time = jiffies;
d_instantiate(dp, ip);
}
ip->i_op = &afs_symlink_iops;
#endif
}
- /* directory ought to be stat'd here.... */
- dp->d_time=hgetlo(((struct vcache *)dip)->m.DataVersion);
+ dp->d_time = jiffies;
dp->d_op = afs_dops;
d_add(dp, (struct inode*)vcp);
if (!code) {
d_delete(dp);
if (putback) {
- /* This DV is probably wrong, unfortunately, Perhaps we should
- VerifyVCache the directory */
- dp->d_time=hgetlo(((struct vcache *)dip)->m.DataVersion);
+ dp->d_time = jiffies;
d_add(dp, NULL); /* means definitely does _not_ exist */
}
}
tvcp->v.v_fop = &afs_dir_fops;
#endif
dp->d_op = afs_dops;
- /* This DV is probably wrong, unfortunately, Perhaps we should
- VerifyVCache the directory */
- dp->d_time=hgetlo(((struct vcache *)dip)->m.DataVersion);
+ dp->d_time = jiffies;
d_instantiate(dp, (struct inode*)tvcp);
}
AFS_GUNLOCK();
if (!code) {
/* update time so it doesn't expire immediately */
- /* This DV is probably wrong, unfortunately, Perhaps we should
- VerifyVCache the directory */
- newdp->d_time=hgetlo(((struct vcache *)newdp->d_parent->d_inode)->m.DataVersion);
+ newdp->d_time = jiffies;
d_move(olddp, newdp);
}