From: Marc Dionne Date: Tue, 23 Nov 2010 23:21:16 +0000 (-0500) Subject: Cache bypass: remove ifdefs under src/afs/LINUX X-Git-Tag: upstream/1.6.0.pre2^2~148 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=467266dd40e465cfc06d43af28e72500c39f3ef9;p=packages%2Fo%2Fopenafs.git Cache bypass: remove ifdefs under src/afs/LINUX Compile cache bypass code unconditionally under src/afs/LINUX since it is now always enabled. Also remove syslog messages about a "cache bypass patched module" when loading and unloading the module. Reviewed-on: http://gerrit.openafs.org/3373 Tested-by: BuildBot Reviewed-by: Jeffrey Altman Reviewed-by: Derrick Brashear (cherry picked from commit 9657695d34badaac654227be8c731a1512f2106b) Change-Id: I57c44352f11ca7f68f6c3644345a7d48da8c1bf9 Reviewed-on: http://gerrit.openafs.org/3645 Tested-by: BuildBot Reviewed-by: Derrick Brashear --- diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c index 204cc21af..d4b8b8ff9 100644 --- a/src/afs/LINUX/osi_vnodeops.c +++ b/src/afs/LINUX/osi_vnodeops.c @@ -602,19 +602,20 @@ afs_linux_flush(struct file *fp) code = afs_InitReq(&treq, credp); if (code) goto out; - /* If caching is bypassed for this file, or globally, just return 0 */ - if(cache_bypass_strategy == ALWAYS_BYPASS_CACHE) - bypasscache = 1; - else { - ObtainReadLock(&vcp->lock); - if(vcp->cachingStates & FCSBypass) - bypasscache = 1; - ReleaseReadLock(&vcp->lock); - } - if(bypasscache) { - /* future proof: don't rely on 0 return from afs_InitReq */ - code = 0; goto out; - } + /* If caching is bypassed for this file, or globally, just return 0 */ + if (cache_bypass_strategy == ALWAYS_BYPASS_CACHE) + bypasscache = 1; + else { + ObtainReadLock(&vcp->lock); + if (vcp->cachingStates & FCSBypass) + bypasscache = 1; + ReleaseReadLock(&vcp->lock); + } + if (bypasscache) { + /* future proof: don't rely on 0 return from afs_InitReq */ + code = 0; + goto out; + } ObtainSharedLock(&vcp->lock, 535); if ((vcp->execsOrWriters > 0) && (file_count(fp) == 1)) {