diff --git a/acinclude.m4 b/acinclude.m4 index 7e5c41fc63..45026da6c3 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -975,6 +975,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) LINUX_IOP_MKDIR_TAKES_UMODE_T LINUX_IOP_CREATE_TAKES_UMODE_T LINUX_EXPORT_OP_ENCODE_FH_TAKES_INODES + LINUX_KMAP_ATOMIC_TAKES_NO_KM_TYPE dnl If we are guaranteed that keyrings will work - that is dnl a) The kernel has keyrings enabled diff --git a/src/afs/afs_bypasscache.c b/src/afs/afs_bypasscache.c index 1456bd517b..b8211b8de4 100644 --- a/src/afs/afs_bypasscache.c +++ b/src/afs/afs_bypasscache.c @@ -325,13 +325,21 @@ afs_bypass_copy_page(bypass_page_t pp, int pageoff, struct iovec *rxiov, dolen = auio->uio_iov[curiov].iov_len - pageoff; #if !defined(UKERNEL) +# if defined(KMAP_ATOMIC_TAKES_NO_KM_TYPE) + address = kmap_atomic(pp); +# else address = kmap_atomic(pp, KM_USER0); +# endif #else address = pp; #endif memcpy(address + pageoff, (char *)(rxiov[iovno].iov_base) + iovoff, dolen); #if !defined(UKERNEL) +# if defined(KMAP_ATOMIC_TAKES_NO_KM_TYPE) + kunmap_atomic(address); +# else kunmap_atomic(address, KM_USER0); +# endif #endif } diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4 index ac3fbead54..fefa40e6cf 100644 --- a/src/cf/linux-test4.m4 +++ b/src/cf/linux-test4.m4 @@ -665,3 +665,15 @@ AC_DEFUN([LINUX_EXPORT_OP_ENCODE_FH_TAKES_INODES], [ [define if encode_fh export op takes inode arguments], [-Werror]) ]) + + +AC_DEFUN([LINUX_KMAP_ATOMIC_TAKES_NO_KM_TYPE], [ + AC_CHECK_LINUX_BUILD([whether kmap_atomic takes no km_type argument], + [ac_cv_linux_kma_atomic_takes_no_km_type], + [#include ], + [struct page *p = NULL; + kmap_atomic(p);], + [KMAP_ATOMIC_TAKES_NO_KM_TYPE], + [define if kmap_atomic takes no km_type argument], + [-Werror]) +])