From: Marc Dionne Date: Tue, 23 Nov 2010 22:50:25 +0000 (-0500) Subject: Cache bypass: Remove AFS_KMAP_ATOMIC X-Git-Tag: openafs-devel-1_7_1~1204 X-Git-Url: https://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=1de6d5bb0122d00c398202451bf88042ea08aa3e;hp=b9a0be5b07e750401d9659678d922a729a55ed48 Cache bypass: Remove AFS_KMAP_ATOMIC Since AFS_KMAP_ATOMIC is defined unconditionally, remove the ifdefs and the code for the !AFS_KMAP_ATOMIC case. We probably don't want to support this feature on a kernel old enough not to have kmap_atomic. This should exist on all 2.6 and even 2.4 linux kernels. This simplifies the code for maintenance and later changes. Change-Id: I5d111d65066990123db917ac105a5a14db3b305f Reviewed-on: http://gerrit.openafs.org/3372 Tested-by: BuildBot Reviewed-by: Jeffrey Altman Reviewed-by: Derrick Brashear --- diff --git a/src/afs/afs_bypasscache.c b/src/afs/afs_bypasscache.c index a6e1c18..8d7e601 100644 --- a/src/afs/afs_bypasscache.c +++ b/src/afs/afs_bypasscache.c @@ -79,7 +79,6 @@ #define LockPage(pp) lock_page(pp) #define UnlockPage(pp) unlock_page(pp) #endif -#define AFS_KMAP_ATOMIC #ifndef afs_min #define afs_min(A,B) ((A)<(B)) ? (A) : (B) @@ -322,11 +321,7 @@ afs_NoCacheFetchProc(struct rx_call *acall, struct iovec *ciov; struct page *pp; char *address; -#ifdef AFS_KMAP_ATOMIC char *page_buffer = osi_Alloc(PAGE_SIZE); -#else - char *page_buffer = NULL; -#endif ciov = auio->uio_iov; pp = (struct page*) ciov->iov_base; @@ -383,21 +378,7 @@ afs_NoCacheFetchProc(struct rx_call *acall, clen = ciov->iov_len - iovoff; tlen = afs_min(length, clen); #ifdef AFS_LINUX24_ENV -#ifndef AFS_KMAP_ATOMIC - if(pp) - address = kmap(pp); - else { - /* rx doesn't provide an interface to simply advance - or consume n bytes. for now, allocate a PAGE_SIZE - region of memory to receive bytes in the case that - there were holes in readpages */ - if(page_buffer == NULL) - page_buffer = osi_Alloc(PAGE_SIZE); - address = page_buffer; - } -#else address = page_buffer; -#endif #else #ifndef UKERNEL #error AFS_CACHE_BYPASS not implemented on this platform @@ -426,13 +407,11 @@ afs_NoCacheFetchProc(struct rx_call *acall, address += code; } else { #ifdef AFS_LINUX24_ENV -#ifdef AFS_KMAP_ATOMIC if(pp) { address = kmap_atomic(pp, KM_USER0); memcpy(address, page_buffer, PAGE_SIZE); kunmap_atomic(address, KM_USER0); } -#endif #else #ifndef UKERNEL #error AFS_CACHE_BYPASS not implemented on this platform @@ -449,9 +428,6 @@ afs_NoCacheFetchProc(struct rx_call *acall, else afs_warn("afs_NoCacheFetchProc: page not locked at iovno %d!\n", iovno); put_page(pp); /* decrement refcount */ -#ifndef AFS_KMAP_ATOMIC - kunmap(pp); -#endif #else #ifndef UKERNEL #error AFS_CACHE_BYPASS not implemented on this platform