Compare commits

..

No commits in common. "factory" and "devel" have entirely different histories.

6 changed files with 411 additions and 0 deletions

View File

@ -0,0 +1,111 @@
commit 03b280649f5e22ed74c217d7c98c3416a2fa9052
Author: Cheyenne Wills <cwills@sinenomine.net>
Date: Wed Jun 12 13:56:44 2024 -0600
Linux-6.10: remove includes for asm/ia32_unistd.h
The Linux 6.10 commit:
"x86/syscall/compat: Remove ia32_unistd.h" (e2d168328e)
Removed the header ia32_unistd.h since it was just a wrapper for the
unistd_32_ia32.h.
The commit:
"linux-afs-translator-xen-20060731" (29dd792381)
added an ia32_unistd.h include to several files; all were not needed
(as they didn't reference any of the contents from the header file, e.g
_NR_ia32_*).
The commit:
"amd64-hook-ia32-table-20030519" (831e172463)
added an include for ia32_unistd.h to osi_module.c.
A later commit:
"osi-probe-syscall-20050129" (f126dbdbe2)
removed many of the references to defines from ia32_unistd.h, but did
not remove the include for the header.
Currently the only remaining files (linux-kernel-syscall-probe.m4,
LINUX/osi_probe.c and LINUX/osi_syscall.c) continue to reference the
items from ia32_unistd.h, but only when building older kernels that
either don't have LINUX_KEYRING_SUPPORT or when
ENABLE_LINUX_SYSCALL_PROBING is enabled (in both cases, these are only
applicable for older kernels where the asm/ia32_unistd.h file would be
present).
For the files that don't have references (i.e. _NR_ia32_*), we can
simply remove the include for asm/ia32_unistd.h. For the remaining set
of files, we can leave the include for asm/ia32_unistd.h since the code
already has preprocessor conditionals so it's only included for older
Linux kernels where the header file will be present.
We noted above, the include for asm/ia32_unistd.h is already conditional
on the checks for LINUX_KEYRING_SUPPORT and ENABLE_LINUX_SYSCALL_PROBING
so we do not need to add any additional configure checks.
Change-Id: I901b5c0f0ff86272b02f898f3951325533d22f4f
Reviewed-on: https://gerrit.openafs.org/15763
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
diff --git a/src/afs/LINUX/osi_ioctl.c b/src/afs/LINUX/osi_ioctl.c
index 3e797745c..d964d8103 100644
--- a/src/afs/LINUX/osi_ioctl.c
+++ b/src/afs/LINUX/osi_ioctl.c
@@ -21,10 +21,6 @@
#include <linux/unistd.h> /* For syscall numbers. */
#include <linux/mm.h>
-#ifdef AFS_AMD64_LINUX_ENV
-#include <asm/ia32_unistd.h>
-#endif
-
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/sched.h>
diff --git a/src/afs/LINUX/osi_module.c b/src/afs/LINUX/osi_module.c
index 8ace127f4..499810cc6 100644
--- a/src/afs/LINUX/osi_module.c
+++ b/src/afs/LINUX/osi_module.c
@@ -21,10 +21,6 @@
#include <linux/unistd.h> /* For syscall numbers. */
#include <linux/mm.h>
-#ifdef AFS_AMD64_LINUX_ENV
-#include <asm/ia32_unistd.h>
-#endif
-
#include <linux/proc_fs.h>
#include <linux/slab.h>
#include <linux/init.h>
diff --git a/src/afs/LINUX/osi_pag_module.c b/src/afs/LINUX/osi_pag_module.c
index ea3d1bd2c..346108489 100644
--- a/src/afs/LINUX/osi_pag_module.c
+++ b/src/afs/LINUX/osi_pag_module.c
@@ -20,10 +20,6 @@
#include <linux/unistd.h> /* For syscall numbers. */
#include <linux/mm.h>
-#ifdef AFS_AMD64_LINUX_ENV
-#include <asm/ia32_unistd.h>
-#endif
-
#include <linux/proc_fs.h>
#include <linux/slab.h>
#include <linux/init.h>
diff --git a/src/afs/LINUX/osi_proc.c b/src/afs/LINUX/osi_proc.c
index 9c5a080f0..ad7c695b9 100644
--- a/src/afs/LINUX/osi_proc.c
+++ b/src/afs/LINUX/osi_proc.c
@@ -25,10 +25,6 @@
#include <linux/unistd.h> /* For syscall numbers. */
#include <linux/mm.h>
-#ifdef AFS_AMD64_LINUX_ENV
-# include <asm/ia32_unistd.h>
-#endif
-
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/sched.h>

