diff options
author | Michael Laß | 2022-10-03 13:06:59 +0200 |
---|---|---|
committer | Michael Laß | 2022-10-03 13:06:59 +0200 |
commit | 850992c25bcd2c2cc8b97b15300669da1a56247c (patch) | |
tree | 34489ab60d2a4da5f26cd0bbab4cb6e2049d4901 | |
parent | 888d9b9f6b8d19385f2fe897adc1eebc1c3b7bc1 (diff) | |
download | aur-850992c25bcd2c2cc8b97b15300669da1a56247c.tar.gz |
Update to 1.8.9pre1 and add patch for Linux 6.0
-rw-r--r-- | .SRCINFO | 22 | ||||
-rw-r--r-- | 0001-Accepted-changes-for-openafs-stable-1_8_x.patch.gz | bin | 11723 -> 0 bytes | |||
-rw-r--r-- | 0001-Linux-6.0-Replace-add_to_page_cache.patch | 130 | ||||
-rw-r--r-- | 0002-Pending-changes-for-openafs-stable-1_8_x.patch.gz | bin | 166160 -> 0 bytes | |||
-rw-r--r-- | 0003-Linux-Introduce-file-mapping-readpage-helpers.patch | 103 | ||||
-rw-r--r-- | 0004-Linux-5.19-Rename-aops-readpage-to-read_folio.patch | 132 | ||||
-rw-r--r-- | 0005-Linux-5.19-Remove-flags-from-aops-write_begin.patch | 121 | ||||
-rw-r--r-- | PKGBUILD | 34 |
8 files changed, 146 insertions, 396 deletions
@@ -1,7 +1,7 @@ pkgbase = openafs-modules-dkms pkgdesc = Kernel module for OpenAFS (dkms) - pkgver = 1.8.8.1 - pkgrel = 4 + pkgver = 1.8.9pre1 + pkgrel = 1 url = http://www.openafs.org arch = i686 arch = x86_64 @@ -10,24 +10,16 @@ pkgbase = openafs-modules-dkms depends = dkms depends = libelf depends = openafs - provides = openafs-modules=1.8.8.1 + provides = openafs-modules=1.8.9pre1 conflicts = openafs-features-libafs conflicts = openafs-modules conflicts = openafs<1.6.6-2 options = !emptydirs - source = http://openafs.org/dl/openafs/1.8.8.1/openafs-1.8.8.1-src.tar.bz2 + source = http://openafs.org/dl/openafs/candidate/1.8.9pre1/openafs-1.8.9pre1-src.tar.bz2 source = dkms.conf - source = 0001-Accepted-changes-for-openafs-stable-1_8_x.patch.gz - source = 0002-Pending-changes-for-openafs-stable-1_8_x.patch.gz - source = 0003-Linux-Introduce-file-mapping-readpage-helpers.patch - source = 0004-Linux-5.19-Rename-aops-readpage-to-read_folio.patch - source = 0005-Linux-5.19-Remove-flags-from-aops-write_begin.patch - sha256sums = e7c4bed7075bcd6402e3f0c2d5b9dbe76ad2ee3c5fd5ddc3973a3356ca23ef44 + source = 0001-Linux-6.0-Replace-add_to_page_cache.patch + sha256sums = 3b9d5f646b1efd24ae18ba6be45490bb01b4547725621fb335379f5754c6cb7a sha256sums = 5ea5e184f9b44f5ed45817d2b5a10149d15c8c54f49e0b5b4b773652673cb9b0 - sha256sums = ed8debf0d269fb80b7e6d7d429ff3f34b6105fd423c482a3ea7c4fa54b19018b - sha256sums = c3fe812056b03cc068373c5c18411b3546f380ba72abfccf70bc166110f390da - sha256sums = 0e902a093d5bad45f422ef1fc47c686503315fa3049f304eadb8b9dae6be8027 - sha256sums = 0bb7ac77fa5d3d42bd78f67974ecbcc7cb8973e2859d74c361cb5fa18275cb8e - sha256sums = 7c7c6d9e76b436f95ba46138b979694cb50ff33eba2de82f1f5d426213f1768c + sha256sums = af9db57b1d65cfb7d7c58aa15df764e4bceaaa99d2c829f2c2ee317567347131 pkgname = openafs-modules-dkms diff --git a/0001-Accepted-changes-for-openafs-stable-1_8_x.patch.gz b/0001-Accepted-changes-for-openafs-stable-1_8_x.patch.gz Binary files differdeleted file mode 100644 index 30d9d78ea1b5..000000000000 --- a/0001-Accepted-changes-for-openafs-stable-1_8_x.patch.gz +++ /dev/null diff --git a/0001-Linux-6.0-Replace-add_to_page_cache.patch b/0001-Linux-6.0-Replace-add_to_page_cache.patch new file mode 100644 index 000000000000..d900953a13e4 --- /dev/null +++ b/0001-Linux-6.0-Replace-add_to_page_cache.patch @@ -0,0 +1,130 @@ +From ea74bb05c9a36bcf77698008d340202959be8091 Mon Sep 17 00:00:00 2001 +From: Cheyenne Wills <cwills@sinenomine.net> +Date: Thu, 22 Sep 2022 13:04:59 -0600 +Subject: [PATCH] Linux-6.0: Replace add_to_page_cache + +Linux 6.0 removed the add_to_page_cache function in the Linux commit: + 'filemap: Remove add_to_page_cache() and add_to_page_cache_locked()' + (2bb876b58d593d7f2522ec0f41f20a74fde76822) + +The replacement function, filemap_add_folio function is exported as GPL, +but a non-GPL wrapper was provided in the Linux 5.15 commit: + 'mm/filemap: Add filemap_add_folio()' + (9dd3d069406cea073fc633e77bc59abbfde8c6c4) +which changed the GPL exported function add_to_page_cache_lru to a +non-GPL exported function. + +The function add_to_page_cache_lru functionally combines the +add_to_page_cache with lru_cache_add. Within afs, all the calls to +add_to_page_cache follow the pattern of calling the lru_cache_add +via the wrapper afs_lru_cache_add immediately after (except in one case +noted below). + +Add an autoconf check to see if add_to_page_cache_lru is available. + +Introduce a new wrapper function afs_add_to_page_cache_lru that handles +calling either add_to_page_cache/afs_lru_cache_add or +add_to_page_cache_lru. + +As noted above there is one function, afs_linux_bypass_readpages, that +calls add_to_page_cache but does not immediately call afs_lru_cache_add. +This function is only used in Linux kernels prior to 5.18, see the +commit: + 'Linux-5.18: replace readpages with readahead' (7a181415db) +Since this code path is only built for a Linux kernel level where +add_to_page_cache should also exists, we do not replace this call. + +NOTE: +The add_to_page_cache_lru was moved into mm/folio-compat.c which has a +comment indicating that callers of these functions should migrate to +folio calls. However the replacement folio call that is needed by afs, +filemap_add_folio, is exported as GPL. + +Change-Id: I10087ebeb8b08309e6c1bab4fc43f7e9f50bd105 +--- + src/afs/LINUX/osi_vnodeops.c | 30 ++++++++++++++++++++++-------- + src/cf/linux-kernel-func.m4 | 10 ++++++++++ + 2 files changed, 32 insertions(+), 8 deletions(-) + +diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c +index 621e4da38..bec30bb4c 100644 +--- a/src/afs/LINUX/osi_vnodeops.c ++++ b/src/afs/LINUX/osi_vnodeops.c +@@ -148,6 +148,23 @@ afs_lru_cache_finalize(struct afs_lru_pages *alrupages) + } + #endif /* !HAVE_LINUX_LRU_ADD_FILE */ + ++static inline int ++afs_add_to_page_cache_lru(struct afs_lru_pages *alrupages, struct page *page, ++ struct address_space *mapping, ++ pgoff_t index, gfp_t gfp) ++{ ++#if defined(HAVE_LINUX_ADD_TO_PAGE_CACHE_LRU) ++ return add_to_page_cache_lru(page, mapping, index, gfp); ++#else ++ int code; ++ code = add_to_page_cache(page, mapping, index, gfp); ++ if (code == 0) { ++ afs_lru_cache_add(alrupages, page); ++ } ++ return code; ++#endif ++} ++ + /* This function converts a positive error code from AFS into a negative + * code suitable for passing into the Linux VFS layer. It checks that the + * error code is within the permissable bounds for the ERR_PTR mechanism. +@@ -2269,12 +2286,11 @@ afs_linux_read_cache(struct file *cachefp, struct page *page, + goto out; + } + +- code = add_to_page_cache(newpage, cachemapping, +- pageindex, GFP_KERNEL); ++ code = afs_add_to_page_cache_lru(alrupages, newpage, cachemapping, ++ pageindex, GFP_KERNEL); + if (code == 0) { + cachepage = newpage; + newpage = NULL; +- afs_lru_cache_add(alrupages, cachepage); + } else { + put_page(newpage); + newpage = NULL; +@@ -3092,11 +3108,9 @@ afs_linux_readpages(struct file *fp, struct address_space *mapping, + goto out; + } + +- if (tdc && !add_to_page_cache(page, mapping, page->index, +- GFP_KERNEL)) { +- afs_lru_cache_add(&lrupages, page); +- +- /* Note that add_to_page_cache() locked 'page'. ++ if (tdc && !afs_add_to_page_cache_lru(&lrupages, page, mapping, page->index, ++ GFP_KERNEL)) { ++ /* Note that afs_add_to_page_cache_lru() locks the 'page'. + * afs_linux_read_cache() is guaranteed to handle unlocking it. */ + afs_linux_read_cache(cacheFp, page, tdc->f.chunk, &lrupages, task); + } +diff --git a/src/cf/linux-kernel-func.m4 b/src/cf/linux-kernel-func.m4 +index 27a1d4141..d3abdf9ff 100644 +--- a/src/cf/linux-kernel-func.m4 ++++ b/src/cf/linux-kernel-func.m4 +@@ -189,6 +189,16 @@ AC_CHECK_LINUX_FUNC([kthread_complete_and_exit], + #include <linux/kthread.h>], + [kthread_complete_and_exit(0, 0);]) + ++dnl Linux 6.0 removed add_to_page_cache. It's replacement, filemap_add_folio, ++dnl was added in 5.15 and is GPL-only, but has a NON-GPL wrapper called ++dnl add_to_page_cache_lru. ++dnl Note prior to 5.15, add_to_page_cache_lru was either not exported or ++dnl or exported as GPL-only. ++AC_CHECK_LINUX_FUNC([add_to_page_cache_lru], ++ [#include <linux/kernel.h> ++ #include <linux/pagemap.h>], ++ [add_to_page_cache_lru(NULL, NULL, 0, 0);]) ++ + dnl Consequences - things which get set as a result of the + dnl above tests + AS_IF([test "x$ac_cv_linux_func_d_alloc_anon" = "xno"], +-- +2.37.3 + diff --git a/0002-Pending-changes-for-openafs-stable-1_8_x.patch.gz b/0002-Pending-changes-for-openafs-stable-1_8_x.patch.gz Binary files differdeleted file mode 100644 index 4aa7e0956ca6..000000000000 --- a/0002-Pending-changes-for-openafs-stable-1_8_x.patch.gz +++ /dev/null diff --git a/0003-Linux-Introduce-file-mapping-readpage-helpers.patch b/0003-Linux-Introduce-file-mapping-readpage-helpers.patch deleted file mode 100644 index da1f03cbb0de..000000000000 --- a/0003-Linux-Introduce-file-mapping-readpage-helpers.patch +++ /dev/null @@ -1,103 +0,0 @@ -From 97054ed3d994f8d6218bf8db05c41ead218200e3 Mon Sep 17 00:00:00 2001 -From: Cheyenne Wills <cwills@sinenomine.net> -Date: Tue, 5 Jul 2022 10:28:10 -0600 -Subject: [PATCH 3/6] Linux: Introduce file mapping readpage helpers - -Create a helper function that determines if a file's - i_mapping->a_ops->readpage -is NULL. - -Create a helper function that calls a file's - i_mapping->a_ops->readpage - -There are no functional changes with this commit. - -Note: This commit isolates references to 'readpage' so that future -commits can change the name in a more straight forward manner. - -Change-Id: If3ad33766c7a3bce27c2aa3c3b409157264230b1 -Reviewed-on: https://gerrit.openafs.org/15039 -Tested-by: BuildBot <buildbot@rampaginggeek.com> -Reviewed-by: Andrew Deason <adeason@sinenomine.net> -Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> -(cherry picked from commit a81f7300f08d6e515adbde4bce4b72a3102b60f9) ---- - src/afs/LINUX/osi_vnodeops.c | 34 +++++++++++++++++++++++++++++----- - 1 file changed, 29 insertions(+), 5 deletions(-) - -diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c -index 54118637f..b834a405c 100644 ---- a/src/afs/LINUX/osi_vnodeops.c -+++ b/src/afs/LINUX/osi_vnodeops.c -@@ -2206,6 +2206,18 @@ afs_linux_put_link(struct dentry *dentry, struct nameidata *nd) - - #endif /* USABLE_KERNEL_PAGE_SYMLINK_CACHE */ - -+/* -+ * Call the mapping function that reads data for a given page. -+ * Note: When we return, it is expected that the page is unlocked. It is the -+ * responsibility of the called function (e.g. ->readpage) to unlock the given -+ * page, even when an error occurs. -+ */ -+static int -+mapping_read_page(struct address_space *mapping, struct page *page) -+{ -+ return mapping->a_ops->readpage(NULL, page); -+} -+ - /* Populate a page by filling it from the cache file pointed at by cachefp - * (which contains indicated chunk) - * If task is NULL, the page copy occurs syncronously, and the routine -@@ -2272,9 +2284,9 @@ afs_linux_read_cache(struct file *cachefp, struct page *page, - - if (!PageUptodate(cachepage)) { - ClearPageError(cachepage); -- /* Note that ->readpage always handles unlocking the given page, even -- * when an error is returned. */ -- code = cachemapping->a_ops->readpage(NULL, cachepage); -+ /* Note that mapping_read_page always handles unlocking the given page, -+ * even when an error is returned. */ -+ code = mapping_read_page(cachemapping, cachepage); - if (!code && !task) { - wait_on_page_locked(cachepage); - } -@@ -2308,6 +2320,17 @@ afs_linux_read_cache(struct file *cachefp, struct page *page, - return code; - } - -+/* -+ * Return true if the file has a mapping that can read pages -+ */ -+static int inline -+file_can_read_pages(struct file *fp) -+{ -+ if (fp->f_dentry->d_inode->i_mapping->a_ops->readpage != NULL) -+ return 1; -+ return 0; -+} -+ - static int inline - afs_linux_readpage_fastpath(struct file *fp, struct page *pp, int *codep) - { -@@ -2403,7 +2426,8 @@ afs_linux_readpage_fastpath(struct file *fp, struct page *pp, int *codep) - AFS_GLOCK(); - goto out; - } -- if (!cacheFp->f_dentry->d_inode->i_mapping->a_ops->readpage) { -+ -+ if (!file_can_read_pages(cacheFp)) { - cachefs_noreadpage = 1; - AFS_GLOCK(); - goto out; -@@ -2871,7 +2895,7 @@ get_dcache_readahead(struct dcache **adc, struct file **acacheFp, - code = -1; - goto out; - } -- if (cacheFp->f_dentry->d_inode->i_mapping->a_ops->readpage == NULL) { -+ if (!file_can_read_pages(cacheFp)) { - cachefs_noreadpage = 1; - /* No mapping function */ - code = -1; --- -2.37.1 - diff --git a/0004-Linux-5.19-Rename-aops-readpage-to-read_folio.patch b/0004-Linux-5.19-Rename-aops-readpage-to-read_folio.patch deleted file mode 100644 index 1e473316ab3d..000000000000 --- a/0004-Linux-5.19-Rename-aops-readpage-to-read_folio.patch +++ /dev/null @@ -1,132 +0,0 @@ -From f7d5510aa486caeb69c688099bfba77609d82ed5 Mon Sep 17 00:00:00 2001 -From: Cheyenne Wills <cwills@sinenomine.net> -Date: Tue, 5 Jul 2022 11:45:29 -0600 -Subject: [PATCH 4/6] Linux-5.19: Rename aops readpage to read_folio - -With Linux commits: - mm,fs: Remove aops->readpage (7e0a126519) - fs: Introduce aops->read_folio (5efe7448a1) - -the address space operations method 'readpage' was replaced with -read_folio. The operation behaves the same, except instead of taking a -struct page parameter, the new function takes a folio structure. - -Add an autoconf test for the address space operation entry read_folio - -Replace the references to an address space operations' readpage with -read_folio. Note that the function Linux page_folio can be used to -obtain the required pointer to the folio for a given page. - -Introduce afs_linux_read_folio that accepts a folio and calls -afs_linux_readpage with the page associated with that folio. - -Change-Id: I2c43a9bfb26042f7cc2c55807d46b33769f2594a -Reviewed-on: https://gerrit.openafs.org/15040 -Reviewed-by: Andrew Deason <adeason@sinenomine.net> -Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> -Reviewed-by: Michael Meffie <mmeffie@sinenomine.net> -Tested-by: BuildBot <buildbot@rampaginggeek.com> -(cherry picked from commit bfb852197edcbe0c38c499faecd7c1be23308a20) ---- - src/afs/LINUX/osi_vnodeops.c | 36 +++++++++++++++++++++++++++++++++++ - src/cf/linux-kernel-struct.m4 | 2 ++ - 2 files changed, 38 insertions(+) - -diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c -index b834a405c..04f13a1b1 100644 ---- a/src/afs/LINUX/osi_vnodeops.c -+++ b/src/afs/LINUX/osi_vnodeops.c -@@ -2215,7 +2215,11 @@ afs_linux_put_link(struct dentry *dentry, struct nameidata *nd) - static int - mapping_read_page(struct address_space *mapping, struct page *page) - { -+#if defined(STRUCT_ADDRESS_SPACE_OPERATIONS_HAS_READ_FOLIO) -+ return mapping->a_ops->read_folio(NULL, page_folio(page)); -+#else - return mapping->a_ops->readpage(NULL, page); -+#endif - } - - /* Populate a page by filling it from the cache file pointed at by cachefp -@@ -2326,8 +2330,13 @@ afs_linux_read_cache(struct file *cachefp, struct page *page, - static int inline - file_can_read_pages(struct file *fp) - { -+#if defined(STRUCT_ADDRESS_SPACE_OPERATIONS_HAS_READ_FOLIO) -+ if (fp->f_dentry->d_inode->i_mapping->a_ops->read_folio != NULL) -+ return 1; -+#else - if (fp->f_dentry->d_inode->i_mapping->a_ops->readpage != NULL) - return 1; -+#endif - return 0; - } - -@@ -2849,6 +2858,16 @@ afs_linux_readpage(struct file *fp, struct page *pp) - return code; - } - -+#if defined(STRUCT_ADDRESS_SPACE_OPERATIONS_HAS_READ_FOLIO) -+static int -+afs_linux_read_folio(struct file *fp, struct folio *folio) -+{ -+ struct page *pp = &folio->page; -+ -+ return afs_linux_readpage(fp, pp); -+} -+#endif -+ - /* - * Updates the adc and acacheFp parameters - * Returns: -@@ -3536,7 +3555,11 @@ static struct inode_operations afs_file_iops = { - }; - - static struct address_space_operations afs_file_aops = { -+#if defined(STRUCT_ADDRESS_SPACE_OPERATIONS_HAS_READ_FOLIO) -+ .read_folio = afs_linux_read_folio, -+#else - .readpage = afs_linux_readpage, -+#endif - #if defined(STRUCT_ADDRESS_SPACE_OPERATIONS_HAS_READAHEAD) - .readahead = afs_linux_readahead, - #else -@@ -3609,9 +3632,22 @@ afs_symlink_filler(struct file *file, struct page *page) - unlock_page(page); - return code; - } -+#if defined(STRUCT_ADDRESS_SPACE_OPERATIONS_HAS_READ_FOLIO) -+static int -+afs_symlink_filler_folio(struct file *file, struct folio *folio) -+{ -+ struct page *page = &folio->page; -+ return afs_symlink_filler(file, page); -+} -+#endif -+ - - static struct address_space_operations afs_symlink_aops = { -+#if defined(STRUCT_ADDRESS_SPACE_OPERATIONS_HAS_READ_FOLIO) -+ .read_folio = afs_symlink_filler_folio -+#else - .readpage = afs_symlink_filler -+#endif - }; - #endif /* USABLE_KERNEL_PAGE_SYMLINK_CACHE */ - -diff --git a/src/cf/linux-kernel-struct.m4 b/src/cf/linux-kernel-struct.m4 -index 597289bc8..3d4b10b13 100644 ---- a/src/cf/linux-kernel-struct.m4 -+++ b/src/cf/linux-kernel-struct.m4 -@@ -7,6 +7,8 @@ dnl linux 5.18 replaced set_page_dirty with dirty_folio - AC_CHECK_LINUX_STRUCT([address_space_operations], [dirty_folio], [fs.h]) - dnl linux 5.18 replaced readpages with readahead (introduced in 5.8) - AC_CHECK_LINUX_STRUCT([address_space_operations], [readahead], [fs.h]) -+dnl linux 5.18 replaced readpage with read_folio -+AC_CHECK_LINUX_STRUCT([address_space_operations], [read_folio], [fs.h]) - AC_CHECK_LINUX_STRUCT([backing_dev_info], [name], - [backing-dev.h]) - AC_CHECK_LINUX_STRUCT([cred], [session_keyring], [cred.h]) --- -2.37.1 - diff --git a/0005-Linux-5.19-Remove-flags-from-aops-write_begin.patch b/0005-Linux-5.19-Remove-flags-from-aops-write_begin.patch deleted file mode 100644 index 7421a7b8393d..000000000000 --- a/0005-Linux-5.19-Remove-flags-from-aops-write_begin.patch +++ /dev/null @@ -1,121 +0,0 @@ -From bf5c975cc5585a9170d61e83d5de2982e3d0a765 Mon Sep 17 00:00:00 2001 -From: Cheyenne Wills <cwills@sinenomine.net> -Date: Tue, 5 Jul 2022 10:33:19 -0600 -Subject: [PATCH 5/6] Linux-5.19: Remove flags from aops->write_begin - -The Linux 5.19 commits: - - fs: Remove aop flags parameter from grab_cache_page_write_begin() - (b7446e7c) - fs: Remove flags parameter from aops->write_begin (9d6b0cd7) - -removed the flags parameter from the address space operations -'write_begin' as well as removing the flags parameter from the Linux -function 'grab_cache_page_write_begin'. - -Add an autoconf test to see if grab_cache_page_write_begin takes 2 or -3 parameters. Use this as a test to determine if the address space -operations 'write_begin' takes a flags parameter. - -Create a version of afs_linux_write_begin that does not take a flags -parameter, which also calls grab_cache_page_write_begin without flags. - -Change-Id: Ib98c615e6964202748c78037c9ecac459fc3372b -Reviewed-on: https://gerrit.openafs.org/15041 -Tested-by: BuildBot <buildbot@rampaginggeek.com> -Reviewed-by: Andrew Deason <adeason@sinenomine.net> -Reviewed-by: Michael Meffie <mmeffie@sinenomine.net> -Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> -(cherry picked from commit 52d8df218ff27c139ede221ec4decf593610fc47) ---- - src/afs/LINUX/osi_compat.h | 4 +++- - src/afs/LINUX/osi_vnodeops.c | 30 +++++++++++++++++++++++++++++- - src/cf/linux-kernel-func.m4 | 7 ++++++- - 3 files changed, 38 insertions(+), 3 deletions(-) - -diff --git a/src/afs/LINUX/osi_compat.h b/src/afs/LINUX/osi_compat.h -index 53a079b67..9a080da31 100644 ---- a/src/afs/LINUX/osi_compat.h -+++ b/src/afs/LINUX/osi_compat.h -@@ -138,7 +138,9 @@ hlist_unhashed(const struct hlist_node *h) { - #define AOP_WRITEPAGE_ACTIVATE WRITEPAGE_ACTIVATE - #endif - --#if defined(STRUCT_ADDRESS_SPACE_OPERATIONS_HAS_WRITE_BEGIN) && !defined(HAVE_LINUX_GRAB_CACHE_PAGE_WRITE_BEGIN) -+#if defined(STRUCT_ADDRESS_SPACE_OPERATIONS_HAS_WRITE_BEGIN) && \ -+ !defined(HAVE_LINUX_GRAB_CACHE_PAGE_WRITE_BEGIN_WITHFLAGS) && \ -+ !defined(HAVE_LINUX_GRAB_CACHE_PAGE_WRITE_BEGIN_NOFLAGS) - static inline struct page * - grab_cache_page_write_begin(struct address_space *mapping, pgoff_t index, - unsigned int flags) { -diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c -index 04f13a1b1..881d38e06 100644 ---- a/src/afs/LINUX/osi_vnodeops.c -+++ b/src/afs/LINUX/osi_vnodeops.c -@@ -3480,6 +3480,33 @@ afs_linux_write_end(struct file *file, struct address_space *mapping, - return code; - } - -+# if defined(HAVE_LINUX_GRAB_CACHE_PAGE_WRITE_BEGIN_NOFLAGS) -+static int -+afs_linux_write_begin(struct file *file, struct address_space *mapping, -+ loff_t pos, unsigned len, -+ struct page **pagep, void **fsdata) -+{ -+ struct page *page; -+ pgoff_t index = pos >> PAGE_SHIFT; -+ unsigned int from = pos & (PAGE_SIZE - 1); -+ int code; -+ -+ page = grab_cache_page_write_begin(mapping, index); -+ if (!page) { -+ return -ENOMEM; -+ } -+ -+ *pagep = page; -+ -+ code = afs_linux_prepare_write(file, page, from, from + len); -+ if (code) { -+ unlock_page(page); -+ put_page(page); -+ } -+ -+ return code; -+} -+# else - static int - afs_linux_write_begin(struct file *file, struct address_space *mapping, - loff_t pos, unsigned len, unsigned flags, -@@ -3505,7 +3532,8 @@ afs_linux_write_begin(struct file *file, struct address_space *mapping, - - return code; - } --#endif -+# endif /* HAVE_LINUX_GRAB_CACHE_PAGE_WRITE_BEGIN_NOFLAGS */ -+#endif /* STRUCT_ADDRESS_SPACE_OPERATIONS_HAS_WRITE_BEGIN */ - - #ifndef STRUCT_DENTRY_OPERATIONS_HAS_D_AUTOMOUNT - static void * -diff --git a/src/cf/linux-kernel-func.m4 b/src/cf/linux-kernel-func.m4 -index cd4afe914..27a1d4141 100644 ---- a/src/cf/linux-kernel-func.m4 -+++ b/src/cf/linux-kernel-func.m4 -@@ -59,9 +59,14 @@ AC_CHECK_LINUX_FUNC([find_task_by_pid], - AC_CHECK_LINUX_FUNC([generic_file_aio_read], - [#include <linux/fs.h>], - [generic_file_aio_read(NULL,NULL,0,0);]) --AC_CHECK_LINUX_FUNC([grab_cache_page_write_begin], -+dnl - linux 5.19 removed the flags parameter, need to test -+dnl - with and without the flags parameter -+AC_CHECK_LINUX_FUNC([grab_cache_page_write_begin_withflags], - [#include <linux/pagemap.h>], - [grab_cache_page_write_begin(NULL, 0, 0);]) -+AC_CHECK_LINUX_FUNC([grab_cache_page_write_begin_noflags], -+ [#include <linux/pagemap.h>], -+ [grab_cache_page_write_begin(NULL, 0);]) - AC_CHECK_LINUX_FUNC([hlist_unhashed], - [#include <linux/list.h>], - [hlist_unhashed(0);]) --- -2.37.1 - @@ -6,8 +6,8 @@ pkgname=openafs-modules-dkms _srcname=openafs -pkgver=1.8.8.1 -pkgrel=4 +pkgver=1.8.9pre1 +pkgrel=1 pkgdesc="Kernel module for OpenAFS (dkms)" arch=('i686' 'x86_64' 'armv7h') url="http://www.openafs.org" @@ -16,34 +16,18 @@ depends=('dkms' 'libelf' 'openafs') provides=("openafs-modules=$pkgver") conflicts=('openafs-features-libafs' 'openafs-modules' 'openafs<1.6.6-2') options=(!emptydirs) -source=(http://openafs.org/dl/openafs/${pkgver}/${_srcname}-${pkgver}-src.tar.bz2 - "dkms.conf" - 0001-Accepted-changes-for-openafs-stable-1_8_x.patch.gz - 0002-Pending-changes-for-openafs-stable-1_8_x.patch.gz - 0003-Linux-Introduce-file-mapping-readpage-helpers.patch - 0004-Linux-5.19-Rename-aops-readpage-to-read_folio.patch - 0005-Linux-5.19-Remove-flags-from-aops-write_begin.patch) -sha256sums=('e7c4bed7075bcd6402e3f0c2d5b9dbe76ad2ee3c5fd5ddc3973a3356ca23ef44' +source=(http://openafs.org/dl/openafs/candidate/${pkgver}/${_srcname}-${pkgver}-src.tar.bz2 + dkms.conf + 0001-Linux-6.0-Replace-add_to_page_cache.patch) +sha256sums=('3b9d5f646b1efd24ae18ba6be45490bb01b4547725621fb335379f5754c6cb7a' '5ea5e184f9b44f5ed45817d2b5a10149d15c8c54f49e0b5b4b773652673cb9b0' - 'ed8debf0d269fb80b7e6d7d429ff3f34b6105fd423c482a3ea7c4fa54b19018b' - 'c3fe812056b03cc068373c5c18411b3546f380ba72abfccf70bc166110f390da' - '0e902a093d5bad45f422ef1fc47c686503315fa3049f304eadb8b9dae6be8027' - '0bb7ac77fa5d3d42bd78f67974ecbcc7cb8973e2859d74c361cb5fa18275cb8e' - '7c7c6d9e76b436f95ba46138b979694cb50ff33eba2de82f1f5d426213f1768c') + 'af9db57b1d65cfb7d7c58aa15df764e4bceaaa99d2c829f2c2ee317567347131') prepare() { cd "${srcdir}/${_srcname}-${pkgver}" - # Changes that have been accepted for OpenAFS 1.8.x - zcat "${srcdir}"/0001-Accepted-changes-for-openafs-stable-1_8_x.patch.gz | patch -p1 - - # Changes likely to be accepted for OpenAFS 1.8.x - zcat "${srcdir}"/0002-Pending-changes-for-openafs-stable-1_8_x.patch.gz | patch -p1 - - # Changes to support Linux 5.19 - patch -p1 < "${srcdir}"/0003-Linux-Introduce-file-mapping-readpage-helpers.patch - patch -p1 < "${srcdir}"/0004-Linux-5.19-Rename-aops-readpage-to-read_folio.patch - patch -p1 < "${srcdir}"/0005-Linux-5.19-Remove-flags-from-aops-write_begin.patch + # Changes to support Linux 6.0 + patch -p1 < "${srcdir}"/0001-Linux-6.0-Replace-add_to_page_cache.patch # Only needed when changes to configure were made ./regen.sh -q |