X-Git-Url: https://git.openafs.org/?p=openafs.git;a=blobdiff_plain;f=src%2Fafs%2Fafs_vcache.c;h=87ec2fc6023cb309375a572678f9f6612395f8bf;hp=63a0431b1b02302ebda4b43cb438c3df99c5da0c;hb=e99bfcfaa3bca3e65f03928718c2c9eb5eff7c8c;hpb=244b82d24c37355bc855361815a7e682d6445af3 diff --git a/src/afs/afs_vcache.c b/src/afs/afs_vcache.c index 63a0431..87ec2fc 100644 --- a/src/afs/afs_vcache.c +++ b/src/afs/afs_vcache.c @@ -85,6 +85,25 @@ static struct afs_slotlist *afs_freeSlotList = NULL; /* Forward declarations */ static afs_int32 afs_QueueVCB(struct vcache *avc, int *slept); + +/* + * The PFlush algorithm makes use of the fact that Fid.Unique is not used in + * below hash algorithms. Change it if need be so that flushing algorithm + * doesn't move things from one hash chain to another. + */ +/* Don't hash on the cell; our callback-breaking code sometimes fails to compute + * the cell correctly, and only scans one hash bucket. */ +int VCHash(struct VenusFid *fid) +{ + return opr_jhash_int2(fid->Fid.Volume, fid->Fid.Vnode, 0) & + opr_jhash_mask(VCSIZEBITS); +} +/* Hash only on volume to speed up volume callbacks. */ +int VCHashV(struct VenusFid *fid) +{ + return opr_jhash_int(fid->Fid.Vnode, 0) & opr_jhash_mask(VCSIZEBITS); +} + /*! * Generate an index into the hash table for a given Fid. * \param fid