View File

@ -0,0 +1,96 @@
commit 0f6a3a402f4a66114da9231032bd68cdc4dee7bc
Author: Cheyenne Wills <cwills@sinenomine.net>
Date: Wed Jun 12 14:13:59 2024 -0600
Linux-6.10: Use filemap_alloc_folio when avail
The Linux 6.10 commit:
"mm: remove page_cache_alloc()" (3f2ae4ebd5)
removed the page_cache_alloc(), with a note that callers would be using
filemap_alloc_folio instead.
The function filemap_alloc_folio() was introduced in Linux 5.15 commit:
"mm/filemap: Add filemap_alloc_folio" (bb3c579e25)
Add a configure check for filemap_alloc_folio and update the function
afs_linux_read_cache() to use a wrapper that calls filemap_alloc_folio()
if available otherwise calls page_cache_alloc().
Minor whitespace/style cleanup
Note: The function filemap_alloc_folio() was introduced in Linux 5.15,
so this change affects builds using the Linux kernel 5.15 and later.
Change-Id: Ia17aefc38fe9787e54b315c864da726d610b8bb9
Reviewed-on: https://gerrit.openafs.org/15764
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c
index 511b0838f..18809c89f 100644
--- a/src/afs/LINUX/osi_vnodeops.c
+++ b/src/afs/LINUX/osi_vnodeops.c
@@ -2320,6 +2320,24 @@ mapping_read_page(struct address_space *mapping, struct page *page)
#endif
}
+/*
+ * small compat wrapper for filemap_alloc_folio/page_cache_alloc
+ */
+static struct page *
+afs_page_cache_alloc(struct address_space *cachemapping)
+{
+#if defined(HAVE_LINUX_FILEMAP_ALLOC_FOLIO)
+ struct folio *folio;
+ folio = filemap_alloc_folio(mapping_gfp_mask(cachemapping), 0);
+ if (folio == NULL) {
+ return NULL;
+ }
+ return &folio->page;
+#else
+ return page_cache_alloc(cachemapping);
+#endif
+}
+
/* 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
@@ -2358,11 +2376,12 @@ afs_linux_read_cache(struct file *cachefp, struct page *page,
pageindex = (offset - AFS_CHUNKTOBASE(chunk)) >> PAGE_SHIFT;
while (cachepage == NULL) {
- cachepage = find_get_page(cachemapping, pageindex);
+ cachepage = find_get_page(cachemapping, pageindex);
if (!cachepage) {
- if (!newpage)
- newpage = page_cache_alloc(cachemapping);
- if (!newpage) {
+ if (newpage == NULL) {
+ newpage = afs_page_cache_alloc(cachemapping);
+ }
+ if (newpage == NULL) {
code = -ENOMEM;
goto out;
}
diff --git a/src/cf/linux-kernel-func.m4 b/src/cf/linux-kernel-func.m4
index 93f96f5ad..83ea354b0 100644
--- a/src/cf/linux-kernel-func.m4
+++ b/src/cf/linux-kernel-func.m4
@@ -253,6 +253,16 @@ AC_CHECK_LINUX_FUNC([no_strlcpy],
size_t s;
s = strlcpy(buff);]])
+dnl Linux 5.15 introduced filemap_alloc_folio() as a replacement for
+dnl page_cache_alloc(). page_cache_alloc() was updated to become just a
+dnl wrapper for filemap_alloc_folio().
+dnl Linux 6.10 removed page_cache_alloc().
+AC_CHECK_LINUX_FUNC([filemap_alloc_folio],
+ [#include <linux/kernel.h>
+ #include <linux/pagemap.h>],
+ [[static struct folio *folio;
+ folio = filemap_alloc_folio(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"],

View File

@ -0,0 +1,66 @@
commit 658942f2791fad5e33ec7542158c16dfc66eed39
Author: Cheyenne Wills <cwills@sinenomine.net>
Date: Wed Jun 12 14:16:43 2024 -0600
Linux-6.10: define a wrapper for vmalloc
The Linux 6.10 commit:
"mm: vmalloc: enable memory allocation profiling" (88ae5fb755)
changed vmalloc from a function to a wrapper macro.
This change results in build errors:
"error: implicit declaration of function vmalloc; did you mean
kmalloc? [-Werror=implicit-function-declaration]"
when vmalloc is passed as a parameter to the afs_atomlist_create() and
afs_lhash_create() functions.
Add a little wrapper function around vmalloc() to use for the parameter
to afs_atomlist_create() and afs_lhash_create().
Note: A configure test was not needed for this change since the name
and functionality of Linux's vmalloc did not change.
Change-Id: I69c1da9eea5d1de11c1628bbcef427f81f5c01e1
Reviewed-on: https://gerrit.openafs.org/15765
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
diff --git a/src/afs/LINUX/osi_alloc.c b/src/afs/LINUX/osi_alloc.c
index 86cd0e571..7c4b4a1ca 100644
--- a/src/afs/LINUX/osi_alloc.c
+++ b/src/afs/LINUX/osi_alloc.c
@@ -196,6 +196,15 @@ local_free(void *p, size_t n)
vfree(p);
}
+/*
+ * wrapper for vmalloc(), since vmalloc() may be a macro
+ */
+static void *
+local_vmalloc(size_t size)
+{
+ return vmalloc(size);
+}
+
/* linux_alloc_init(): Initializes the kernel memory allocator. As part
* of this process, it also initializes a pool of osi_linux_mem
* structures as well as the hash table itself.
@@ -209,14 +218,14 @@ linux_alloc_init(void)
/* initiate our pool of osi_linux_mem structs */
al_mem_pool =
afs_atomlist_create(sizeof(struct osi_linux_mem), sizeof(long) * 1024,
- (void *)vmalloc, local_free);
+ local_vmalloc, local_free);
if (!al_mem_pool) {
printf("afs_osi_Alloc: Error in initialization(atomlist_create)\n");
return 0;
}
/* initialize the hash table to hold references to alloc'ed chunks */
- lh_mem_htab = afs_lhash_create(hash_equal, (void *)vmalloc, local_free);
+ lh_mem_htab = afs_lhash_create(hash_equal, local_vmalloc, local_free);
if (!lh_mem_htab) {
printf("afs_osi_Alloc: Error in initialization(lhash_create)\n");
return 0;

View File

@ -0,0 +1,51 @@
commit 7097eec17bc01bcfc12c4d299136b2d3b94ec3d7
Author: Cheyenne Wills <cwills@sinenomine.net>
Date: Thu Jun 6 10:42:57 2024 -0600
Linux 6.10: Move 'inline' before func return type
With Linux 6.10 commit:
"kbuild: turn on -Wextra by default" (f5982cceb3)
there are additional compiler warnings that can turn
into build errors when --enable-checking is used.
"error: inline is not at beginning of declaration
[-Werror=old-style-declaration]"
The error is due to the return type preceding the "inline" keyword
in function declarations.
Fix the declarations for file_can_read_pages() and
afs_linux_readpage_fastpath() to have the proper ordering of the
static/inline keywords attributes so they precede the return type.
Just a note that the `static` and `inline` keywords must precede a
function's return type.
Change-Id: I3ff9d45c119e70a90faf18fbf6d49fb6b9adcf33
Reviewed-on: https://gerrit.openafs.org/15768
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: Andrew Deason <adeason@sinenomine.net>
diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c
index 18809c89f..c6c3bfe39 100644
--- a/src/afs/LINUX/osi_vnodeops.c
+++ b/src/afs/LINUX/osi_vnodeops.c
@@ -2443,7 +2443,7 @@ afs_linux_read_cache(struct file *cachefp, struct page *page,
/*
* Return true if the file has a mapping that can read pages
*/
-static int inline
+static inline int
file_can_read_pages(struct file *fp)
{
#if defined(STRUCT_ADDRESS_SPACE_OPERATIONS_HAS_READ_FOLIO)
@@ -2456,7 +2456,7 @@ file_can_read_pages(struct file *fp)
return 0;
}
-static int inline
+static inline int
afs_linux_readpage_fastpath(struct file *fp, struct page *pp, int *codep)
{
loff_t offset = page_offset(pp);

View File

@ -0,0 +1,76 @@
commit d8b56f21994ce66d8daebb7d69e792f34c1a19ed
Author: Cheyenne Wills <cwills@sinenomine.net>
Date: Wed Jun 12 14:24:01 2024 -0600
afs: avoid empty-body warning
With Linux 6.10 commit:
"kbuild: turn on -Wextra by default" (f5982cceb3)
there are additional compiler warnings that can turn
into build errors when --enable-checking is used.
"error: suggest braces around empty body in an if
statement [-Werror=empty-body]"
when there is an empty body, e.g.
if (foo)
;
Most cases are due to the macros afs_PutCell and afs_PutServer which are
"empty" macros.
Update the afs_PutCell and afs_PutServer macros so they expand to
do {} while(0)
Add a comment at the definitions for afs_PutCell and afs_PutServer to
document the reason for keeping them.
Add braces to conditionals that have an empty body.
There are no functional changes with this commit.
Change-Id: I359723eb6a19d1c78449902b4f477da131b0fa18
Reviewed-on: https://gerrit.openafs.org/15766
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
diff --git a/src/afs/afs.h b/src/afs/afs.h
index 4bde047e8..621a8a517 100644
--- a/src/afs/afs.h
+++ b/src/afs/afs.h
@@ -349,7 +349,8 @@ struct cell_alias {
char *cell;
};
-#define afs_PutCell(cellp, locktype)
+/* In case someday a counterpart for afs_GetCell is needed */
+#define afs_PutCell(cellp, locktype) do {} while(0)
/* the unixuser flag bit definitions */
#define UHasTokens 1 /* are the st and ct fields valid (ever set)? */
@@ -537,7 +538,8 @@ struct server {
afs_int32 capabilities;
};
-#define afs_PutServer(servp, locktype)
+/* In case someday a counterpart for afs_GetServer is needed */
+#define afs_PutServer(servp, locktype) do {} while(0)
/* structs for some pioctls - these are (or should be)
* also in venus.h
diff --git a/src/afs/afs_cbqueue.c b/src/afs/afs_cbqueue.c
index 2dd633588..11e3aa3f1 100644
--- a/src/afs/afs_cbqueue.c
+++ b/src/afs/afs_cbqueue.c
@@ -139,7 +139,9 @@ afs_DequeueCallback(struct vcache *avc)
debugvc = avc;
if (avc->callsort.prev) {
QRemove(&(avc->callsort));
- } else; /* must have got dequeued in a race */
+ } else {
+ /* must have got dequeued in a race */
+ }
return;
} /* afs_DequeueCallback */

11
handle_backports.diff Normal file
View File

@ -0,0 +1,11 @@
--- a/src/afs/LINUX/osi_vnodeops.c
+++ b/src/afs/LINUX/osi_vnodeops.c
@@ -971,7 +971,7 @@
# else
.splice_write = generic_file_splice_write,
# endif
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(6,5,0)
+# if LINUX_VERSION_CODE >= KERNEL_VERSION(6,4,0)
.splice_read = filemap_splice_read,
# else
.splice_read = generic_file_splice_read,