From de1ac7daff3183bf5b2c2a3482e74a099f7fb641 Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Sun, 20 May 2012 17:32:13 -0500 Subject: [PATCH] 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 --- src/afs/afs_vcache.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) 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); -- 1.7.1