mirror of
https://git.openafs.org/openafs.git
synced 2025-01-19 15:30:14 +00:00
Cache bypass: remove ifdefs under src/afs/LINUX24
Same as commit 9657695d34
, but for
LINUX24. Remove the AFS_CACHE_BYPASS references in LINUX24, since it
is always enabled. Also remove messages about a "cache bypass patched
module".
Change-Id: I79526ed78752a4c3da7123e5af1c5eb6afc19fe3
Reviewed-on: http://gerrit.openafs.org/3568
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
This commit is contained in:
parent
468ff8e4d2
commit
64e564b29e
@ -110,9 +110,6 @@ init_module(void)
|
||||
osi_proc_init();
|
||||
osi_ioctl_init();
|
||||
#endif
|
||||
#if defined(AFS_CACHE_BYPASS)
|
||||
afs_warn("Cache bypass patched libafs module init.\n");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -125,10 +122,6 @@ void
|
||||
cleanup_module(void)
|
||||
#endif
|
||||
{
|
||||
#if defined(AFS_CACHE_BYPASS)
|
||||
afs_warn("Cache bypass patched libafs module cleaning up.\n");
|
||||
#endif
|
||||
|
||||
#ifdef LINUX_KEYRING_SUPPORT
|
||||
osi_keyring_shutdown();
|
||||
#endif
|
||||
|
@ -33,10 +33,8 @@
|
||||
#if defined(AFS_LINUX24_ENV)
|
||||
#include "h/smp_lock.h"
|
||||
#endif
|
||||
#if defined(AFS_CACHE_BYPASS)
|
||||
#include "afs/lock.h"
|
||||
#include "afs/afs_bypasscache.h"
|
||||
#endif
|
||||
|
||||
#ifdef pgoff2loff
|
||||
#define pageoff(pp) pgoff2loff((pp)->index)
|
||||
@ -118,7 +116,7 @@ afs_linux_read(struct file *fp, char *buf, size_t count, loff_t * offp)
|
||||
{
|
||||
ssize_t code = 0;
|
||||
struct vcache *vcp = VTOAFS(fp->f_dentry->d_inode);
|
||||
#if defined(AFS_CACHE_BYPASS) && LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
|
||||
afs_size_t isize, offindex;
|
||||
#endif
|
||||
|
||||
@ -129,7 +127,7 @@ afs_linux_read(struct file *fp, char *buf, size_t count, loff_t * offp)
|
||||
code = afs_linux_VerifyVCache(vcp, NULL);
|
||||
|
||||
if (code == 0) {
|
||||
#if defined(AFS_CACHE_BYPASS) && LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
|
||||
isize = (i_size_read(fp->f_mapping->host) - 1) >> PAGE_CACHE_SHIFT;
|
||||
offindex = *offp >> PAGE_CACHE_SHIFT;
|
||||
if(offindex > isize) {
|
||||
@ -152,7 +150,7 @@ afs_linux_read(struct file *fp, char *buf, size_t count, loff_t * offp)
|
||||
afs_Trace4(afs_iclSetp, CM_TRACE_READOP, ICL_TYPE_POINTER, vcp,
|
||||
ICL_TYPE_OFFSET, offp, ICL_TYPE_INT32, count, ICL_TYPE_INT32,
|
||||
code);
|
||||
#if defined(AFS_CACHE_BYPASS) && LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
|
||||
done:
|
||||
#endif
|
||||
AFS_GUNLOCK();
|
||||
@ -671,9 +669,7 @@ afs_linux_flush(struct file *fp)
|
||||
struct vcache *vcp;
|
||||
cred_t *credp;
|
||||
int code;
|
||||
#if defined(AFS_CACHE_BYPASS)
|
||||
int bypasscache;
|
||||
#endif
|
||||
|
||||
AFS_GLOCK();
|
||||
|
||||
@ -690,7 +686,6 @@ afs_linux_flush(struct file *fp)
|
||||
code = afs_InitReq(&treq, credp);
|
||||
if (code)
|
||||
goto out;
|
||||
#if defined(AFS_CACHE_BYPASS)
|
||||
/* If caching is bypassed for this file, or globally, just return 0 */
|
||||
if(cache_bypass_strategy == ALWAYS_BYPASS_CACHE)
|
||||
bypasscache = 1;
|
||||
@ -704,7 +699,6 @@ afs_linux_flush(struct file *fp)
|
||||
/* future proof: don't rely on 0 return from afs_InitReq */
|
||||
code = 0; goto out;
|
||||
}
|
||||
#endif
|
||||
|
||||
ObtainSharedLock(&vcp->lock, 535);
|
||||
if ((vcp->execsOrWriters > 0) && (file_count(fp) == 1)) {
|
||||
@ -1545,12 +1539,10 @@ afs_linux_readpage(struct file *fp, struct page *pp)
|
||||
ulong address = afs_linux_page_address(pp);
|
||||
afs_offs_t offset = pageoff(pp);
|
||||
#endif
|
||||
#if defined(AFS_CACHE_BYPASS)
|
||||
afs_int32 bypasscache = 0; /* bypass for this read */
|
||||
struct nocache_read_request *ancr;
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
|
||||
afs_int32 isize;
|
||||
#endif
|
||||
#endif
|
||||
uio_t *auio;
|
||||
struct iovec *iovecp;
|
||||
@ -1575,7 +1567,6 @@ afs_linux_readpage(struct file *fp, struct page *pp)
|
||||
setup_uio(auio, iovecp, (char *)address, offset, PAGE_SIZE, UIO_READ,
|
||||
AFS_UIOSYS);
|
||||
|
||||
#if defined(AFS_CACHE_BYPASS)
|
||||
bypasscache = afs_linux_can_bypass(ip);
|
||||
|
||||
/* In the new incarnation of selective caching, a file's caching policy
|
||||
@ -1599,7 +1590,6 @@ afs_linux_readpage(struct file *fp, struct page *pp)
|
||||
|
||||
goto done; /* skips release page, doing it in bg thread */
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef AFS_LINUX24_ENV
|
||||
maybe_lock_kernel();
|
||||
@ -1644,11 +1634,9 @@ afs_linux_readpage(struct file *fp, struct page *pp)
|
||||
free_page(address);
|
||||
#endif
|
||||
|
||||
#if defined(AFS_CACHE_BYPASS)
|
||||
/* do not call afs_GetDCache if cache is bypassed */
|
||||
if(bypasscache)
|
||||
goto done;
|
||||
#endif
|
||||
|
||||
/* free if not bypassing cache */
|
||||
osi_Free(auio, sizeof(uio_t));
|
||||
@ -1672,9 +1660,7 @@ afs_linux_readpage(struct file *fp, struct page *pp)
|
||||
AFS_GUNLOCK();
|
||||
}
|
||||
|
||||
#if defined(AFS_CACHE_BYPASS)
|
||||
done:
|
||||
#endif
|
||||
crfree(credp);
|
||||
return afs_convert_code(code);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user