Linux 3.6: kmap_atomic API change

kmap_atomic no longer requires a KM_TYPE argument.  Test for this
and adjust the affected code.

Change-Id: I3a9e0018124d40be51cc509ac00d9250a5e8e76d
Reviewed-on: http://gerrit.openafs.org/7981
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
This commit is contained in:
Marc Dionne 2012-08-14 16:34:42 -04:00 committed by Derrick Brashear
parent 0a8256a26f
commit 049c485b4a
3 changed files with 21 additions and 0 deletions

View File

@ -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

View File

@ -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
}

View File

@ -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 <linux/highmem.h>],
[struct page *p = NULL;
kmap_atomic(p);],
[KMAP_ATOMIC_TAKES_NO_KM_TYPE],
[define if kmap_atomic takes no km_type argument],
[-Werror])
])