d3db42d252
- change version to openafs-1.8.13.g... since the new stable release is 1.8.13 - remove patch handle_backports.diff, it is now included upstream - remove intermediate patches: * 03b280649f5e22ed74c217d7c98c3416a2fa9052: Linux-6.10: remove includes for asm/ia32_unistd.h * 0f6a3a402f4a66114da9231032bd68cdc4dee7bc: Linux-6.10: Use filemap_alloc_folio when avail * 658942f2791fad5e33ec7542158c16dfc66eed39: Linux-6.10: define a wrapper for vmalloc * d8b56f21994ce66d8daebb7d69e792f34c1a19ed: afs: avoid empty-body warning * 7097eec17bc01bcfc12c4d299136b2d3b94ec3d7: Linux 6.10: Move 'inline' before func return type OBS-URL: https://build.opensuse.org/package/show/filesystems/openafs?expand=0&rev=129
67 lines
2.4 KiB
Plaintext
67 lines
2.4 KiB
Plaintext
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;
|