From: Andrew Deason Date: Sun, 20 May 2012 22:32:13 +0000 (-0500) Subject: afs: Add xvcache-related afs_FlushVCache comments X-Git-Tag: openafs-stable-1_8_0pre1~429 X-Git-Url: http://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=de1ac7daff3183bf5b2c2a3482e74a099f7fb641;hp=73bfe94802ef62a7e6f8d2c36cb801be6ab2863a afs: Add xvcache-related afs_FlushVCache comments Add a couple of comments to help make it explicit when it is okay to drop afs_xvcache here. Change-Id: I451ffe80755ea471322e32017f71c0619e6a8e63 Reviewed-on: http://gerrit.openafs.org/7436 Reviewed-by: Daria Brashear Reviewed-by: Alistair Ferguson Reviewed-by: Benjamin Kaduk Tested-by: Benjamin Kaduk --- diff --git a/src/afs/afs_vcache.c b/src/afs/afs_vcache.c index dad73bb..45cde7f 100644 --- a/src/afs/afs_vcache.c +++ b/src/afs/afs_vcache.c @@ -138,6 +138,10 @@ afs_FlushVCache(struct vcache *avc, int *slept) afs_int32 i, code; struct vcache **uvc, *wvc; + /* NOTE: We must have nothing drop afs_xvcache until we have removed all + * possible references to this vcache. This means all hash tables, queues, + * DNLC, etc. */ + *slept = 0; AFS_STATCNT(afs_FlushVCache); afs_Trace2(afs_iclSetp, CM_TRACE_FLUSHV, ICL_TYPE_POINTER, avc, @@ -214,6 +218,10 @@ afs_FlushVCache(struct vcache *avc, int *slept) else osi_dnlc_purgevp(avc); + /* By this point, the vcache has been removed from all global structures + * via which someone could try to use the vcache. It is okay to drop + * afs_xvcache at this point (if *slept is set). */ + if (!afs_shuttingdown) afs_QueueVCB(avc, slept);