Linux 3.6: kmap_atomic API change
authorMarc Dionne <marc.c.dionne@gmail.com>
Tue, 14 Aug 2012 20:34:42 +0000 (16:34 -0400)
committerDerrick Brashear <shadow@dementix.org>
Fri, 17 Aug 2012 05:28:52 +0000 (22:28 -0700)
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>

acinclude.m4
src/afs/afs_bypasscache.c
src/cf/linux-test4.m4

index 7e5c41f..45026da 100644 (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
index 1456bd5..b8211b8 100644 (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
 }
 
index ac3fbea..fefa40e 100644 (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])
+])