FBSD: Do not vgone() in osi_VM_FlushVCache
authorAndrew Deason <adeason@sinenomine.net>
Sun, 20 May 2012 22:16:37 +0000 (17:16 -0500)
committerBenjamin Kaduk <kaduk@mit.edu>
Mon, 1 Dec 2014 21:06:38 +0000 (16:06 -0500)
osi_VM_FlushVCache just needs to remove VM references to the given
vcache; calling vgone() entirely should be unnecessary. Remove the
call to vgone() and other osi_TryEvictVCache-ish stuff, and just try
to cache_purge the vnode, like the other BSD implementations do.

Change-Id: I71d71f137c04d9ef3625f6a8ae22f0ffb90b9637
Reviewed-on: http://gerrit.openafs.org/7433
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

src/afs/FBSD/osi_vm.c

index d5d56f7..40ba119 100644 (file)
@@ -99,23 +99,17 @@ osi_VM_FlushVCache(struct vcache *avc, int *slept)
        return code;
     }
 
-    if ((vp->v_iflag & VI_DOOMED) != 0) {
-       VI_UNLOCK(vp);
-       return 0;
-    }
-
-    /* must hold the vnode before calling vgone()
+    /* must hold the vnode before calling cache_purge()
      * This code largely copied from vfs_subr.c:vlrureclaim() */
     vholdl(vp);
+    VI_UNLOCK(vp);
+
     AFS_GUNLOCK();
-    *slept = 1;
-    /* use the interlock while locking, so no one else can DOOM this */
-    ilock_vnode(vp);
-    vgone(vp);
-    unlock_vnode(vp);
+    cache_purge(vp);
+    AFS_GLOCK();
+
     vdrop(vp);
 
-    AFS_GLOCK();
     return 0;
 }