afs: Add xvcache-related afs_FlushVCache comments
authorAndrew Deason <adeason@sinenomine.net>
Sun, 20 May 2012 22:32:13 +0000 (17:32 -0500)
committerDaria Brashear <shadow@your-file-system.com>
Fri, 12 Dec 2014 21:58:16 +0000 (16:58 -0500)
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 <shadow@your-file-system.com>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>

src/afs/afs_vcache.c

index dad73bb..45cde7f 100644 (file)
@@ -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);