From d769b27694b4ab6d3fba23c6121238b311bd82d6 Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Mon, 26 Oct 2009 23:17:36 +0000 Subject: [PATCH] Make cache bypass build again Recent commits had left cache bypass somewhat behind, make it build again. Change-Id: I500372f4584f4d0d90f6ea9f98a9ac3fb05f5185 Reviewed-on: http://gerrit.openafs.org/743 Tested-by: Derrick Brashear Reviewed-by: Derrick Brashear --- src/afs/LINUX/osi_vnodeops.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c index a9739dbce..3d65d8969 100644 --- a/src/afs/LINUX/osi_vnodeops.c +++ b/src/afs/LINUX/osi_vnodeops.c @@ -1691,7 +1691,7 @@ afs_linux_bypass_readpages(struct file *fp, struct address_space *mapping, afs_offs_t offset; struct iovec* iovecp; struct nocache_read_request *ancr; - struct page *pp, *ppt; + struct page *pp; struct pagevec lrupv; afs_int32 code = 0; @@ -1788,7 +1788,6 @@ afs_linux_bypass_readpages(struct file *fp, struct address_space *mapping, /* we do not flush, release, or unmap pages--that will be * done for us by the background thread as each page comes in * from the fileserver */ -out: return afs_convert_code(code); } @@ -1800,7 +1799,7 @@ afs_linux_bypass_readpage(struct file *fp, struct page *pp) uio_t *auio; struct iovec *iovecp; struct nocache_read_request *ancr; - afs_int32 isize; + int code; ClearPageError(pp); @@ -1818,7 +1817,7 @@ afs_linux_bypass_readpage(struct file *fp, struct page *pp) /* the background thread will free this */ ancr = osi_Alloc(sizeof(struct nocache_read_request)); ancr->auio = auio; - ancr->offset = offset; + ancr->offset = page_offset(pp); ancr->length = PAGE_SIZE; credp = crref(); @@ -1841,8 +1840,8 @@ afs_linux_can_bypass(struct inode *ip) { if(i_size_read(ip) > cache_bypass_threshold) return 1; default: + return 0; } - return 0; } /* Check if a file is permitted to bypass the cache by policy, and modify @@ -1850,12 +1849,12 @@ afs_linux_can_bypass(struct inode *ip) { static inline int afs_linux_bypass_check(struct inode *ip) { - struct cred* credp; + cred_t* credp; int bypass = afs_linux_can_bypass(ip); credp = crref(); - trydo_cache_transition(VTOAFS(ip)), credp, bypass); + trydo_cache_transition(VTOAFS(ip), credp, bypass); crfree(credp); return bypass; -- 2.39.5