Enable PutVCache for FBSD80 and higher
authorBen Kaduk <kaduk@mit.edu>
Mon, 17 May 2010 04:22:32 +0000 (00:22 -0400)
committerDerrick Brashear <shadow@dementia.org>
Mon, 17 May 2010 12:36:50 +0000 (05:36 -0700)
Matt's patches in a123bd8ccd brought in support for FBSD 7.0, but
also disabled several calls to afs_PutVCache() for FBSD80 and
higher.  Matt says that that patch was focused on 7.0, so the
8.0-related bits may not be relevant.
I have run with the PutVCache calls enabled, and if anything,
my system seems more stable with them.

Change-Id: I8d906848e977d4974e4dcdc151964bb2ac3116b6
Reviewed-on: http://gerrit.openafs.org/1969
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

src/afs/FBSD/osi_vfsops.c
src/afs/VNOPS/afs_vnop_lookup.c

index 82875cf..95c5ace 100644 (file)
@@ -205,13 +205,11 @@ afs_root(struct mount *mp, struct vnode **vpp)
        error = 0;
     } else {
 tryagain:
-#ifndef AFS_FBSD80_ENV
        if (afs_globalVp) {
            afs_PutVCache(afs_globalVp);
            /* vrele() needed here or not? */
            afs_globalVp = NULL;
        }
-#endif
        if (!(error = afs_InitReq(&treq, cr)) && !(error = afs_CheckInit())) {
            tvp = afs_GetVCache(&afs_rootFid, &treq, NULL, NULL);
            /* we really want this to stay around */
index 074cf5d..630b643 100644 (file)
@@ -1514,9 +1514,7 @@ afs_lookup(OSI_VC_DECL(adp), char *aname, struct vcache **avcp, afs_ucred_t *acr
     if (tvc) {
        if (no_read_access && vType(tvc) != VDIR && vType(tvc) != VLNK) {
            /* need read access on dir to stat non-directory / non-link */
-#ifndef AFS_FBSD80_ENV
            afs_PutVCache(tvc);
-#endif
            *avcp = NULL;
            code = EACCES;
            goto done;
@@ -1672,9 +1670,7 @@ afs_lookup(OSI_VC_DECL(adp), char *aname, struct vcache **avcp, afs_ucred_t *acr
 
            /* if the vcache isn't usable, release it */
            if (tvc && !(tvc->f.states & CStatd)) {
-#ifndef  AFS_FBSD80_ENV
                afs_PutVCache(tvc);
-#endif
                tvc = NULL;
            }
        } else {
@@ -1737,9 +1733,7 @@ afs_lookup(OSI_VC_DECL(adp), char *aname, struct vcache **avcp, afs_ucred_t *acr
                ReleaseWriteLock(&tvc->lock);
 
                if (code) {
-#ifndef AFS_FBSD80_ENV
                    afs_PutVCache(tvc);
-#endif
                    if (tvolp)
                        afs_PutVolume(tvolp, WRITE_LOCK);
                    goto done;
@@ -1761,9 +1755,7 @@ afs_lookup(OSI_VC_DECL(adp), char *aname, struct vcache **avcp, afs_ucred_t *acr
                    } else {
                        tvc = afs_GetVCache(tvc->mvid, &treq, NULL, NULL);
                    }
-#ifndef AFS_FBSD80_ENV
                    afs_PutVCache(uvc); /* we're done with it */
-#endif
 
                    if (!tvc) {
                        code = ENOENT;
@@ -1788,9 +1780,7 @@ afs_lookup(OSI_VC_DECL(adp), char *aname, struct vcache **avcp, afs_ucred_t *acr
                        afs_PutVolume(tvolp, WRITE_LOCK);
                    }
                } else {
-#ifndef AFS_FBSD80_ENV
                    afs_PutVCache(tvc);
-#endif
                    code = ENOENT;
                    if (tvolp)
                        afs_PutVolume(tvolp, WRITE_LOCK);