summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Lass2018-01-30 18:54:53 +0100
committerMichael Lass2018-01-30 18:54:53 +0100
commitc6771ea76ece190b4b61a83eba74a599403b82ec (patch)
tree46c8faea6aa639ebf8fadae1d011052d3cb28290
parent8bc4e45685531ec3e705adad29a64fb1ddd5736f (diff)
downloadaur-c6771ea76ece190b4b61a83eba74a599403b82ec.tar.gz
Add support for Linux 4.15
-rw-r--r--.SRCINFO8
-rw-r--r--0001-Linux-use-plain-page_cache_alloc.patch42
-rw-r--r--0002-Linux-4.15-check-for-2nd-argument-to-pagevec_init.patch104
-rw-r--r--PKGBUILD16
4 files changed, 163 insertions, 7 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 5b4664dd1c9..442e1a6a82b 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,9 +1,7 @@
-# Generated by mksrcinfo v8
-# Fri Dec 22 13:20:49 UTC 2017
pkgbase = openafs-modules
pkgdesc = Kernel module for OpenAFS
pkgver = 1.6.22.1
- pkgrel = 1
+ pkgrel = 2
url = http://www.openafs.org
install = openafs-modules.install
arch = i686
@@ -17,7 +15,11 @@ pkgbase = openafs-modules
conflicts = openafs<1.6.6-2
options = !emptydirs
source = http://openafs.org/dl/1.6.22.1/openafs-1.6.22.1-src.tar.bz2
+ source = 0001-Linux-use-plain-page_cache_alloc.patch
+ source = 0002-Linux-4.15-check-for-2nd-argument-to-pagevec_init.patch
sha256sums = 5c617948b6bf5a079c14fb7ee86b99e97d23fe6267ca5e079364acc3f55ccea6
+ sha256sums = 985d88ead08ffff3e5d681673185b9655a2d1993605377e16fcc9bc840341fe7
+ sha256sums = 23fcddf5f4740f4ab701c60c81844bd56d64b8d2b7c194a637610c4a7d45fc9c
pkgname = openafs-modules
diff --git a/0001-Linux-use-plain-page_cache_alloc.patch b/0001-Linux-use-plain-page_cache_alloc.patch
new file mode 100644
index 00000000000..338b6cc1f50
--- /dev/null
+++ b/0001-Linux-use-plain-page_cache_alloc.patch
@@ -0,0 +1,42 @@
+From 9958cc449c99b2098eb13b2e061c5a981cc1de84 Mon Sep 17 00:00:00 2001
+From: Stephan Wiesand <stephan.wiesand@desy.de>
+Date: Fri, 22 Dec 2017 14:17:09 +0100
+Subject: [PATCH 1/2] Linux: use plain page_cache_alloc
+
+Linux 4.15 removes the distinction between "hot" and "cold" cache
+pages, and no longer provides page_cache_alloc_cold(). Simply use
+page_cache_alloc() instead, rather than adding yet another test.
+
+Reviewed-on: https://gerrit.openafs.org/12823
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
+Tested-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
+Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
+(cherry picked from commit be5f5b2aff2d59986dd8e7dd7dd531be24c27cb2)
+
+Reviewed-on: https://gerrit.openafs.org/12828
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
+(cherry picked from commit 2ff3ef2ec6f217195dc50c04ba4e3409c23e6a4d)
+
+Change-Id: Iec018dd6591c0cd477a026efd8817ccea7924dce
+---
+ src/afs/LINUX/osi_vnodeops.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c
+index 051452b34..c2cd4f742 100644
+--- a/src/afs/LINUX/osi_vnodeops.c
++++ b/src/afs/LINUX/osi_vnodeops.c
+@@ -2033,7 +2033,7 @@ afs_linux_read_cache(struct file *cachefp, struct page *page,
+ cachepage = find_get_page(cachemapping, pageindex);
+ if (!cachepage) {
+ if (!newpage)
+- newpage = page_cache_alloc_cold(cachemapping);
++ newpage = page_cache_alloc(cachemapping);
+ if (!newpage) {
+ code = -ENOMEM;
+ goto out;
+--
+2.16.1
+
diff --git a/0002-Linux-4.15-check-for-2nd-argument-to-pagevec_init.patch b/0002-Linux-4.15-check-for-2nd-argument-to-pagevec_init.patch
new file mode 100644
index 00000000000..f77910264e2
--- /dev/null
+++ b/0002-Linux-4.15-check-for-2nd-argument-to-pagevec_init.patch
@@ -0,0 +1,104 @@
+From c8c8e5eca6ab79d651a761f4cde1fad5061b760e Mon Sep 17 00:00:00 2001
+From: Stephan Wiesand <stephan.wiesand@desy.de>
+Date: Fri, 22 Dec 2017 14:40:32 +0100
+Subject: [PATCH 2/2] Linux 4.15: check for 2nd argument to pagevec_init
+
+Linux 4.15 removes the distinction between "hot" and "cold" cache
+pages, and pagevec_init() no longer takes a "cold" flag as the
+second argument. Add a configure test and use it in osi_vnodeops.c .
+
+Reviewed-on: https://gerrit.openafs.org/12824
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
+Tested-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
+Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
+(cherry picked from commit fb1f14d8ee963678a9caad0538256c99c159c2c4)
+
+Reviewed-on: https://gerrit.openafs.org/12829
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
+(cherry picked from commit 7a80b4ba67b0d295df72e87da4aa638bd5e245de)
+
+Change-Id: I525d17abe9b57c3017cf9cf76321f25eb819133c
+---
+ acinclude.m4 | 1 +
+ src/afs/LINUX/osi_vnodeops.c | 12 ++++++++++++
+ src/cf/linux-test4.m4 | 10 ++++++++++
+ 3 files changed, 23 insertions(+)
+
+diff --git a/acinclude.m4 b/acinclude.m4
+index ebfa0cb2a..918013920 100644
+--- a/acinclude.m4
++++ b/acinclude.m4
+@@ -1103,6 +1103,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
+ LINUX_AOP_WRITEBACK_CONTROL
+ LINUX_FS_STRUCT_FOP_HAS_SPLICE
+ LINUX_KERNEL_POSIX_LOCK_FILE_WAIT_ARG
++ LINUX_KERNEL_PAGEVEC_INIT_COLD_ARG
+ LINUX_POSIX_TEST_LOCK_RETURNS_CONFLICT
+ LINUX_POSIX_TEST_LOCK_CONFLICT_ARG
+ LINUX_KERNEL_SOCK_CREATE
+diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c
+index c2cd4f742..f744bd94b 100644
+--- a/src/afs/LINUX/osi_vnodeops.c
++++ b/src/afs/LINUX/osi_vnodeops.c
+@@ -2191,7 +2191,11 @@ afs_linux_readpage_fastpath(struct file *fp, struct page *pp, int *codep)
+ AFS_GLOCK();
+ goto out;
+ }
++#if defined(PAGEVEC_INIT_COLD_ARG)
+ pagevec_init(&lrupv, 0);
++#else
++ pagevec_init(&lrupv);
++#endif
+
+ code = afs_linux_read_cache(cacheFp, pp, tdc->f.chunk, &lrupv, NULL);
+
+@@ -2351,7 +2355,11 @@ afs_linux_bypass_readpages(struct file *fp, struct address_space *mapping,
+ ancr->offset = auio->uio_offset;
+ ancr->length = auio->uio_resid;
+
++#if defined(PAGEVEC_INIT_COLD_ARG)
+ pagevec_init(&lrupv, 0);
++#else
++ pagevec_init(&lrupv);
++#endif
+
+ for(page_ix = 0; page_ix < num_pages; ++page_ix) {
+
+@@ -2571,7 +2579,11 @@ afs_linux_readpages(struct file *fp, struct address_space *mapping,
+ task = afs_pagecopy_init_task();
+
+ tdc = NULL;
++#if defined(PAGEVEC_INIT_COLD_ARG)
+ pagevec_init(&lrupv, 0);
++#else
++ pagevec_init(&lrupv);
++#endif
+ for (page_idx = 0; page_idx < num_pages; page_idx++) {
+ struct page *page = list_entry(page_list->prev, struct page, lru);
+ list_del(&page->lru);
+diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4
+index 5a4615f3f..5a53f9818 100644
+--- a/src/cf/linux-test4.m4
++++ b/src/cf/linux-test4.m4
+@@ -163,6 +163,16 @@ AC_DEFUN([LINUX_KERNEL_POSIX_LOCK_FILE_WAIT_ARG], [
+ [])
+ ])
+
++AC_DEFUN([LINUX_KERNEL_PAGEVEC_INIT_COLD_ARG], [
++ AC_CHECK_LINUX_BUILD([for 2nd argument in pagevec_init found in pre-4.15 kernels],
++ [ac_cv_linux_kernel_pagevec_init_cold_arg],
++ [#include <linux/pagevec.h>],
++ [pagevec_init(0,0);],
++ [PAGEVEC_INIT_COLD_ARG],
++ [define if your kernel uses 2 arguments for pagevec_init],
++ [])
++])
++
+ AC_DEFUN([LINUX_KERNEL_SOCK_CREATE], [
+ AC_CHECK_LINUX_BUILD([for 5th argument in sock_create found in some SELinux kernels],
+ [ac_cv_linux_kernel_sock_create_v],
+--
+2.16.1
+
diff --git a/PKGBUILD b/PKGBUILD
index be79926da9f..bd96983bffc 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -6,7 +6,7 @@
pkgname=openafs-modules
_srcname=openafs
pkgver=1.6.22.1
-pkgrel=1
+pkgrel=2
pkgdesc="Kernel module for OpenAFS"
arch=('i686' 'x86_64' 'armv7h')
url="http://www.openafs.org"
@@ -15,9 +15,13 @@ depends=('openafs')
makedepends=('libelf' 'linux-headers')
conflicts=('openafs-features-libafs' 'openafs<1.6.6-2')
options=(!emptydirs)
-source=(http://openafs.org/dl/${pkgver}/${_srcname}-${pkgver}-src.tar.bz2)
+source=(http://openafs.org/dl/${pkgver}/${_srcname}-${pkgver}-src.tar.bz2
+ 0001-Linux-use-plain-page_cache_alloc.patch
+ 0002-Linux-4.15-check-for-2nd-argument-to-pagevec_init.patch)
install=openafs-modules.install
-sha256sums=('5c617948b6bf5a079c14fb7ee86b99e97d23fe6267ca5e079364acc3f55ccea6')
+sha256sums=('5c617948b6bf5a079c14fb7ee86b99e97d23fe6267ca5e079364acc3f55ccea6'
+ '985d88ead08ffff3e5d681673185b9655a2d1993605377e16fcc9bc840341fe7'
+ '23fcddf5f4740f4ab701c60c81844bd56d64b8d2b7c194a637610c4a7d45fc9c')
# Heuristic to determine version of installed kernel
# You can modify this if the heuristic fails
@@ -27,8 +31,12 @@ _kernelver=$(cat ${_extramodules}/version)
prepare() {
cd ${srcdir}/${_srcname}-${pkgver}
+ # Add support for Linux 4.15
+ patch -p1 < "${srcdir}"/0001-Linux-use-plain-page_cache_alloc.patch
+ patch -p1 < "${srcdir}"/0002-Linux-4.15-check-for-2nd-argument-to-pagevec_init.patch
+
# Only needed when changes to configure were made
- # ./regen.sh -q
+ ./regen.sh -q
}
build() {