summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO67
-rw-r--r--0001-afs-Make-afs_AllocDCache-static.patch35
-rw-r--r--0002-LINUX-Minor-osi_vfsop.c-cleanup.patch80
-rw-r--r--0003-afs-Remove-SRXAFSCB_GetDE.patch52
-rw-r--r--0004-afs-remove-dead-ICL-fstrace-code.patch265
-rw-r--r--0005-cf-Add-function-prototypes-for-linux-conftest.patch108
-rw-r--r--0006-afs-Remove-DFlushDCache.patch72
-rw-r--r--0007-afs-Remove-afs_MemExtendEntry.patch58
-rw-r--r--0008-afs-Remove-afs_osi_UnmaskUserLoop.patch54
-rw-r--r--0009-afs-Remove-dummy_PSetAcl.patch51
-rw-r--r--0010-afs-Remove-SRXAFSCB_FetchData-StoreData.patch132
-rw-r--r--0011-afs-Remove-afs_DbgDisconFiles.patch76
-rw-r--r--0012-afs-Add-declaration-for-RXAFS_ResidencyCmd.patch48
-rw-r--r--0013-roken-Declare-ct_memcmp-in-hcrypto-kernel-roken.h.patch95
-rw-r--r--0014-Linux-6.8-Add-function-prototypes-for-krb5.patch182
-rw-r--r--0015-afs-Declare-init_hckernel_mutex.patch63
-rw-r--r--0016-afs-Add-includes-to-pick-up-function-prototypes.patch120
-rw-r--r--0017-afs-Move-function-prototypes-into-headers.patch144
-rw-r--r--0018-afs-Add-afs_xioctl-prototyes-to-afs_prototypes.h.patch162
-rw-r--r--0019-afs-Remove-SRXAFSCB-protos-from-afs_prototypes.h.patch106
-rw-r--r--0020-rx-Add-function-prototypes-to-rx_prototypes.h.patch84
-rw-r--r--0021-afs-fix-ops-variable-may-be-used-uninitialized.patch80
-rw-r--r--0022-afs-Add-static-attribute-to-internal-functions.patch487
-rw-r--r--0023-rx-Add-static-attribute-to-internal-functions.patch76
-rw-r--r--0024-rxgen-Declare-generated-PKG_TranslateOpCode.patch52
-rw-r--r--0025-rxgen-Declare-generated-PKG_OpCodeStats.patch70
-rw-r--r--0026-Linux-6.8-use-hlist-iteration-for-dentry-children.patch72
-rw-r--r--0027-Linux-6.8-Remove-ctl_table-sentinels.patch86
-rw-r--r--0028-Linux-6.8-Use-roken-s-strlcpy-in-kernel-module.patch156
-rw-r--r--0029-afs-Drop-GLOCK-for-various-Rx-calls.patch362
-rw-r--r--PKGBUILD106
31 files changed, 3590 insertions, 11 deletions
diff --git a/.SRCINFO b/.SRCINFO
index b43541e67249..2fdef6583550 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,21 +1,78 @@
pkgbase = openafs-modules
pkgdesc = Kernel module for OpenAFS
- pkgver = 1.8.4
+ pkgver = 1.8.11
pkgrel = 1
url = http://www.openafs.org
install = openafs-modules.install
arch = i686
arch = x86_64
arch = armv7h
- license = custom:"IBM Public License Version 1.0"
+ license = IPL-1.0
makedepends = libelf
makedepends = linux-headers
depends = openafs
conflicts = openafs-features-libafs
conflicts = openafs<1.6.6-2
options = !emptydirs
- source = http://openafs.org/dl/openafs/1.8.4/openafs-1.8.4-src.tar.bz2
- sha256sums = b18a654b8224bbefcff4e63ead312da2754aca17943ded60b9475062b506639a
+ source = http://openafs.org/dl/openafs/1.8.11/openafs-1.8.11-src.tar.bz2
+ source = 0001-afs-Make-afs_AllocDCache-static.patch
+ source = 0002-LINUX-Minor-osi_vfsop.c-cleanup.patch
+ source = 0003-afs-Remove-SRXAFSCB_GetDE.patch
+ source = 0004-afs-remove-dead-ICL-fstrace-code.patch
+ source = 0005-cf-Add-function-prototypes-for-linux-conftest.patch
+ source = 0006-afs-Remove-DFlushDCache.patch
+ source = 0007-afs-Remove-afs_MemExtendEntry.patch
+ source = 0008-afs-Remove-afs_osi_UnmaskUserLoop.patch
+ source = 0009-afs-Remove-dummy_PSetAcl.patch
+ source = 0010-afs-Remove-SRXAFSCB_FetchData-StoreData.patch
+ source = 0011-afs-Remove-afs_DbgDisconFiles.patch
+ source = 0012-afs-Add-declaration-for-RXAFS_ResidencyCmd.patch
+ source = 0013-roken-Declare-ct_memcmp-in-hcrypto-kernel-roken.h.patch
+ source = 0014-Linux-6.8-Add-function-prototypes-for-krb5.patch
+ source = 0015-afs-Declare-init_hckernel_mutex.patch
+ source = 0016-afs-Add-includes-to-pick-up-function-prototypes.patch
+ source = 0017-afs-Move-function-prototypes-into-headers.patch
+ source = 0018-afs-Add-afs_xioctl-prototyes-to-afs_prototypes.h.patch
+ source = 0019-afs-Remove-SRXAFSCB-protos-from-afs_prototypes.h.patch
+ source = 0020-rx-Add-function-prototypes-to-rx_prototypes.h.patch
+ source = 0021-afs-fix-ops-variable-may-be-used-uninitialized.patch
+ source = 0022-afs-Add-static-attribute-to-internal-functions.patch
+ source = 0023-rx-Add-static-attribute-to-internal-functions.patch
+ source = 0024-rxgen-Declare-generated-PKG_TranslateOpCode.patch
+ source = 0025-rxgen-Declare-generated-PKG_OpCodeStats.patch
+ source = 0026-Linux-6.8-use-hlist-iteration-for-dentry-children.patch
+ source = 0027-Linux-6.8-Remove-ctl_table-sentinels.patch
+ source = 0028-Linux-6.8-Use-roken-s-strlcpy-in-kernel-module.patch
+ source = 0029-afs-Drop-GLOCK-for-various-Rx-calls.patch
+ sha256sums = e2efb4710996b7d23198b53c56295a8f9e24e8a555317c5fc63b8125a3714ecd
+ sha256sums = e85f5656f76700e4236b1033cf4b7f08c59ab757d52d2a67dcb2c65762388733
+ sha256sums = 8d48b727e77b1e952310ad9f94bd4ece9e64e1f03a35463bb23dffa1009738d8
+ sha256sums = c44c91e31df1ec77f1a39eb7b172c4e348e41b293ae05606288bfe333ad7c29b
+ sha256sums = 48dd1065f8bcb90d0bdc7ae5b484da5a1a5d93461f6ac1d6ceef103d2b807f22
+ sha256sums = ce054eadb9c84173b0bd1318ef88cb9500049431779252e501491d9389141bad
+ sha256sums = ae525167f5f6f7e0301eee70b3424e51e45e56e9fe9588b95cf72d5fa96717b9
+ sha256sums = 974861c174969591351c5fb4a47946e02f979c2b5590f89d9d16dfbe4238451f
+ sha256sums = e5d72b5e08c63df10299b56bfebf3c5c44e07d16c0436fb2c0eef3614ad505e3
+ sha256sums = 8143496d251dd1f13b8603b4e692fbd67f925caccd12035598e70542d24389f5
+ sha256sums = 216e684f8181adc4a4b3c4ba934997cada10831c5608e724e91d09e836ec626d
+ sha256sums = 2e573535da21f8be5b83c8e82166c0bdc5896293b28e793fa4c1bdb9ff942dbd
+ sha256sums = 0535fbdd3c8431b7b16842f1fa6592355f647ae456112e97d34d541e74204be5
+ sha256sums = 7aacef8bd6832f119472f7d52af36951a56f1e54d36d9bce59998fcf818517e5
+ sha256sums = 3db5177c80a7694c1be3b74f419570a5076edc519b40112cf17e68fecc7574a3
+ sha256sums = 9fe647d54c999e358597fe671dc7e88da609a69bb93624e15919d9b4cc4fdb5a
+ sha256sums = 7ced2ca2d4f54b2fa15c584869de122810ee0d1b024d1bf541f38d77172e311c
+ sha256sums = c88c8b8e1c993da773eea3ae4f17e5171189ed7e1fc5769fdb49d82cae0cffd3
+ sha256sums = c57c826c9f26568241bcb17eff04067a1b5e388f72523765aa80d480c3690325
+ sha256sums = d508dd6136170fcb4794e283178f9c5f4ede12f415b882ba7c13470e8f09bdde
+ sha256sums = 894eb7e7889749cefa9cbf86e2eceda470d20510a5a7a5be2cd851f8570e076c
+ sha256sums = fb36b0ef833811910cae42d8411a00dcf2aff08c8799f766e32cda3ad5a7f0e2
+ sha256sums = d08d38ff53890632900de5d69dc105711d5bce2d02a55ffe70c87b38ca39aca7
+ sha256sums = db700b5f62e979af60856278306e8fce6df21dfb24996dd0d690c82222f4d793
+ sha256sums = 46294f8323bf71ee96c8f765bb36fc5e0af6b2257deac7eaea4f4cb9568d9fe1
+ sha256sums = 5d4a2614065046a32ef805198349e70476d3ed9e079a4ef7577e71e0dac1d2fa
+ sha256sums = 4c8201265f558bac146bf8cee38f8c925b2c2262133ae88d9eb2f0623a0ada07
+ sha256sums = ceb02a7a5e596434215693f065ad6221f568f85aab173df4752248d2c4d8f971
+ sha256sums = 2b05242c5516871191a251a617c6c02e80f34b92b6cfeb0c9c6a1f3e0ff915d9
+ sha256sums = 82b197ac5f2639d891c8a646963ef6b87ef4171c7a70ac6ca7a9a55511090952
pkgname = openafs-modules
-
diff --git a/0001-afs-Make-afs_AllocDCache-static.patch b/0001-afs-Make-afs_AllocDCache-static.patch
new file mode 100644
index 000000000000..ebbc523a5f38
--- /dev/null
+++ b/0001-afs-Make-afs_AllocDCache-static.patch
@@ -0,0 +1,35 @@
+From 78e644655a3858113f33f534d018220ab2eaabc0 Mon Sep 17 00:00:00 2001
+From: Andrew Deason <adeason@sinenomine.net>
+Date: Thu, 28 Jun 2018 12:50:52 -0500
+Subject: [PATCH 01/29] afs: Make afs_AllocDCache static
+
+Nothing using afs_AllocDCache outside of afs_dcache.c. Declare the
+function static, to ensure that nobody else uses it, and to maybe
+allow for more compiler optimization.
+
+Reviewed-on: https://gerrit.openafs.org/13226
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
+(cherry picked from commit 4ab70de9641807bd06056f0c1ac79550453b9574)
+
+Change-Id: I6fd9e31c4b2e862174402f731a77c91599893223
+---
+ src/afs/afs_dcache.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/afs/afs_dcache.c b/src/afs/afs_dcache.c
+index 3572f2f23..46d0bdba5 100644
+--- a/src/afs/afs_dcache.c
++++ b/src/afs/afs_dcache.c
+@@ -1674,7 +1674,7 @@ afs_AllocDiscardDSlot(afs_int32 lock)
+ *
+ * \return The new dcache.
+ */
+-struct dcache *
++static struct dcache *
+ afs_AllocDCache(struct vcache *avc, afs_int32 chunk, afs_int32 lock,
+ struct VenusFid *ashFid)
+ {
+--
+2.44.0
+
diff --git a/0002-LINUX-Minor-osi_vfsop.c-cleanup.patch b/0002-LINUX-Minor-osi_vfsop.c-cleanup.patch
new file mode 100644
index 000000000000..252cea0db5da
--- /dev/null
+++ b/0002-LINUX-Minor-osi_vfsop.c-cleanup.patch
@@ -0,0 +1,80 @@
+From 2f5309a7fa3ee187c18a8930b96e89e4e31cf03e Mon Sep 17 00:00:00 2001
+From: Andrew Deason <adeason@sinenomine.net>
+Date: Tue, 24 Jul 2018 23:22:01 -0500
+Subject: [PATCH 02/29] LINUX: Minor osi_vfsop.c cleanup
+
+- Fix the formatting on afs_mount/afs_get_sb definitions
+
+- Declare a couple of functions static that are not referenced outside
+ of this file
+
+Reviewed-on: https://gerrit.openafs.org/13282
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
+(cherry picked from commit fa15fbda0aa0c3810695d9b867d3258b60e76b7c)
+
+Change-Id: I8a32475bf2ddb9c7206aef679947021925697c5a
+---
+ src/afs/LINUX/osi_vfsops.c | 15 +++++++++------
+ 1 file changed, 9 insertions(+), 6 deletions(-)
+
+diff --git a/src/afs/LINUX/osi_vfsops.c b/src/afs/LINUX/osi_vfsops.c
+index b85ab3fdf..bb49a5ce2 100644
+--- a/src/afs/LINUX/osi_vfsops.c
++++ b/src/afs/LINUX/osi_vfsops.c
+@@ -40,7 +40,7 @@ extern struct dentry_operations afs_dentry_operations;
+
+ /* Forward declarations */
+ static int afs_root(struct super_block *afsp);
+-int afs_fill_super(struct super_block *sb, void *data, int silent);
++static int afs_fill_super(struct super_block *sb, void *data, int silent);
+
+
+ /*
+@@ -52,19 +52,22 @@ int afs_fill_super(struct super_block *sb, void *data, int silent);
+ #if defined(STRUCT_FILE_SYSTEM_TYPE_HAS_MOUNT)
+ static struct dentry *
+ afs_mount(struct file_system_type *fs_type, int flags,
+- const char *dev_name, void *data) {
++ const char *dev_name, void *data)
++{
+ return mount_nodev(fs_type, flags, data, afs_fill_super);
+ }
+ #elif defined(GET_SB_HAS_STRUCT_VFSMOUNT)
+ static int
+ afs_get_sb(struct file_system_type *fs_type, int flags,
+- const char *dev_name, void *data, struct vfsmount *mnt) {
++ const char *dev_name, void *data, struct vfsmount *mnt)
++{
+ return get_sb_nodev(fs_type, flags, data, afs_fill_super, mnt);
+ }
+ #else
+ static struct super_block *
+ afs_get_sb(struct file_system_type *fs_type, int flags,
+- const char *dev_name, void *data) {
++ const char *dev_name, void *data)
++{
+ return get_sb_nodev(fs_type, flags, data, afs_fill_super);
+ }
+ #endif
+@@ -83,7 +86,7 @@ struct file_system_type afs_fs_type = {
+
+ struct backing_dev_info *afs_backing_dev_info;
+
+-int
++static int
+ afs_fill_super(struct super_block *sb, void *data, int silent)
+ {
+ int code = 0;
+@@ -372,7 +375,7 @@ afs_put_super(struct super_block *sbp)
+ * statp is in user space, so we need to cobble together a statfs, then
+ * copy it.
+ */
+-int
++static int
+ #if defined(STATFS_TAKES_DENTRY)
+ afs_statfs(struct dentry *dentry, struct kstatfs *statp)
+ #else
+--
+2.44.0
+
diff --git a/0003-afs-Remove-SRXAFSCB_GetDE.patch b/0003-afs-Remove-SRXAFSCB_GetDE.patch
new file mode 100644
index 000000000000..873bc45ee037
--- /dev/null
+++ b/0003-afs-Remove-SRXAFSCB_GetDE.patch
@@ -0,0 +1,52 @@
+From fb336c461e9c212d450ce5e00890e8bbb2d9a4f7 Mon Sep 17 00:00:00 2001
+From: Andrew Deason <adeason@sinenomine.net>
+Date: Sat, 9 Jan 2021 12:50:03 -0600
+Subject: [PATCH 03/29] afs: Remove SRXAFSCB_GetDE
+
+The GetDE RPC has been commented out from afscbint.xg effectively
+since it was introduced, but we still define the SRXAFSCB_GetDE server
+stub for it.
+
+This is useless, but also potentially dangerous, since the stub
+routine just returns success, without populating the output arguments.
+One of the output arguments is a string, and so if this RPC is
+actually run, the rxgen-generated server code will try to xdr_string()
+that string. Since we never set it to anything, this will result in
+xdr_string trying to dereference a NULL pointer.
+
+None of this actually happens currently, since the GetDE RPC is
+commented out. But to avoid the above situation if it's ever
+uncommented, remove the useless SRXAFSCB_GetDE function.
+
+Reviewed-on: https://gerrit.openafs.org/14488
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
+(cherry picked from commit 444a971edc47c34efbefed6e332ee6e843ae072b)
+
+Change-Id: I83846d79ce3143571923cb6023075620091f093d
+---
+ src/afs/afs_callback.c | 11 -----------
+ 1 file changed, 11 deletions(-)
+
+diff --git a/src/afs/afs_callback.c b/src/afs/afs_callback.c
+index e7d8ab5d4..22edefb3f 100644
+--- a/src/afs/afs_callback.c
++++ b/src/afs/afs_callback.c
+@@ -1636,14 +1636,3 @@ SRXAFSCB_TellMeAboutYourself(struct rx_call *a_call,
+
+ return code;
+ }
+-
+-
+-int
+-SRXAFSCB_GetDE(struct rx_call *a_call, afs_int32 a_index, afs_int32 *addr,
+- afs_int32 *inode, afs_int32 *flags, afs_int32 *time,
+- char ** fileName)
+-{ /*SRXAFSCB_GetDE*/
+- int code = 0; /*Return code*/
+- return(code);
+-
+-} /*SRXAFSCB_GetDE*/
+--
+2.44.0
+
diff --git a/0004-afs-remove-dead-ICL-fstrace-code.patch b/0004-afs-remove-dead-ICL-fstrace-code.patch
new file mode 100644
index 000000000000..f6e079895fb1
--- /dev/null
+++ b/0004-afs-remove-dead-ICL-fstrace-code.patch
@@ -0,0 +1,265 @@
+From 7d45e9f76541e2d0b57984b9ba272a86bbd9791b Mon Sep 17 00:00:00 2001
+From: Mark Vitale <mvitale@sinenomine.net>
+Date: Thu, 11 Mar 2021 15:36:54 -0500
+Subject: [PATCH 04/29] afs: remove dead ICL (fstrace) code
+
+The ICL code (afs/afs_icl.c) which supports fstrace includes a number of
+functions that have been dead code since the original IBM code import.
+Some of these seem to have been intended to support fine-grained event
+tracing, but the implementation was never completed.
+
+Remove the dead code. No functional change is incurred by this commit.
+
+Reviewed-on: https://gerrit.openafs.org/14555
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
+(cherry picked from commit ba58d9912cff07a6f2af7275017cf70115f1a88d)
+
+Change-Id: Ic0a6d5dac200e7e130fa8df66005bdaf291cf088
+---
+ src/afs/afs_icl.c | 147 ---------------------------------------
+ src/afs/afs_prototypes.h | 19 -----
+ 2 files changed, 166 deletions(-)
+
+diff --git a/src/afs/afs_icl.c b/src/afs/afs_icl.c
+index 8d09113dc..42b4a0ccb 100644
+--- a/src/afs/afs_icl.c
++++ b/src/afs/afs_icl.c
+@@ -538,18 +538,6 @@ afs_icl_AppendString(struct afs_icl_log *logp, char *astr)
+ #define ICL_APPENDLONG(lp, x) ICL_APPENDINT32((lp), (x))
+ #endif
+
+-/* routine to tell whether we're dealing with the address or the
+- * object itself
+- */
+-int
+-afs_icl_UseAddr(int type)
+-{
+- if (type == ICL_TYPE_HYPER || type == ICL_TYPE_STRING
+- || type == ICL_TYPE_FID || type == ICL_TYPE_INT64)
+- return 1;
+- else
+- return 0;
+-}
+
+ void
+ afs_icl_AppendOne(struct afs_icl_log *logp, int type, long parm)
+@@ -884,19 +872,6 @@ afs_icl_CopyOut(struct afs_icl_log *logp, afs_int32 * bufferp,
+ return code;
+ }
+
+-/* return basic parameter information about a log */
+-int
+-afs_icl_GetLogParms(struct afs_icl_log *logp, afs_int32 * maxSizep,
+- afs_int32 * curSizep)
+-{
+- ObtainReadLock(&logp->lock);
+- *maxSizep = logp->logSize;
+- *curSizep = logp->logElements;
+- ReleaseReadLock(&logp->lock);
+- return 0;
+-}
+-
+-
+ /* hold and release logs */
+ int
+ afs_icl_LogHold(struct afs_icl_log *logp)
+@@ -907,14 +882,6 @@ afs_icl_LogHold(struct afs_icl_log *logp)
+ return 0;
+ }
+
+-/* hold and release logs, called with lock already held */
+-int
+-afs_icl_LogHoldNL(struct afs_icl_log *logp)
+-{
+- logp->refCount++;
+- return 0;
+-}
+-
+ /* keep track of how many sets believe the log itself is allocated */
+ int
+ afs_icl_LogUse(struct afs_icl_log *logp)
+@@ -1070,32 +1037,6 @@ afs_icl_FindLog(char *name)
+ return tp;
+ }
+
+-int
+-afs_icl_EnumerateLogs(int (*aproc)
+- (char *name, char *arock, struct afs_icl_log * tp),
+- char *arock)
+-{
+- struct afs_icl_log *tp;
+- afs_int32 code;
+-
+- code = 0;
+- ObtainWriteLock(&afs_icl_lock, 195);
+- for (tp = afs_icl_allLogs; tp; tp = tp->nextp) {
+- tp->refCount++; /* hold this guy */
+- ReleaseWriteLock(&afs_icl_lock);
+- ObtainReadLock(&tp->lock);
+- code = (*aproc) (tp->name, arock, tp);
+- ReleaseReadLock(&tp->lock);
+- ObtainWriteLock(&afs_icl_lock, 196);
+- if (--tp->refCount == 0)
+- afs_icl_ZapLog(tp);
+- if (code)
+- break;
+- }
+- ReleaseWriteLock(&afs_icl_lock);
+- return code;
+-}
+-
+ struct afs_icl_set *afs_icl_allSets = 0;
+
+ int
+@@ -1198,46 +1139,6 @@ afs_icl_CreateSetWithFlags(char *name, struct afs_icl_log *baseLogp,
+ return 0;
+ }
+
+-/* function to change event enabling information for a particular set */
+-int
+-afs_icl_SetEnable(struct afs_icl_set *setp, afs_int32 eventID, int setValue)
+-{
+- char *tp;
+-
+- ObtainWriteLock(&setp->lock, 200);
+- if (!ICL_EVENTOK(setp, eventID)) {
+- ReleaseWriteLock(&setp->lock);
+- return -1;
+- }
+- tp = &setp->eventFlags[ICL_EVENTBYTE(eventID)];
+- if (setValue)
+- *tp |= ICL_EVENTMASK(eventID);
+- else
+- *tp &= ~(ICL_EVENTMASK(eventID));
+- ReleaseWriteLock(&setp->lock);
+- return 0;
+-}
+-
+-/* return indication of whether a particular event ID is enabled
+- * for tracing. If *getValuep is set to 0, the event is disabled,
+- * otherwise it is enabled. All events start out enabled by default.
+- */
+-int
+-afs_icl_GetEnable(struct afs_icl_set *setp, afs_int32 eventID, int *getValuep)
+-{
+- ObtainReadLock(&setp->lock);
+- if (!ICL_EVENTOK(setp, eventID)) {
+- ReleaseWriteLock(&setp->lock);
+- return -1;
+- }
+- if (setp->eventFlags[ICL_EVENTBYTE(eventID)] & ICL_EVENTMASK(eventID))
+- *getValuep = 1;
+- else
+- *getValuep = 0;
+- ReleaseReadLock(&setp->lock);
+- return 0;
+-}
+-
+ /* hold and release event sets */
+ int
+ afs_icl_SetHold(struct afs_icl_set *setp)
+@@ -1340,54 +1241,6 @@ afs_icl_ZeroSet(struct afs_icl_set *setp)
+ return code;
+ }
+
+-int
+-afs_icl_EnumerateSets(int (*aproc)
+- (char *name, char *arock, struct afs_icl_log * tp),
+- char *arock)
+-{
+- struct afs_icl_set *tp, *np;
+- afs_int32 code;
+-
+- code = 0;
+- ObtainWriteLock(&afs_icl_lock, 205);
+- for (tp = afs_icl_allSets; tp; tp = np) {
+- tp->refCount++; /* hold this guy */
+- ReleaseWriteLock(&afs_icl_lock);
+- code = (*aproc) (tp->name, arock, (struct afs_icl_log *)tp);
+- ObtainWriteLock(&afs_icl_lock, 206);
+- np = tp->nextp; /* tp may disappear next, but not np */
+- if (--tp->refCount == 0 && (tp->states & ICL_SETF_DELETED))
+- afs_icl_ZapSet(tp);
+- if (code)
+- break;
+- }
+- ReleaseWriteLock(&afs_icl_lock);
+- return code;
+-}
+-
+-int
+-afs_icl_AddLogToSet(struct afs_icl_set *setp, struct afs_icl_log *newlogp)
+-{
+- int i;
+- int code = -1;
+-
+- ObtainWriteLock(&setp->lock, 207);
+- for (i = 0; i < ICL_LOGSPERSET; i++) {
+- if (!setp->logs[i]) {
+- setp->logs[i] = newlogp;
+- code = i;
+- afs_icl_LogHold(newlogp);
+- if (!(setp->states & ICL_SETF_FREED)) {
+- /* bump up the number of sets using the log */
+- afs_icl_LogUse(newlogp);
+- }
+- break;
+- }
+- }
+- ReleaseWriteLock(&setp->lock);
+- return code;
+-}
+-
+ int
+ afs_icl_SetSetStat(struct afs_icl_set *setp, int op)
+ {
+diff --git a/src/afs/afs_prototypes.h b/src/afs/afs_prototypes.h
+index e9a655e65..ed43635aa 100644
+--- a/src/afs/afs_prototypes.h
++++ b/src/afs/afs_prototypes.h
+@@ -364,10 +364,7 @@ extern int afs_icl_CreateLogWithFlags(char *name, afs_int32 logSize,
+ extern int afs_icl_CopyOut(struct afs_icl_log *logp,
+ afs_int32 * bufferp, afs_int32 * bufSizep,
+ afs_uint32 * cookiep, afs_int32 * flagsp);
+-extern int afs_icl_GetLogParms(struct afs_icl_log *logp, afs_int32 * maxSizep,
+- afs_int32 * curSizep);
+ extern int afs_icl_LogHold(struct afs_icl_log *logp);
+-extern int afs_icl_LogHoldNL(struct afs_icl_log *logp);
+ extern int afs_icl_LogUse(struct afs_icl_log *logp);
+ extern int afs_icl_LogFreeUse(struct afs_icl_log *logp);
+ extern int afs_icl_LogSetSize(struct afs_icl_log *logp,
+@@ -378,11 +375,6 @@ extern int afs_icl_LogReleNL(struct afs_icl_log *logp);
+ extern int afs_icl_ZeroLog(struct afs_icl_log *logp);
+ extern int afs_icl_LogFree(struct afs_icl_log *logp);
+ extern struct afs_icl_log *afs_icl_FindLog(char *name);
+-extern int
+- afs_icl_EnumerateLogs(int (*aproc)
+-
+- (char *name, char *arock, struct afs_icl_log * tp),
+- char *arock);
+ extern int afs_icl_CreateSet(char *name, struct afs_icl_log *baseLogp,
+ struct afs_icl_log *fatalLogp,
+ struct afs_icl_set **outSetpp);
+@@ -391,18 +383,7 @@ extern int afs_icl_CreateSetWithFlags(char *name,
+ struct afs_icl_log *fatalLogp,
+ afs_uint32 flags,
+ struct afs_icl_set **outSetpp);
+-extern int afs_icl_SetEnable(struct afs_icl_set *setp, afs_int32 eventID,
+- int setValue);
+-extern int afs_icl_GetEnable(struct afs_icl_set *setp, afs_int32 eventID,
+- int *getValuep);
+ extern int afs_icl_ZeroSet(struct afs_icl_set *setp);
+-extern int
+- afs_icl_EnumerateSets(int (*aproc)
+-
+- (char *name, char *arock, struct afs_icl_log * tp),
+- char *arock);
+-extern int afs_icl_AddLogToSet(struct afs_icl_set *setp,
+- struct afs_icl_log *newlogp);
+ extern int afs_icl_SetSetStat(struct afs_icl_set *setp, int op);
+ extern int afs_icl_SetHold(struct afs_icl_set *setp);
+ extern int afs_icl_ZapSet(struct afs_icl_set *setp);
+--
+2.44.0
+
diff --git a/0005-cf-Add-function-prototypes-for-linux-conftest.patch b/0005-cf-Add-function-prototypes-for-linux-conftest.patch
new file mode 100644
index 000000000000..75f365179b57
--- /dev/null
+++ b/0005-cf-Add-function-prototypes-for-linux-conftest.patch
@@ -0,0 +1,108 @@
+From 55e30ae5560063b8141b3696b0c67f355dcefc54 Mon Sep 17 00:00:00 2001
+From: Cheyenne Wills <cwills@sinenomine.net>
+Date: Wed, 7 Feb 2024 14:51:23 -0700
+Subject: [PATCH 05/29] cf: Add function prototypes for linux conftest
+
+The Linux 6.8 commit:
+ 'Makefile.extrawarn: turn on missing-prototypes globally' (0fcb70851f)
+
+added the compiler flags -Wmissing-declarations and -Wmissing-prototypes
+as defaults for all kernel modules builds. This change causes configure
+to fail for various Linux kernel tests.
+
+Update the template used to create the conftest.c file to provide a
+function declaration for conftest().
+
+Use a 'static' attribute when defining functions used within tests.
+
+Note: 2 configure tests (LINUX_INIT_WORK_AS_DATA and
+LINUX_IOP_CREATE_TAKES_MODE_T) defined nested functions. Relocate the
+nested functions to outside the body of conftest() to avoid compiler
+errors due to nested function definitions.
+
+Reviewed-on: https://gerrit.openafs.org/15614
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Andrew Deason <adeason@sinenomine.net>
+Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
+(cherry picked from commit 1440843b80e28db908bd8c264b8adbfb2c95b4d9)
+
+Change-Id: I38acb7b0cb08dec8e9bca5f3792fbf981884a74c
+---
+ src/cf/linux-test1.m4 | 4 ++--
+ src/cf/linux-test4.m4 | 16 ++++++++--------
+ 2 files changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/src/cf/linux-test1.m4 b/src/cf/linux-test1.m4
+index 7bb5a677c..010a4464f 100644
+--- a/src/cf/linux-test1.m4
++++ b/src/cf/linux-test1.m4
+@@ -16,7 +16,7 @@ _ACEOF
+ /* end confdefs.h */
+ #include <linux/module.h>
+ $1
+-
++void conftest(void);
+ void conftest(void)
+ {
+ $2
+@@ -201,7 +201,7 @@ AC_DEFUN([AC_CHECK_LINUX_OPERATION],
+ CPPFLAGS="$CPPFLAGS -Werror"
+ AC_TRY_KBUILD(
+ [$4
+- $5 op($6) { return ($5)0; };],
++ static $5 op($6) { return ($5)0; };],
+ [static struct $1 ops; ops.$2 = op;],
+ AS_VAR_SET([ac_linux_operation], [yes]),
+ AS_VAR_SET([ac_linux_operation], [no]))
+diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4
+index 3596b6aad..7889c904a 100644
+--- a/src/cf/linux-test4.m4
++++ b/src/cf/linux-test4.m4
+@@ -400,9 +400,9 @@ AC_DEFUN([LINUX_INIT_WORK_HAS_DATA], [
+ AC_CHECK_LINUX_BUILD([whether INIT_WORK has a _data argument],
+ [ac_cv_linux_init_work_has_data],
+ [#include <linux/kernel.h>
+-#include <linux/workqueue.h>],
+-[
+-void f(struct work_struct *w) {}
++#include <linux/workqueue.h>
++static void f(struct work_struct *w) {}],
++[
+ struct work_struct *w;
+ int *i;
+ INIT_WORK(w,f,i);],
+@@ -493,7 +493,7 @@ AC_DEFUN([LINUX_KMEM_CACHE_CREATE_CTOR_TAKES_VOID],[
+ AC_CHECK_LINUX_BUILD([whether kmem_cache_create constructor takes a void pointer],
+ [ac_cv_linux_kmem_cache_create_ctor_takes_void],
+ [#include <linux/slab.h>
+- void _ctor(void *v) { };],
++ static void _ctor(void *v) { };],
+ [kmem_cache_create(NULL, 0, 0, 0, _ctor);],
+ [KMEM_CACHE_CTOR_TAKES_VOID],
+ [define if kmem_cache_create constructor takes a single void ptr],
+@@ -667,7 +667,7 @@ AC_DEFUN([LINUX_IOP_GETATTR_TAKES_PATH_STRUCT], [
+ AC_CHECK_LINUX_BUILD([whether 4.11+ inode.i_op->getattr takes a struct path argument],
+ [ac_cv_linux_iop_getattr_takes_path_struct],
+ [#include <linux/fs.h>
+- int _getattr(const struct path *path, struct kstat *stat, u32 request_mask,
++ static int _getattr(const struct path *path, struct kstat *stat, u32 request_mask,
+ unsigned int sync_mode) {return 0;};
+ struct inode_operations _i_ops;],
+ [_i_ops.getattr = _getattr;],
+@@ -692,10 +692,10 @@ AC_DEFUN([LINUX_IOP_MKDIR_TAKES_UMODE_T], [
+ AC_DEFUN([LINUX_IOP_CREATE_TAKES_UMODE_T], [
+ AC_CHECK_LINUX_BUILD([whether inode.i_op->create takes a umode_t argument],
+ [ac_cv_linux_iop_create_takes_umode_t],
+- [#include <linux/fs.h>],
++ [#include <linux/fs.h>
++ static int _create(struct inode *i, struct dentry *d, umode_t m, struct nameidata *n)
++ {return 0;};],
+ [static struct inode_operations _i_ops;
+- int _create(struct inode *i, struct dentry *d, umode_t m, struct nameidata *n)
+- {return 0;};
+ _i_ops.create = _create;],
+ [IOP_CREATE_TAKES_UMODE_T],
+ [define if inode.i_op->create takes a umode_t argument],
+--
+2.44.0
+
diff --git a/0006-afs-Remove-DFlushDCache.patch b/0006-afs-Remove-DFlushDCache.patch
new file mode 100644
index 000000000000..b49f122e542a
--- /dev/null
+++ b/0006-afs-Remove-DFlushDCache.patch
@@ -0,0 +1,72 @@
+From 177c84e86d65936636a4db5548f4424f04a1b33c Mon Sep 17 00:00:00 2001
+From: Cheyenne Wills <cwills@sinenomine.net>
+Date: Fri, 12 Jan 2024 08:56:31 -0700
+Subject: [PATCH 06/29] afs: Remove DFlushDCache()
+
+The function DFlushDcache() is not referenced anywhere within the
+source tree.
+
+Remove the function DFlushDCache().
+
+The commit: 'disconnected-shadow-directory-fixes-20090121' (4045f3d535)
+removed the code reference to DFlushDCache() and the commit:
+"dir: Prototype and function name cleanup" (5ad1e6cb90) removed the
+function prototype. The function was introduced in the commit:
+"disconnected-flush-before-shadowing-20090119" (e1cc987ea5).
+
+This function is flagged due to a missing prototype when building
+against a Linux 6.8 kernel (which sets the -Wmissing-declarations and
+-Wmissing-prototypes compiler flags as default). Linux 6.8 commit:
+ "Makefile.extrawarn: turn on missing-prototypes globally" (0fcb70851f).
+
+When building against a kernel with CONFIG_WERROR=y, the build fails.
+
+Reviewed-on: https://gerrit.openafs.org/15615
+Tested-by: Benjamin Kaduk <kaduk@mit.edu>
+Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
+(cherry picked from commit 432ac5810e51bb5bb2cf1df0bfebc64d1c4d7a39)
+
+Change-Id: Ib8ab79c76c633632215e02235f47fdb1d744e721
+---
+ src/afs/afs_buffer.c | 25 -------------------------
+ 1 file changed, 25 deletions(-)
+
+diff --git a/src/afs/afs_buffer.c b/src/afs/afs_buffer.c
+index 5552d1c21..9538c6806 100644
+--- a/src/afs/afs_buffer.c
++++ b/src/afs/afs_buffer.c
+@@ -516,31 +516,6 @@ DFlushBuffer(struct buffer *ab)
+ afs_CFileClose(tfile);
+ }
+
+-void
+-DFlushDCache(struct dcache *adc)
+-{
+- int i;
+- struct buffer *tb;
+-
+- ObtainReadLock(&afs_bufferLock);
+-
+- for (i = 0; i <= PHPAGEMASK; i++)
+- for (tb = phTable[pHash(adc->index, i)]; tb; tb = tb->hashNext)
+- if (tb->fid == adc->index) {
+- ObtainWriteLock(&tb->lock, 701);
+- tb->lockers++;
+- ReleaseReadLock(&afs_bufferLock);
+- if (tb->dirty) {
+- DFlushBuffer(tb);
+- }
+- tb->lockers--;
+- ReleaseWriteLock(&tb->lock);
+- ObtainReadLock(&afs_bufferLock);
+- }
+-
+- ReleaseReadLock(&afs_bufferLock);
+-}
+-
+ int
+ DFlush(void)
+ {
+--
+2.44.0
+
diff --git a/0007-afs-Remove-afs_MemExtendEntry.patch b/0007-afs-Remove-afs_MemExtendEntry.patch
new file mode 100644
index 000000000000..2936ed094d7c
--- /dev/null
+++ b/0007-afs-Remove-afs_MemExtendEntry.patch
@@ -0,0 +1,58 @@
+From ca64798e8baf3378e3cc7a619b9e02a715a39ddc Mon Sep 17 00:00:00 2001
+From: Cheyenne Wills <cwills@sinenomine.net>
+Date: Fri, 12 Jan 2024 09:09:39 -0700
+Subject: [PATCH 07/29] afs: Remove afs_MemExtendEntry()
+
+The function afs_MemExtendEntry() is not referenced anywhere within
+the source tree.
+
+Remove the function afs_MemExtendEntry().
+
+The commit: 'memcache: add extend-entry function' (f821c7e5c8)
+introduced the function, but afs_MemExtendEntry() has never been
+referenced or defined within a header file.
+
+This function is flagged due to a missing prototype when building
+against a Linux 6.8 kernel (which sets the -Wmissing-declarations and
+-Wmissing-prototypes compiler flags as default). Linux 6.8 commit:
+ 'Makefile.extrawarn: turn on missing-prototypes globally' (0fcb70851f).
+
+When building against a kernel with CONFIG_WERROR=y, the build fails.
+
+Note, afsMemExtendedEntry() was a wrapper for the function
+_afs_MemExtendedEntry(), which is still used.
+
+Reviewed-on: https://gerrit.openafs.org/15616
+Tested-by: Benjamin Kaduk <kaduk@mit.edu>
+Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
+(cherry picked from commit eab2a4ae758876bb7547d289f936f9cfc4227cf5)
+
+Change-Id: I37f241a6df33ab15249c6708d5ca820353c8b413
+---
+ src/afs/afs_memcache.c | 10 ----------
+ 1 file changed, 10 deletions(-)
+
+diff --git a/src/afs/afs_memcache.c b/src/afs/afs_memcache.c
+index 936cbe927..419083da2 100644
+--- a/src/afs/afs_memcache.c
++++ b/src/afs/afs_memcache.c
+@@ -302,16 +302,6 @@ afs_MemCacheTruncate(struct osi_file *fP, int size)
+ return 0;
+ }
+
+-int
+-afs_MemExtendEntry(struct memCacheEntry *mceP, afs_uint32 size)
+-{
+- int code = 0;
+- ObtainWriteLock(&mceP->afs_memLock, 560);
+- code = _afs_MemExtendEntry(mceP, size);
+- ReleaseWriteLock(&mceP->afs_memLock);
+- return code;
+-}
+-
+ void
+ shutdown_memcache(void)
+ {
+--
+2.44.0
+
diff --git a/0008-afs-Remove-afs_osi_UnmaskUserLoop.patch b/0008-afs-Remove-afs_osi_UnmaskUserLoop.patch
new file mode 100644
index 000000000000..635f1ac7aadf
--- /dev/null
+++ b/0008-afs-Remove-afs_osi_UnmaskUserLoop.patch
@@ -0,0 +1,54 @@
+From fb3a69c84ced6db6aa9aeb506bfb64ac18745a92 Mon Sep 17 00:00:00 2001
+From: Cheyenne Wills <cwills@sinenomine.net>
+Date: Fri, 12 Jan 2024 09:13:27 -0700
+Subject: [PATCH 08/29] afs: Remove afs_osi_UnmaskUserLoop()
+
+The function afs_osi_UnmaskUserLoop() is not referenced anywhere within
+the source tree.
+
+Remove the function afs_osi_UnmaskUserLoop().
+
+The commit: 'darwin-afsdb-handler-signal-mask-20040728' (9728182c00)
+introduced the function, but afs_osi_UnmaskUserLoop() has never been
+referenced or defined within a header file.
+
+This function is flagged due to a missing prototype when building
+against a Linux 6.8 kernel (which sets the -Wmissing-declarations and
+-Wmissing-prototypes compiler flags as default). Linux 6.8 commit:
+ 'Makefile.extrawarn: turn on missing-prototypes globally' (0fcb70851f).
+
+When building against a kernel with CONFIG_WERROR=y, the build fails.
+
+Reviewed-on: https://gerrit.openafs.org/15617
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Andrew Deason <adeason@sinenomine.net>
+Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
+(cherry picked from commit 587cfce29cb4e014e5b8d96e0433c5e7d2c6729a)
+
+Change-Id: I0fe91a41e8f00773cb1d5976a8c3e39e4415f6bc
+---
+ src/afs/afs_osi.c | 8 --------
+ 1 file changed, 8 deletions(-)
+
+diff --git a/src/afs/afs_osi.c b/src/afs/afs_osi.c
+index 18732d1a3..6f54c63c7 100644
+--- a/src/afs/afs_osi.c
++++ b/src/afs/afs_osi.c
+@@ -152,14 +152,6 @@ afs_osi_MaskUserLoop(void)
+ #endif
+ }
+
+-void
+-afs_osi_UnmaskUserLoop(void)
+-{
+-#ifdef AFS_DARWIN_ENV
+- afs_osi_fullSigRestore();
+-#endif
+-}
+-
+ /* register rxk listener proc info */
+ void
+ afs_osi_RxkRegister(void)
+--
+2.44.0
+
diff --git a/0009-afs-Remove-dummy_PSetAcl.patch b/0009-afs-Remove-dummy_PSetAcl.patch
new file mode 100644
index 000000000000..647734c08ca2
--- /dev/null
+++ b/0009-afs-Remove-dummy_PSetAcl.patch
@@ -0,0 +1,51 @@
+From bc446c8fa62df6ce9ab4be50b8b1da54901863ad Mon Sep 17 00:00:00 2001
+From: Cheyenne Wills <cwills@sinenomine.net>
+Date: Fri, 12 Jan 2024 09:28:02 -0700
+Subject: [PATCH 09/29] afs: Remove dummy_PSetAcl()
+
+The function dummy_PSetAcl() is not referenced anywhere within the
+source tree.
+
+Remove the function dummy_PSetAcl().
+
+The commit: 'doxygen-comments-20081010' (4b72f8765c)
+introduced the function, but dummy_PSetAcl() has never been referenced
+or defined within a header file.
+
+This function is flagged due to a missing prototype when building
+against a Linux 6.8 kernel (which sets the -Wmissing-declarations and
+-Wmissing-prototypes compiler flags as default). Linux 6.8 commit:
+ 'Makefile.extrawarn: turn on missing-prototypes globally' (0fcb70851f).
+
+When building against a kernel with CONFIG_WERROR=y, the build fails.
+
+Reviewed-on: https://gerrit.openafs.org/15618
+Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
+Tested-by: Benjamin Kaduk <kaduk@mit.edu>
+(cherry picked from commit 05ca98687d882c72915e91430e29a4f2a36c502c)
+
+Change-Id: Ie4420a365e07d2d8564530e004df75330e86bea5
+---
+ src/afs/afs_pioctl.c | 6 ------
+ 1 file changed, 6 deletions(-)
+
+diff --git a/src/afs/afs_pioctl.c b/src/afs/afs_pioctl.c
+index 9182a4b52..7ddb5add2 100644
+--- a/src/afs/afs_pioctl.c
++++ b/src/afs/afs_pioctl.c
+@@ -1426,12 +1426,6 @@ DECL_PIOCTL(PGetFID)
+ *
+ * \post Changed ACL, via direct writing to the wire
+ */
+-int
+-dummy_PSetAcl(char *ain, char *aout)
+-{
+- return 0;
+-}
+-
+ DECL_PIOCTL(PSetAcl)
+ {
+ afs_int32 code;
+--
+2.44.0
+
diff --git a/0010-afs-Remove-SRXAFSCB_FetchData-StoreData.patch b/0010-afs-Remove-SRXAFSCB_FetchData-StoreData.patch
new file mode 100644
index 000000000000..765c8256492b
--- /dev/null
+++ b/0010-afs-Remove-SRXAFSCB_FetchData-StoreData.patch
@@ -0,0 +1,132 @@
+From 2501655e438f65523f5250b26a2074bdbd56bc16 Mon Sep 17 00:00:00 2001
+From: Cheyenne Wills <cwills@sinenomine.net>
+Date: Thu, 8 Feb 2024 12:22:13 -0700
+Subject: [PATCH 10/29] afs: Remove SRXAFSCB_FetchData/StoreData
+
+Commit 'client-64bit-file-size-support-20011031' (971b18bc42) introduced
+the RPC functions SRXAFSCB_FetchData() and SRXAFSCB_StoreData with RPC
+numbers of 65536 and 65537 respectively.
+
+Commit 'more-64bit-file-size-support-20011031' (c5b1a3775f) removed the
+references from afscbint.xg, but did not remove the actual code. The
+65536 RPC number was reassigned to SRXAFSCB_GetCE64, and the commit:
+'This is mostly a rewrite of src/afs/afs_cell.c, and associated changes'
+(629d08065) assigned the 65537 RPC to SRXAFSCB_GetCellByNum.
+
+Remove the 2 functions since there are no references other than the
+prototype in afs_prototypes.h.
+
+This function is flagged due to a missing prototype when building
+against a Linux 6.8 kernel (which sets the -Wmissing-declarations and
+-Wmissing-prototypes compiler flags as default). Linux 6.8 commit:
+ 'Makefile.extrawarn: turn on missing-prototypes globally' (0fcb70851f).
+
+Reviewed-on: https://gerrit.openafs.org/15639
+Reviewed-by: Andrew Deason <adeason@sinenomine.net>
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
+(cherry picked from commit 379f7fc51d411990189ec28e48c91edc87d76120)
+
+Change-Id: I1a3539227d22e6df89d78245634dfeb14943035a
+---
+ src/afs/afs_callback.c | 65 ----------------------------------------
+ src/afs/afs_prototypes.h | 7 -----
+ 2 files changed, 72 deletions(-)
+
+diff --git a/src/afs/afs_callback.c b/src/afs/afs_callback.c
+index 22edefb3f..56e8cd2cc 100644
+--- a/src/afs/afs_callback.c
++++ b/src/afs/afs_callback.c
+@@ -1472,71 +1472,6 @@ SRXAFSCB_GetCacheConfig(struct rx_call *a_call, afs_uint32 callerVersion,
+ return 0;
+ }
+
+-/*------------------------------------------------------------------------
+- * EXPORTED SRXAFSCB_FetchData
+- *
+- * Description:
+- * Routine to do third party move from a remioserver to the original
+- * issuer of an ArchiveData request. Presently supported only by the
+- * "fs" command, not by the AFS client.
+- *
+- * Arguments:
+- * rxcall: Ptr to Rx call on which this request came in.
+- * Fid: pointer to AFSFid structure.
+- * Fd: File descriptor inside fs command.
+- * Position: Offset in the file.
+- * Length: Data length to transfer.
+- * TotalLength: Pointer to total file length field
+- *
+- * Returns:
+- * 0 on success
+- *
+- * Environment:
+- * Nothing interesting.
+- *
+- * Side Effects:
+- *------------------------------------------------------------------------*/
+-int
+-SRXAFSCB_FetchData(struct rx_call *rxcall, struct AFSFid *Fid, afs_int32 Fd,
+- afs_int64 Position, afs_int64 Length,
+- afs_int64 * TotalLength)
+-{
+- return ENOSYS;
+-}
+-
+-/*------------------------------------------------------------------------
+- * EXPORTED SRXAFSCB_StoreData
+- *
+- * Description:
+- * Routine to do third party move from a remioserver to the original
+- * issuer of a RetrieveData request. Presently supported only by the
+- * "fs" command, not by the AFS client.
+- *
+- * Arguments:
+- * rxcall: Ptr to Rx call on which this request came in.
+- * Fid: pointer to AFSFid structure.
+- * Fd: File descriptor inside fs command.
+- * Position: Offset in the file.
+- * Length: Data length to transfer.
+- * TotalLength: Pointer to total file length field
+- *
+- * Returns:
+- * 0 on success
+- *
+- * Environment:
+- * Nothing interesting.
+- *
+- * Side Effects:
+- * As advertised.
+- *------------------------------------------------------------------------*/
+-int
+-SRXAFSCB_StoreData(struct rx_call *rxcall, struct AFSFid *Fid, afs_int32 Fd,
+- afs_int64 Position, afs_int64 Length,
+- afs_int64 * TotalLength)
+-{
+- return ENOSYS;
+-}
+-
+ /*------------------------------------------------------------------------
+ * EXPORTED SRXAFSCB_GetCellByNum
+ *
+diff --git a/src/afs/afs_prototypes.h b/src/afs/afs_prototypes.h
+index ed43635aa..208bd0338 100644
+--- a/src/afs/afs_prototypes.h
++++ b/src/afs/afs_prototypes.h
+@@ -103,13 +103,6 @@ extern int SRXAFSCB_GetCacheConfig(struct rx_call *a_call,
+ afs_uint32 * serverVersion,
+ afs_uint32 * configCount,
+ cacheConfig * config);
+-extern int SRXAFSCB_FetchData(struct rx_call *rxcall, struct AFSFid *Fid,
+- afs_int32 Fd, afs_int64 Position,
+- afs_int64 Length, afs_int64 * TotalLength);
+-extern int SRXAFSCB_StoreData(struct rx_call *rxcall, struct AFSFid *Fid,
+- afs_int32 Fd, afs_int64 Position,
+- afs_int64 Length, afs_int64 * TotalLength);
+-
+
+ /* afs_cbqueue.c */
+ extern afs_rwlock_t afs_xcbhash;
+--
+2.44.0
+
diff --git a/0011-afs-Remove-afs_DbgDisconFiles.patch b/0011-afs-Remove-afs_DbgDisconFiles.patch
new file mode 100644
index 000000000000..ca60249b0327
--- /dev/null
+++ b/0011-afs-Remove-afs_DbgDisconFiles.patch
@@ -0,0 +1,76 @@
+From 3479efd57fb4ca488061301f2770905fd5c1d90f Mon Sep 17 00:00:00 2001
+From: Cheyenne Wills <cwills@sinenomine.net>
+Date: Thu, 8 Feb 2024 16:10:57 -0700
+Subject: [PATCH 11/29] afs: Remove afs_DbgDisconFiles()
+
+The function afs_DbgDisconFiles() is not referenced anywhere within the
+source tree.
+
+Remove the function afs_DbgDisconFiles().
+
+The commit: 'disconnected-rw-20080922' (433afd4779) introduced
+afs_DbgDisconFiles(), but the function was never used.
+
+This function is flagged due to a missing prototype when building
+against a Linux 6.8 kernel (which sets the -Wmissing-declarations and
+-Wmissing-prototypes compiler flags as default). Linux 6.8 commit:
+ 'Makefile.extrawarn: turn on missing-prototypes globally' (0fcb70851f).
+
+When building against a kernel with CONFIG_WERROR=y, the build fails.
+
+Reviewed-on: https://gerrit.openafs.org/15640
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Andrew Deason <adeason@sinenomine.net>
+Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
+(cherry picked from commit 32bb90047782f41df521bba5ab4aba8b4ed34203)
+
+Change-Id: I61d06515845dbb18a370f7856285596514242e99
+---
+ src/afs/afs_disconnected.c | 31 -------------------------------
+ 1 file changed, 31 deletions(-)
+
+diff --git a/src/afs/afs_disconnected.c b/src/afs/afs_disconnected.c
+index 3b8858539..1aaabd905 100644
+--- a/src/afs/afs_disconnected.c
++++ b/src/afs/afs_disconnected.c
+@@ -1334,37 +1334,6 @@ afs_DisconDiscardAll(afs_ucred_t *acred)
+ ReleaseWriteLock(&afs_disconDirtyLock);
+ }
+
+-/*!
+- * Print list of disconnected files.
+- *
+- * \note Call with afs_DDirtyVCListLock read locked.
+- */
+-void
+-afs_DbgDisconFiles(void)
+-{
+- struct vcache *tvc;
+- struct afs_q *q;
+- int i = 0;
+-
+- afs_warn("List of dirty files: \n");
+-
+- ObtainReadLock(&afs_disconDirtyLock);
+- for (q = QPrev(&afs_disconDirty); q != &afs_disconDirty; q = QPrev(q)) {
+- tvc = QEntry(q, struct vcache, dirtyq);
+-
+- afs_warn("Cell=%u Volume=%u VNode=%u Unique=%u\n",
+- tvc->f.fid.Cell,
+- tvc->f.fid.Fid.Volume,
+- tvc->f.fid.Fid.Vnode,
+- tvc->f.fid.Fid.Unique);
+-
+- i++;
+- if (i >= 30)
+- osi_Panic("afs_DbgDisconFiles: loop in dirty list\n");
+- }
+- ReleaseReadLock(&afs_disconDirtyLock);
+-}
+-
+ /*!
+ * Generate a fake fid for a disconnected shadow dir.
+ * Similar to afs_GenFakeFid, only that it uses the dhash
+--
+2.44.0
+
diff --git a/0012-afs-Add-declaration-for-RXAFS_ResidencyCmd.patch b/0012-afs-Add-declaration-for-RXAFS_ResidencyCmd.patch
new file mode 100644
index 000000000000..e203a16db82a
--- /dev/null
+++ b/0012-afs-Add-declaration-for-RXAFS_ResidencyCmd.patch
@@ -0,0 +1,48 @@
+From ae193277f1e2af7137e86ab5e96673c6d9fae217 Mon Sep 17 00:00:00 2001
+From: Cheyenne Wills <cwills@sinenomine.net>
+Date: Fri, 12 Jan 2024 15:52:57 -0700
+Subject: [PATCH 12/29] afs: Add declaration for RXAFS_ResidencyCmd()
+
+The function RXAFS_ResidencyCmd() is 'manually' defined within the
+afsint.xg, so a prototype for the function is not defined.
+
+This function is flagged due to a missing prototype when building
+against a Linux 6.8 kernel (which sets the -Wmissing-declarations and
+-Wmissing-prototypes compiler flags as default). Linux 6.8 commit:
+ 'Makefile.extrawarn: turn on missing-prototypes globally' (0fcb70851f).
+
+When building against a kernel with CONFIG_WERROR=y, the build fails.
+
+Add a prototype for RXAFS_ResidencyCmd
+
+There are no functional changes with this commit
+
+The function RXAFS_ResidencyCmd() was introduced with commit:
+'rename-residency-from-mrafs-to-osd-20090427' (8655541d1e)
+
+Reviewed-on: https://gerrit.openafs.org/15619
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Andrew Deason <adeason@sinenomine.net>
+Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
+(cherry picked from commit 1d6cfbc5f627abf3808aae97afb72662301483b5)
+
+Change-Id: I42d0868b83e119b0c3348a3af8aaf5961c040bb2
+---
+ src/fsint/afsint.xg | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/fsint/afsint.xg b/src/fsint/afsint.xg
+index 9fe4980c6..cdcd07a29 100644
+--- a/src/fsint/afsint.xg
++++ b/src/fsint/afsint.xg
+@@ -664,6 +664,7 @@ FsCmd(
+ ) = 220;
+
+ #ifdef RPC_CLIENT
++%int RXAFS_ResidencyCmd(struct rx_connection *z_conn, AFSFid *Fid, struct FsCmdInputs *Inputs, struct FsCmdOutputs *Outputs);
+ %int RXAFS_ResidencyCmd(struct rx_connection *z_conn, AFSFid *Fid, struct FsCmdInputs *Inputs, struct FsCmdOutputs *Outputs)
+ %{
+ % return RXAFS_FsCmd(z_conn, Fid, Inputs, Outputs);
+--
+2.44.0
+
diff --git a/0013-roken-Declare-ct_memcmp-in-hcrypto-kernel-roken.h.patch b/0013-roken-Declare-ct_memcmp-in-hcrypto-kernel-roken.h.patch
new file mode 100644
index 000000000000..40a1c0609fca
--- /dev/null
+++ b/0013-roken-Declare-ct_memcmp-in-hcrypto-kernel-roken.h.patch
@@ -0,0 +1,95 @@
+From e5d980ec4a4d41f965fcfe968a2cf00e0b99a3e1 Mon Sep 17 00:00:00 2001
+From: Andrew Deason <adeason@sinenomine.net>
+Date: Tue, 30 Jan 2024 20:44:48 -0600
+Subject: [PATCH 13/29] roken: Declare ct_memcmp in hcrypto kernel roken.h
+
+Currently, we build roken's ct.c for our kernel module to provide
+ct_memcmp(). We declare a prototype for ct_memcmp() in krb5_locl.h,
+and all of our kernel callers of ct_memcmp() include krb5_locl.h, so
+all callers get a prototype and avoid "implicit declaration" compiler
+warnings.
+
+However, roken's ct.c itself does not include krb5_locl.h, so it
+doesn't get a prototype for ct_memcmp(). This is dangerous, since if
+the prototype ever slightly differs from the implementation for any
+reason, it could cause a variety of issues.
+
+This also causes warnings when building against a Linux 6.8 kernel
+(which sets the -Wmissing-declarations and -Wmissing-prototypes
+compiler flags as default). Linux 6.8 commit:
+ 'Makefile.extrawarn: turn on missing-prototypes globally' (0fcb70851f).
+
+When building against a kernel with CONFIG_WERROR=y, the build fails.
+
+We cannot change ct.c, since it is an external source file. To fix
+this, instead move the prototype of ct_memcmp() to our stub
+kernel-only roken.h header, which is included by ct.c. Make
+krb5_locl.h also include roken.h when building kernel code, so all of
+the ct_memcmp() callers also get the prototype.
+
+While we're here, add some informative comments and an include guard
+to our previously-blank roken.h stub.
+
+Written in collaboration with cwills@sinenomine.net.
+
+Reviewed-on: https://gerrit.openafs.org/15620
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Andrew Deason <adeason@sinenomine.net>
+Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
+(cherry picked from commit be236069e9d26339ed5f9939965bca0dd3f8bf4e)
+
+Change-Id: I1112881938b0585263871f8f83d63b8909b12f0d
+---
+ src/crypto/hcrypto/kernel/roken.h | 17 +++++++++++++++++
+ src/crypto/rfc3961/krb5_locl.h | 6 +-----
+ 2 files changed, 18 insertions(+), 5 deletions(-)
+
+diff --git a/src/crypto/hcrypto/kernel/roken.h b/src/crypto/hcrypto/kernel/roken.h
+index e69de29bb..f8c233468 100644
+--- a/src/crypto/hcrypto/kernel/roken.h
++++ b/src/crypto/hcrypto/kernel/roken.h
+@@ -0,0 +1,17 @@
++#ifndef OPENAFS_HCRYPTO_KERNEL_ROKEN_H
++#define OPENAFS_HCRYPTO_KERNEL_ROKEN_H
++
++/*
++ * This is a stub roken.h used for building roken code (or roken-using code) in
++ * the kernel. For userspace code, use a real roken.h. This just contains a few
++ * prototypes of roken functions we actually use in kernel code.
++ */
++
++#ifndef KERNEL
++# error "This header is for kernel code only"
++#endif
++
++/* ct.c */
++int ct_memcmp(const void *p1, const void *p2, size_t len);
++
++#endif /* OPENAFS_HCRYPTO_KERNEL_ROKEN_H */
+diff --git a/src/crypto/rfc3961/krb5_locl.h b/src/crypto/rfc3961/krb5_locl.h
+index eb279a95f..6e706737c 100644
+--- a/src/crypto/rfc3961/krb5_locl.h
++++ b/src/crypto/rfc3961/krb5_locl.h
+@@ -5,6 +5,7 @@
+ #ifdef KERNEL
+
+ #include "config.h"
++#include <roken.h>
+
+ #else
+ #include <afsconfig.h>
+@@ -285,11 +286,6 @@ int copy_EncryptionKey(const krb5_keyblock *, krb5_keyblock *);
+ krb5_error_code krb5_enctype_to_string(krb5_context context,
+ krb5_enctype etype,
+ char **string);
+-#ifdef KERNEL
+-/* Roken provides this in userspace, but we're on our own in the kernel. */
+-int ct_memcmp(const void *p1, const void *p2, size_t len);
+-#endif
+-
+
+ #include "crypto.h"
+
+--
+2.44.0
+
diff --git a/0014-Linux-6.8-Add-function-prototypes-for-krb5.patch b/0014-Linux-6.8-Add-function-prototypes-for-krb5.patch
new file mode 100644
index 000000000000..b43c366dcd0d
--- /dev/null
+++ b/0014-Linux-6.8-Add-function-prototypes-for-krb5.patch
@@ -0,0 +1,182 @@
+From e8e23ccf9d81e5c7df49d4e28441d7c986e47886 Mon Sep 17 00:00:00 2001
+From: Cheyenne Wills <cwills@sinenomine.net>
+Date: Wed, 7 Feb 2024 15:25:10 -0700
+Subject: [PATCH 14/29] Linux 6.8: Add function prototypes for krb5
+
+The external files for heimdal/krb5 do not provide function prototypes
+in a header file that is used when building files that we use from
+heimdal/krb5 (e.g. crypto.c).
+
+These functions are flagged due to missing prototypes when building
+against a Linux 6.8 kernel (which sets the -Wmissing-declarations and
+-Wmissing-prototypes compiler flags as default). Linux 6.8 commit:
+ 'Makefile.extrawarn: turn on missing-prototypes globally' (0fcb70851f).
+
+When building against a kernel with CONFIG_WERROR=y, the build fails.
+
+We cannot modify the external source files, however there is the local
+OpenAFS include file, krb5_locl.h, that does contain OpenAFS specific
+changes.
+
+Add declarations to krb5_locl.h for the functions defined in the
+heimdal/krb5 source.
+
+There are no functional changes with this commit.
+
+Reviewed-on: https://gerrit.openafs.org/15621
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Andrew Deason <adeason@sinenomine.net>
+Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
+(cherry picked from commit 612927dd1dd44bbd08eda790de12b24213583156)
+
+Change-Id: Iaae28186a24c3c5ca4407de9563c8cfed9644921
+---
+ src/crypto/rfc3961/krb5_locl.h | 132 +++++++++++++++++++++++++++++++++
+ 1 file changed, 132 insertions(+)
+
+diff --git a/src/crypto/rfc3961/krb5_locl.h b/src/crypto/rfc3961/krb5_locl.h
+index 6e706737c..04292eefa 100644
+--- a/src/crypto/rfc3961/krb5_locl.h
++++ b/src/crypto/rfc3961/krb5_locl.h
+@@ -287,6 +287,138 @@ krb5_error_code krb5_enctype_to_string(krb5_context context,
+ krb5_enctype etype,
+ char **string);
+
++/*
++ * Unused prototypes from heimdal/krb5. These are functions that are not used
++ * outside of their compilation unit at all, but we may need to declare them to
++ * avoid compiler warnings.
++ */
++struct _krb5_key_data;
++struct _krb5_encryption_type;
++/* heimdal/krb5/crypto.c */
++KRB5_LIB_FUNCTION krb5_error_code _krb5_derive_key(krb5_context context,
++ struct _krb5_encryption_type *et,
++ struct _krb5_key_data *key,
++ const void *constant,
++ size_t len);
++KRB5_LIB_FUNCTION krb5_error_code krb5_allow_weak_crypto(krb5_context context,
++ krb5_boolean enable);
++KRB5_LIB_FUNCTION krb5_error_code krb5_checksum_disable(krb5_context context,
++ krb5_cksumtype type);
++KRB5_LIB_FUNCTION krb5_boolean krb5_checksum_is_keyed(krb5_context context,
++ krb5_cksumtype type);
++KRB5_LIB_FUNCTION krb5_error_code krb5_cksumtype_valid(krb5_context context,
++ krb5_cksumtype ctype);
++KRB5_LIB_FUNCTION krb5_error_code krb5_create_checksum_iov(krb5_context context,
++ krb5_crypto crypto,
++ unsigned usage,
++ krb5_crypto_iov *data,
++ unsigned int num_data,
++ krb5_cksumtype *type);
++KRB5_LIB_FUNCTION krb5_error_code krb5_crypto_getblocksize(krb5_context context,
++ krb5_crypto crypto,
++ size_t *blocksize);
++KRB5_LIB_FUNCTION krb5_error_code krb5_crypto_getenctype(krb5_context context,
++ krb5_crypto crypto,
++ krb5_enctype *enctype);
++KRB5_LIB_FUNCTION krb5_error_code krb5_crypto_getpadsize(krb5_context context,
++ krb5_crypto crypto,
++ size_t *padsize);
++KRB5_LIB_FUNCTION krb5_error_code krb5_crypto_length(krb5_context context,
++ krb5_crypto crypto,
++ int type,
++ size_t *len);
++KRB5_LIB_FUNCTION krb5_error_code krb5_crypto_length_iov(krb5_context context,
++ krb5_crypto crypto,
++ krb5_crypto_iov *data,
++ unsigned int num_data);
++KRB5_LIB_FUNCTION krb5_error_code krb5_decrypt_iov_ivec(krb5_context context,
++ krb5_crypto crypto,
++ unsigned usage,
++ krb5_crypto_iov *data,
++ unsigned int num_data,
++ void *ivec);
++KRB5_LIB_FUNCTION krb5_error_code krb5_decrypt_ivec(krb5_context context,
++ krb5_crypto crypto,
++ unsigned usage,
++ void *data,
++ size_t len,
++ krb5_data *result,
++ void *ivec);
++KRB5_LIB_FUNCTION krb5_error_code krb5_encrypt_iov_ivec(krb5_context context,
++ krb5_crypto crypto,
++ unsigned usage,
++ krb5_crypto_iov *data,
++ int num_data,
++ void *ivec);
++KRB5_LIB_FUNCTION krb5_error_code krb5_encrypt_ivec(krb5_context context,
++ krb5_crypto crypto,
++ unsigned usage,
++ const void *data,
++ size_t len,
++ krb5_data *result,
++ void *ivec);
++KRB5_LIB_FUNCTION krb5_error_code krb5_enctype_disable(krb5_context context,
++ krb5_enctype enctype);
++KRB5_LIB_FUNCTION krb5_error_code krb5_enctype_enable(krb5_context context,
++ krb5_enctype enctype);
++KRB5_LIB_FUNCTION krb5_error_code krb5_enctype_to_keytype(krb5_context context,
++ krb5_enctype etype,
++ krb5_keytype *keytype);
++KRB5_LIB_FUNCTION size_t krb5_get_wrapped_length (krb5_context context,
++ krb5_crypto crypto,
++ size_t data_len);
++KRB5_LIB_FUNCTION krb5_error_code krb5_hmac(krb5_context context,
++ krb5_cksumtype cktype,
++ const void *data,
++ size_t len,
++ unsigned usage,
++ krb5_keyblock *key,
++ Checksum *result);
++KRB5_LIB_FUNCTION krb5_boolean krb5_is_enctype_weak(krb5_context context,
++ krb5_enctype enctype);
++KRB5_LIB_FUNCTION krb5_error_code krb5_string_to_enctype(krb5_context context,
++ const char *string,
++ krb5_enctype *etype);
++KRB5_LIB_FUNCTION krb5_error_code krb5_verify_checksum_iov(krb5_context context,
++ krb5_crypto crypto,
++ unsigned usage,
++ krb5_crypto_iov *data,
++ unsigned int num_data,
++ krb5_cksumtype *type);
++KRB5_LIB_FUNCTION krb5_error_code krb5_generate_random_keyblock(krb5_context context,
++ krb5_enctype type,
++ krb5_keyblock *key);
++KRB5_LIB_FUNCTION krb5_boolean krb5_checksum_is_collision_proof(krb5_context context,
++ krb5_cksumtype type);
++
++KRB5_LIB_FUNCTION krb5_error_code krb5_cksumtype_to_enctype(krb5_context context,
++ krb5_cksumtype ctype,
++ krb5_enctype *etype);
++KRB5_LIB_FUNCTION krb5_error_code krb5_encrypt_EncryptedData(krb5_context context,
++ krb5_crypto crypto,
++ unsigned usage,
++ void *data,
++ size_t len,
++ int kvno,
++ EncryptedData *result);
++KRB5_LIB_FUNCTION krb5_error_code krb5_crypto_getconfoundersize(krb5_context context,
++ krb5_crypto crypto,
++ size_t *confoundersize);
++
++KRB5_LIB_FUNCTION krb5_error_code krb5_decrypt_EncryptedData(krb5_context context,
++ krb5_crypto crypto,
++ unsigned usage,
++ const EncryptedData *e,
++ krb5_data *result);
++/* heimdal/krb5/data.c */
++KRB5_LIB_FUNCTION krb5_error_code krb5_data_realloc(krb5_data *p, int len);
++KRB5_LIB_FUNCTION krb5_error_code krb5_copy_data(krb5_context context,
++ const krb5_data *indata,
++ krb5_data **outdata);
++KRB5_LIB_FUNCTION int krb5_data_cmp(const krb5_data *data1, const krb5_data *data2);
++/* heimdal/krb5/store-int.c */
++KRB5_LIB_FUNCTION krb5_ssize_t _krb5_get_int(void *buffer, unsigned long *value, size_t size);
++
+ #include "crypto.h"
+
+ struct _krb5_checksum_type * _krb5_find_checksum (krb5_cksumtype);
+--
+2.44.0
+
diff --git a/0015-afs-Declare-init_hckernel_mutex.patch b/0015-afs-Declare-init_hckernel_mutex.patch
new file mode 100644
index 000000000000..db31b6cc0a48
--- /dev/null
+++ b/0015-afs-Declare-init_hckernel_mutex.patch
@@ -0,0 +1,63 @@
+From c3f5353b03396d89b2a1595ca3a38d4312cb62cf Mon Sep 17 00:00:00 2001
+From: Cheyenne Wills <cwills@sinenomine.net>
+Date: Thu, 8 Feb 2024 11:50:16 -0700
+Subject: [PATCH 15/29] afs: Declare init_hckernel_mutex()
+
+The function init_hckernel_mutex() (in rand.c) is flagged due to a
+missing prototype when building against a Linux 6.8 kernel (which sets
+the -Wmissing-declarations and -Wmissing-prototypes compiler flags as
+default). Linux 6.8 commit:
+ 'Makefile.extrawarn: turn on missing-prototypes globally' (0fcb70851f).
+
+When building against a kernel with CONFIG_WERROR=y, the build fails.
+
+Add a function prototype for init_hckernel_mutex() to afs_osi.h and
+remove the prototype from afs_osi.c
+
+There are no functional changes with this commit.
+
+Reviewed-on: https://gerrit.openafs.org/15622
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Andrew Deason <adeason@sinenomine.net>
+Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
+(cherry picked from commit ccc2af429710104793fb4659b10697cceab182b3)
+
+Change-Id: Ic5eb4584a980657a01a1cb4411c0c1f03b1f3560
+---
+ src/afs/afs_osi.c | 5 -----
+ src/afs/afs_osi.h | 5 +++++
+ 2 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/src/afs/afs_osi.c b/src/afs/afs_osi.c
+index 6f54c63c7..e8f852e2e 100644
+--- a/src/afs/afs_osi.c
++++ b/src/afs/afs_osi.c
+@@ -25,11 +25,6 @@
+ * -- On HP called from afsc_link.
+ * -- On SGI called from afs_init. */
+
+-/* No hckernel-specific header for this prototype. */
+-#ifndef UKERNEL
+-extern void init_hckernel_mutex(void);
+-#endif
+-
+ afs_lock_t afs_ftf; /* flush text lock */
+
+ #ifdef AFS_SGI_ENV
+diff --git a/src/afs/afs_osi.h b/src/afs/afs_osi.h
+index 79c44a985..e3f0e0ccb 100644
+--- a/src/afs/afs_osi.h
++++ b/src/afs/afs_osi.h
+@@ -458,4 +458,9 @@ extern int osi_ShouldDeferRemunlink(struct vcache *avc);
+ # define osi_ShouldDeferRemunlink(avc) 0
+ #endif
+
++/* No hckernel-specific header for this prototype. */
++#ifndef UKERNEL
++extern void init_hckernel_mutex(void);
++#endif
++
+ #endif /* _AFS_OSI_ */
+--
+2.44.0
+
diff --git a/0016-afs-Add-includes-to-pick-up-function-prototypes.patch b/0016-afs-Add-includes-to-pick-up-function-prototypes.patch
new file mode 100644
index 000000000000..f8cce55804f2
--- /dev/null
+++ b/0016-afs-Add-includes-to-pick-up-function-prototypes.patch
@@ -0,0 +1,120 @@
+From 5e3f30520ee000690b7097bdea7d3f35fe0fcfd3 Mon Sep 17 00:00:00 2001
+From: Cheyenne Wills <cwills@sinenomine.net>
+Date: Mon, 12 Feb 2024 08:25:47 -0700
+Subject: [PATCH 16/29] afs: Add includes to pick up function prototypes
+
+The functions defined in LINUX/osi_crypto.c, osi_pagecopy.c,
+osi_probe.c, and osi_syscall.c have function prototypes defined in
+existing header files, however either due to missing includes or
+preprocessor conditionals that skip the includes, these function
+prototypes are not being pulled in.
+
+These functions are flagged due to missing prototypes when building
+against a Linux 6.8 kernel (which sets the -Wmissing-declarations and
+-Wmissing-prototypes compiler flags as default). Linux 6.8 commit:
+ 'Makefile.extrawarn: turn on missing-prototypes globally' (0fcb70851f).
+
+When building against a kernel with CONFIG_WERROR=y, the build fails.
+
+Add the necessary includes to osi_crypto.c and osi_pagecopy.c and
+re-arrange the includes in osi_probe.c and osi_syscall.c to ensure that
+the function prototypes are present when building the Linux kernel
+module.
+
+Reviewed-on: https://gerrit.openafs.org/15641
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Andrew Deason <adeason@sinenomine.net>
+Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
+(cherry picked from commit 3683f15278e34e13d7272928eaf666f0acc4e1e9)
+
+Change-Id: Iac704fc98d0d685358224049f383d68aa7a105f8
+---
+ src/afs/LINUX/osi_crypto.c | 3 +++
+ src/afs/LINUX/osi_pagecopy.c | 1 +
+ src/afs/LINUX/osi_probe.c | 8 ++++----
+ src/afs/LINUX/osi_syscall.c | 7 ++++---
+ 4 files changed, 12 insertions(+), 7 deletions(-)
+
+diff --git a/src/afs/LINUX/osi_crypto.c b/src/afs/LINUX/osi_crypto.c
+index ead19161c..7f8435c65 100644
+--- a/src/afs/LINUX/osi_crypto.c
++++ b/src/afs/LINUX/osi_crypto.c
+@@ -25,6 +25,9 @@
+ #include <afsconfig.h>
+ #include "afs/param.h"
+
++#include "afs/sysincludes.h"
++#include "afsincludes.h"
++
+ #include <linux/random.h>
+
+ int
+diff --git a/src/afs/LINUX/osi_pagecopy.c b/src/afs/LINUX/osi_pagecopy.c
+index 7142a1b06..42f5e38e0 100644
+--- a/src/afs/LINUX/osi_pagecopy.c
++++ b/src/afs/LINUX/osi_pagecopy.c
+@@ -61,6 +61,7 @@
+ #include <linux/wait.h>
+ #include <linux/workqueue.h>
+ #include <linux/slab.h>
++#include "osi_pagecopy.h"
+
+ static DECLARE_WAIT_QUEUE_HEAD (afs_pagecopy_wq);
+ static spinlock_t afs_pagecopy_lock;
+diff --git a/src/afs/LINUX/osi_probe.c b/src/afs/LINUX/osi_probe.c
+index 9b06fa7b1..be42ecf85 100644
+--- a/src/afs/LINUX/osi_probe.c
++++ b/src/afs/LINUX/osi_probe.c
+@@ -48,9 +48,13 @@
+ #ifdef OSI_PROBE_STANDALONE
+ # define OSI_PROBE_DEBUG
+ #endif
++
+ #ifndef OSI_PROBE_STANDALONE
+ # include <afsconfig.h>
+ # include "afs/param.h"
++
++# include "afs/sysincludes.h"
++# include "afsincludes.h"
+ #endif
+
+ #include <linux/version.h>
+@@ -61,10 +65,6 @@
+ /* Slightly kludgy, but too bad */
+ #define scsi_command_size scsi_command_size_tbl
+ #endif
+-#ifndef OSI_PROBE_STANDALONE
+-# include "afs/sysincludes.h"
+-# include "afsincludes.h"
+-#endif
+ #include <linux/sched.h>
+ #ifdef HAVE_LINUX_CONFIG_H
+ # include <linux/config.h>
+diff --git a/src/afs/LINUX/osi_syscall.c b/src/afs/LINUX/osi_syscall.c
+index 836491c29..5e9e5194a 100644
+--- a/src/afs/LINUX/osi_syscall.c
++++ b/src/afs/LINUX/osi_syscall.c
+@@ -14,6 +14,10 @@
+ #include <afsconfig.h>
+ #include "afs/param.h"
+
++#include <linux/module.h> /* early to avoid printf->printk mapping */
++#include "afs/sysincludes.h"
++#include "afsincludes.h"
++
+ #ifdef LINUX_KEYRING_SUPPORT
+ /* The syscall probing stuff is unnecessary (and is never called) if we have
+ * keyrings support; we rely on keyrings instead of group ids to track PAGs.
+@@ -31,9 +35,6 @@ osi_syscall_clean(void)
+
+ #else /* LINUX_KEYRING_SUPPORT */
+
+-#include <linux/module.h> /* early to avoid printf->printk mapping */
+-#include "afs/sysincludes.h"
+-#include "afsincludes.h"
+ #include <linux/unistd.h> /* For syscall numbers. */
+ #include <linux/mm.h>
+
+--
+2.44.0
+
diff --git a/0017-afs-Move-function-prototypes-into-headers.patch b/0017-afs-Move-function-prototypes-into-headers.patch
new file mode 100644
index 000000000000..81d2767af097
--- /dev/null
+++ b/0017-afs-Move-function-prototypes-into-headers.patch
@@ -0,0 +1,144 @@
+From 1505e0d19cba9b66d0e357f6eafdde15f638eb2e Mon Sep 17 00:00:00 2001
+From: Cheyenne Wills <cwills@sinenomine.net>
+Date: Thu, 15 Feb 2024 09:00:05 -0700
+Subject: [PATCH 17/29] afs: Move function prototypes into headers
+
+Several .c files contain external function prototypes, while the
+implementing files do not have these prototypes.
+
+Move these prototypes into header files so that the prototypes are
+available to both the caller and the implementation.
+
+Because the file holding the implementation does not have prototypes,
+these functions are flagged when building against a Linux 6.8 kernel
+(which sets the -Wmissing-declarations and -Wmissing-prototypes compiler
+flags as default). Linux 6.8 commit:
+ 'Makefile.extrawarn: turn on missing-prototypes globally' (0fcb70851f).
+
+When building against a kernel with CONFIG_WERROR=y, the build fails.
+
+Add the prototypes for the following to afs_prototypes.h:
+ exporter_add
+ afs_syscall (AFS_LINUX_ENV)
+ BlobScan
+
+Remove the prototypes from the .c files where they are referenced.
+
+Reviewed-on: https://gerrit.openafs.org/15642
+Reviewed-by: Andrew Deason <adeason@sinenomine.net>
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
+Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
+(cherry picked from commit 85781d7e83ae4501d8ab267bf55ef63f90f63101)
+
+Change-Id: I74333e99e08af88bebdcbff4767d79397acac358
+---
+ src/afs/LINUX/osi_ioctl.c | 3 ---
+ src/afs/LINUX/osi_syscall.c | 3 ---
+ src/afs/LINUX/osi_vnodeops.c | 2 --
+ src/afs/VNOPS/afs_vnop_lookup.c | 2 --
+ src/afs/afs_nfsclnt.c | 1 -
+ src/afs/afs_prototypes.h | 7 +++++++
+ 6 files changed, 7 insertions(+), 11 deletions(-)
+
+diff --git a/src/afs/LINUX/osi_ioctl.c b/src/afs/LINUX/osi_ioctl.c
+index fbdee29cb..3e797745c 100644
+--- a/src/afs/LINUX/osi_ioctl.c
++++ b/src/afs/LINUX/osi_ioctl.c
+@@ -34,9 +34,6 @@
+
+ extern struct proc_dir_entry *openafs_procfs;
+
+-extern asmlinkage long
+-afs_syscall(long syscall, long parm1, long parm2, long parm3, long parm4);
+-
+ static int
+ afs_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
+ unsigned long arg)
+diff --git a/src/afs/LINUX/osi_syscall.c b/src/afs/LINUX/osi_syscall.c
+index 5e9e5194a..dc78da874 100644
+--- a/src/afs/LINUX/osi_syscall.c
++++ b/src/afs/LINUX/osi_syscall.c
+@@ -91,9 +91,6 @@ osi_syscall_clean(void)
+
+
+ /***** ALL PLATFORMS *****/
+-extern asmlinkage long
+-afs_syscall(long syscall, long parm1, long parm2, long parm3, long parm4);
+-
+ static SYSCALLTYPE *afs_sys_call_table;
+ static SYSCALLTYPE afs_ni_syscall = 0;
+
+diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c
+index 7e85aa552..08fccb1b2 100644
+--- a/src/afs/LINUX/osi_vnodeops.c
++++ b/src/afs/LINUX/osi_vnodeops.c
+@@ -407,8 +407,6 @@ afs_linux_write(struct file *fp, const char *buf, size_t count, loff_t * offp)
+ }
+ #endif
+
+-extern int BlobScan(struct dcache * afile, afs_int32 ablob, afs_int32 *ablobOut);
+-
+ /* This is a complete rewrite of afs_readdir, since we can make use of
+ * filldir instead of afs_readdir_move. Note that changes to vcache/dcache
+ * handling and use of bulkstats will need to be reflected here as well.
+diff --git a/src/afs/VNOPS/afs_vnop_lookup.c b/src/afs/VNOPS/afs_vnop_lookup.c
+index e1796c54f..0fbe4e8f9 100644
+--- a/src/afs/VNOPS/afs_vnop_lookup.c
++++ b/src/afs/VNOPS/afs_vnop_lookup.c
+@@ -667,8 +667,6 @@ afs_CheckBulkStatus(struct afs_conn *tc, int nFids, AFSBulkStats *statParm,
+ return 0;
+ }
+
+-extern int BlobScan(struct dcache * afile, afs_int32 ablob, afs_int32 *ablobOut);
+-
+ /* called with an unlocked directory and directory cookie. Areqp
+ * describes who is making the call.
+ * Scans the next N (about 30, typically) directory entries, and does
+diff --git a/src/afs/afs_nfsclnt.c b/src/afs/afs_nfsclnt.c
+index fbb5006ce..4c7806d24 100644
+--- a/src/afs/afs_nfsclnt.c
++++ b/src/afs/afs_nfsclnt.c
+@@ -160,7 +160,6 @@ afs_nfsclient_init(void)
+ osi_Assert(ISAFS_GLOCK());
+ #endif
+ if (!init_nfsexporter) {
+- extern struct afs_exporter *exporter_add();
+
+ init_nfsexporter = 1;
+ LOCK_INIT(&afs_xnfspag, "afs_xnfspag");
+diff --git a/src/afs/afs_prototypes.h b/src/afs/afs_prototypes.h
+index 208bd0338..9b3b1afec 100644
+--- a/src/afs/afs_prototypes.h
++++ b/src/afs/afs_prototypes.h
+@@ -331,6 +331,8 @@ extern void init_sys_error_to_et(void);
+
+ /* afs_exporter.c */
+ extern struct afs_exporter *root_exported;
++extern struct afs_exporter * exporter_add(afs_int32 size, struct exporterops *ops,
++ afs_int32 state, afs_int32 type, char *data);
+ extern struct afs_exporter *exporter_find(int type);
+ extern void shutdown_exporter(void);
+
+@@ -923,6 +925,10 @@ extern int afs3_syscall(afs_proc_t *p, void *args, long *retval);
+ extern int Afs_syscall(void);
+ #endif
+
++#if defined(AFS_LINUX_ENV)
++extern asmlinkage long afs_syscall(long syscall, long parm1, long parm2, long parm3, long parm4);
++#endif
++
+ /* afs_tokens.c */
+ struct ktc_tokenUnion;
+ struct ktc_setTokenData;
+@@ -1292,6 +1298,7 @@ extern void afs_PrefetchChunk(struct vcache *avc, struct dcache *adc,
+
+ /* VNOPS/afs_vnop_readdir.c */
+ extern int afs_rd_stash_i;
++extern int BlobScan(struct dcache * afile, afs_int32 ablob, int *ablobOut);
+ #if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
+ extern int afs_readdir(OSI_VC_DECL(avc), struct uio *auio,
+ afs_ucred_t *acred, int *eofp);
+--
+2.44.0
+
diff --git a/0018-afs-Add-afs_xioctl-prototyes-to-afs_prototypes.h.patch b/0018-afs-Add-afs_xioctl-prototyes-to-afs_prototypes.h.patch
new file mode 100644
index 000000000000..e6849d8433bf
--- /dev/null
+++ b/0018-afs-Add-afs_xioctl-prototyes-to-afs_prototypes.h.patch
@@ -0,0 +1,162 @@
+From 3c7e96e5c163597ec65d238d3357881346ab2dd3 Mon Sep 17 00:00:00 2001
+From: Cheyenne Wills <cwills@sinenomine.net>
+Date: Mon, 12 Feb 2024 08:59:32 -0700
+Subject: [PATCH 18/29] afs: Add afs_xioctl prototyes to afs_prototypes.h
+
+Several .c files have external function prototypes for the afs_xioctl
+function, while the implementing files do not have the prototype.
+
+Move these prototypes into afs_prototypes.h so that the prototypes are
+available to both the caller and the implementation.
+
+Because the file holding the implementation does not have a prototypes,
+afs_xioctl() is being flagged when building against a Linux 6.8 kernel
+(which sets the -Wmissing-declarations and -Wmissing-prototypes compiler
+flags as default). Linux 6.8 commit:
+ 'Makefile.extrawarn: turn on missing-prototypes globally' (0fcb70851f).
+
+When building against a Linux kernel with CONFIG_WERROR=y, the build
+fails.
+
+Note that the function afs_xioctl() has platform specific
+implementations.
+
+Reviewed-on: https://gerrit.openafs.org/15643
+Reviewed-by: Andrew Deason <adeason@sinenomine.net>
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
+Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
+(cherry picked from commit 575d986aa6c18ac27ea42fb66ae8b8cb0e27fe6c)
+
+Change-Id: If746111fdcf6a00459f524711623d322d5fc7942
+---
+ src/afs/FBSD/osi_vfsops.c | 1 -
+ src/afs/HPUX/osi_vfsops.c | 2 +-
+ src/afs/LINUX/osi_vnodeops.c | 4 ----
+ src/afs/NBSD/osi_kmod.c | 1 -
+ src/afs/NBSD/osi_vfsops.c | 1 -
+ src/afs/OBSD/osi_vfsops.c | 2 +-
+ src/afs/SOLARIS/osi_vfsops.c | 1 -
+ src/afs/afs_prototypes.h | 17 +++++++++++++++++
+ 8 files changed, 19 insertions(+), 10 deletions(-)
+
+diff --git a/src/afs/FBSD/osi_vfsops.c b/src/afs/FBSD/osi_vfsops.c
+index 6044bbed1..8a979db6d 100644
+--- a/src/afs/FBSD/osi_vfsops.c
++++ b/src/afs/FBSD/osi_vfsops.c
+@@ -18,7 +18,6 @@ struct mount *afs_globalVFS = NULL;
+ int afs_pbuf_freecnt = -1;
+
+ extern int Afs_xsetgroups();
+-extern int afs_xioctl();
+
+ static struct syscall_helper_data afs_syscalls[] = {
+ {
+diff --git a/src/afs/HPUX/osi_vfsops.c b/src/afs/HPUX/osi_vfsops.c
+index 0ddc227c7..46faca743 100644
+--- a/src/afs/HPUX/osi_vfsops.c
++++ b/src/afs/HPUX/osi_vfsops.c
+@@ -290,7 +290,7 @@ int afs_vfs_slot = -1;
+
+ afsc_link()
+ {
+- extern int Afs_syscall(), afs_xioctl(), Afs_xsetgroups();
++ extern int Afs_syscall(), Afs_xsetgroups();
+
+ /* For now nothing special is required during AFS initialization. */
+ AFS_STATCNT(afsc_link);
+diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c
+index 08fccb1b2..8aeeafa9b 100644
+--- a/src/afs/LINUX/osi_vnodeops.c
++++ b/src/afs/LINUX/osi_vnodeops.c
+@@ -613,10 +613,6 @@ out1:
+ }
+
+
+-/* in afs_pioctl.c */
+-extern int afs_xioctl(struct inode *ip, struct file *fp, unsigned int com,
+- unsigned long arg);
+-
+ static long afs_unlocked_xioctl(struct file *fp, unsigned int com,
+ unsigned long arg) {
+ return afs_xioctl(FILE_INODE(fp), fp, com, arg);
+diff --git a/src/afs/NBSD/osi_kmod.c b/src/afs/NBSD/osi_kmod.c
+index f6585651e..eefaf5617 100644
+--- a/src/afs/NBSD/osi_kmod.c
++++ b/src/afs/NBSD/osi_kmod.c
+@@ -44,7 +44,6 @@
+ #include "afs/afsincludes.h" /* Afs-based standard headers */
+
+ extern int afs3_syscall(struct lwp *, const void *, register_t *);
+-extern int afs_xioctl(struct lwp *, const void *, register_t *);
+ extern int Afs_xsetgroups(struct lwp *, const void *, register_t *);
+
+ #if !defined(AFS_NBSD60_ENV)
+diff --git a/src/afs/NBSD/osi_vfsops.c b/src/afs/NBSD/osi_vfsops.c
+index 7679ff169..5032a1dd9 100644
+--- a/src/afs/NBSD/osi_vfsops.c
++++ b/src/afs/NBSD/osi_vfsops.c
+@@ -110,7 +110,6 @@ VFS_PROTOS(afs);
+ #ifndef AFS_NBSD60_ENV
+ extern int sys_lkmnosys(struct lwp *, const void *, register_t *);
+ extern int afs3_syscall(struct lwp *, const void *, register_t *);
+-extern int afs_xioctl(struct lwp *, const void *, register_t *);
+ extern int Afs_xsetgroups(struct lwp *, const void *, register_t *);
+ static int afs_badcall(struct lwp *, const void *, register_t *);
+
+diff --git a/src/afs/OBSD/osi_vfsops.c b/src/afs/OBSD/osi_vfsops.c
+index 830906cc3..e7729261e 100644
+--- a/src/afs/OBSD/osi_vfsops.c
++++ b/src/afs/OBSD/osi_vfsops.c
+@@ -108,7 +108,7 @@ NONINFRINGEMENT.
+ /* from /usr/src/sys/kern/vfs_subr.c */
+ extern void insmntque(struct vnode *, struct mount *);
+
+-extern int sys_lkmnosys(), afs_xioctl(), Afs_xsetgroups();
++extern int sys_lkmnosys(), Afs_xsetgroups();
+
+ static int lkmid = -1;
+ static int afs_badcall(struct proc *p, void *xx, register_t * yy);
+diff --git a/src/afs/SOLARIS/osi_vfsops.c b/src/afs/SOLARIS/osi_vfsops.c
+index c6c9ddf56..f3f9bd33c 100644
+--- a/src/afs/SOLARIS/osi_vfsops.c
++++ b/src/afs/SOLARIS/osi_vfsops.c
+@@ -389,7 +389,6 @@ afsinit(int fstype, char *dummy)
+ afsinit(struct vfssw *vfsswp, int fstype)
+ #endif
+ {
+- extern int afs_xioctl();
+ extern int afs_xsetgroups();
+
+ AFS_STATCNT(afsinit);
+diff --git a/src/afs/afs_prototypes.h b/src/afs/afs_prototypes.h
+index 9b3b1afec..d7894dd67 100644
+--- a/src/afs/afs_prototypes.h
++++ b/src/afs/afs_prototypes.h
+@@ -812,6 +812,23 @@ extern int afs_syscall_pioctl(char *path, unsigned int com, caddr_t cmarg,
+ extern int HandleIoctl(struct vcache *avc, afs_int32 acom,
+ struct afs_ioctl *adata);
+
++#if defined(AFS_SUN5_ENV)
++struct afs_ioctl_sys;
++extern int afs_xioctl(struct afs_ioctl_sys *uap, rval_t *rvp);
++#elif defined(AFS_LINUX_ENV)
++extern int afs_xioctl(struct inode *ip, struct file *fp, unsigned int com, unsigned long arg);
++#elif defined(AFS_DAWRIN_ENV) & !defined(AFS_DARWIN80)
++extern int afs_xioctl(afs_proc_t *p, struct ioctl_args *uap, register_t *retval);
++#elif defined(AFS_FBSD_ENV)
++extern int afs_xioctl(struct thread *td, struct ioctl_args *uap, register_t *retval);
++#elif defined(AFS_NBSD_ENV)
++extern int afs_xioctl(afs_proc_t *p, const struct sys_ioctl_args *uap, register_t *retval);
++#elif defined(AFS_XBSD_ENV)
++extern int afs_xioctl(afs_proc_t *p, const struct ioctl_args *uap, register_t *retval);
++#elif defined(UKERNEL)
++extern int afs_xioctl(void);
++#endif
++
+
+ /* afs_segments.c */
+ extern int afs_StoreAllSegments(struct vcache *avc,
+--
+2.44.0
+
diff --git a/0019-afs-Remove-SRXAFSCB-protos-from-afs_prototypes.h.patch b/0019-afs-Remove-SRXAFSCB-protos-from-afs_prototypes.h.patch
new file mode 100644
index 000000000000..ef297f01673e
--- /dev/null
+++ b/0019-afs-Remove-SRXAFSCB-protos-from-afs_prototypes.h.patch
@@ -0,0 +1,106 @@
+From 93669f535752e759b820a21883a6a8c6fba4e73e Mon Sep 17 00:00:00 2001
+From: Cheyenne Wills <cwills@sinenomine.net>
+Date: Mon, 12 Feb 2024 09:43:29 -0700
+Subject: [PATCH 19/29] afs: Remove SRXAFSCB* protos from afs_prototypes.h
+
+The prototypes for the afscbint RPC functions (SRXAFSCB_*) implemented
+in afs_callback.c are defined in 2 locations, afs_protypes.h and
+afscbint.h (which is generated by rxgen).
+
+Remove the protoypes for the SRXAFSCB_* functions from afs_prototypes.h
+as they are redundant and are currently out of sync (the prototypes
+for SRXAFSCB_GetCellByNum() and SRXAFSCB_TellMeAboutYourself() are
+not present in afs_prototypes.h). Also remove a redundant prototype for
+afs_RXCallBackServer() which was prototyped both before and in the
+middle of the SRXAFSCB* prototypes.
+
+Since afs_callback.c only pulled in afs_prototypes.h and not afscbint.h,
+add an include for afscbint.h to ensure that the all the prototypes for
+the SRXAFSCB_* functions are present.
+
+The 2 functions listed above are flagged due to missing prototypes when
+building against a Linux 6.8 kernel (which sets the
+-Wmissing-declarations and -Wmissing-prototypes compiler flags as
+default). Linux 6.8 commit:
+ 'Makefile.extrawarn: turn on missing-prototypes globally' (0fcb70851f).
+
+When building against a kernel with CONFIG_WERROR=y, the build fails.
+
+Reviewed-on: https://gerrit.openafs.org/15644
+Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
+Tested-by: Benjamin Kaduk <kaduk@mit.edu>
+Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
+(cherry picked from commit fae4003b403420d0b548920c7837a2d2b6e432ae)
+
+Change-Id: I7d435455fc60cc10200ee91d0d76534367ab5883
+---
+ src/afs/afs_callback.c | 2 ++
+ src/afs/afs_prototypes.h | 37 -------------------------------------
+ 2 files changed, 2 insertions(+), 37 deletions(-)
+
+diff --git a/src/afs/afs_callback.c b/src/afs/afs_callback.c
+index 56e8cd2cc..1fe990edf 100644
+--- a/src/afs/afs_callback.c
++++ b/src/afs/afs_callback.c
+@@ -19,6 +19,8 @@
+
+ #include "afs/sysincludes.h" /*Standard vendor system headers */
+ #include "afsincludes.h" /*AFS-based standard headers */
++#define FSINT_COMMON_XG
++#include "afs/afscbint.h"
+ #include "afs/afs_stats.h" /*Cache Manager stats */
+ #include "afs/opr.h"
+ #include "afs/afs_args.h"
+diff --git a/src/afs/afs_prototypes.h b/src/afs/afs_prototypes.h
+index d7894dd67..b9811f892 100644
+--- a/src/afs/afs_prototypes.h
++++ b/src/afs/afs_prototypes.h
+@@ -64,45 +64,8 @@ extern unsigned int lastCallBack_dv;
+ extern osi_timeval32_t lastCallBack_time;
+ extern struct interfaceAddr afs_cb_interface;
+
+-extern int afs_RXCallBackServer(void);
+-extern int SRXAFSCB_GetCE(struct rx_call *a_call, afs_int32 a_index,
+- struct AFSDBCacheEntry *a_result);
+-extern int SRXAFSCB_GetCE64(struct rx_call *a_call, afs_int32 a_index,
+- struct AFSDBCacheEntry64 *a_result);
+-extern int SRXAFSCB_GetLock(struct rx_call *a_call, afs_int32 a_index,
+- struct AFSDBLock *a_result);
+-extern int SRXAFSCB_CallBack(struct rx_call *a_call,
+- struct AFSCBFids *a_fids,
+- struct AFSCBs *a_callbacks);
+-extern int SRXAFSCB_Probe(struct rx_call *a_call);
+-extern int SRXAFSCB_InitCallBackState(struct rx_call *a_call);
+-extern int SRXAFSCB_XStatsVersion(struct rx_call *a_call,
+- afs_int32 * a_versionP);
+-extern int SRXAFSCB_GetXStats(struct rx_call *a_call,
+- afs_int32 a_clientVersionNum,
+- afs_int32 a_collectionNumber,
+- afs_int32 * a_srvVersionNumP,
+- afs_int32 * a_timeP, AFSCB_CollData * a_dataP);
+ extern int afs_RXCallBackServer(void);
+ extern int shutdown_CB(void);
+-extern int SRXAFSCB_InitCallBackState2(struct rx_call *a_call,
+- struct interfaceAddr *addr);
+-extern int SRXAFSCB_WhoAreYou(struct rx_call *a_call,
+- struct interfaceAddr *addr);
+-extern int SRXAFSCB_InitCallBackState3(struct rx_call *a_call,
+- afsUUID * a_uuid);
+-extern int SRXAFSCB_ProbeUuid(struct rx_call *a_call, afsUUID * a_uuid);
+-extern int SRXAFSCB_GetServerPrefs(struct rx_call *a_call, afs_int32 a_index,
+- afs_int32 * a_srvr_addr,
+- afs_int32 * a_srvr_rank);
+-extern int SRXAFSCB_GetCellServDB(struct rx_call *a_call, afs_int32 a_index,
+- char **a_name, serverList * a_hosts);
+-extern int SRXAFSCB_GetLocalCell(struct rx_call *a_call, char **a_name);
+-extern int SRXAFSCB_GetCacheConfig(struct rx_call *a_call,
+- afs_uint32 callerVersion,
+- afs_uint32 * serverVersion,
+- afs_uint32 * configCount,
+- cacheConfig * config);
+
+ /* afs_cbqueue.c */
+ extern afs_rwlock_t afs_xcbhash;
+--
+2.44.0
+
diff --git a/0020-rx-Add-function-prototypes-to-rx_prototypes.h.patch b/0020-rx-Add-function-prototypes-to-rx_prototypes.h.patch
new file mode 100644
index 000000000000..1d2b2f656e12
--- /dev/null
+++ b/0020-rx-Add-function-prototypes-to-rx_prototypes.h.patch
@@ -0,0 +1,84 @@
+From 46608e2f629b8742d31752cc0b021420231e6f45 Mon Sep 17 00:00:00 2001
+From: Cheyenne Wills <cwills@sinenomine.net>
+Date: Wed, 7 Feb 2024 19:34:29 -0700
+Subject: [PATCH 20/29] rx: Add function prototypes to rx_prototypes.h
+
+The prototype for rxk_NewSocketHost() is not in a header file, but is
+defined in the referencing .c file. The ARCH/rx_knet.c files that
+implement rxk_NewSocketHost() do not have a prototype (but when the
+rx_kcommon.c implementation is used it does have a prototype, since
+rx_kcommon.c is the "referencing .c file").
+
+Add the prototype for rxk_NewSocketHost() to rx_prototypes.h and
+remove the prototype from rx_kcommon.c
+
+The prototypes for the functions rx_DebugOnOff() and rx_StatsOnOff()
+are defined within rx_prototypes.h, but are within a preprocessor
+conditional for AFS_NT40_ENV, however the implementation for these
+2 functions do not have the preprocessor conditional.
+
+Rearrange the prototypes for rx_DebugOnOff() and rx_StatsOnOff() so they
+are outside the AFS_NT40_ENV preprocessor conditional.
+
+These functions are flagged due to missing prototypes when building
+against a Linux 6.8 kernel (which sets the -Wmissing-declarations and
+-Wmissing-prototypes compiler flags as default). Linux 6.8 commit:
+ 'Makefile.extrawarn: turn on missing-prototypes globally' (0fcb70851f).
+
+When building against a kernel with CONFIG_WERROR=y, the build fails.
+
+There are no functional changes in this commit.
+
+Reviewed-on: https://gerrit.openafs.org/15624
+Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
+Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
+Tested-by: Benjamin Kaduk <kaduk@mit.edu>
+Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
+(cherry picked from commit 8528c36b96fe2935f42188caabf4feed0d5dbcbd)
+
+Change-Id: Ieae8be7f89f5c675c6580d8cfb02ea77ce4088f7
+---
+ src/rx/rx_kcommon.c | 1 -
+ src/rx/rx_prototypes.h | 5 ++++-
+ 2 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/src/rx/rx_kcommon.c b/src/rx/rx_kcommon.c
+index b6a069c1d..c90df3d36 100644
+--- a/src/rx/rx_kcommon.c
++++ b/src/rx/rx_kcommon.c
+@@ -33,7 +33,6 @@ int (*rxk_PacketArrivalProc) (struct rx_packet * ahandle, struct sockaddr_in * a
+ int (*rxk_GetPacketProc) (struct rx_packet **ahandle, int asize);
+ #endif
+
+-osi_socket *rxk_NewSocketHost(afs_uint32 ahost, short aport);
+ extern struct interfaceAddr afs_cb_interface;
+
+ rxk_ports_t rxk_ports;
+diff --git a/src/rx/rx_prototypes.h b/src/rx/rx_prototypes.h
+index 87a1049f7..6e1ae566c 100644
+--- a/src/rx/rx_prototypes.h
++++ b/src/rx/rx_prototypes.h
+@@ -24,9 +24,10 @@ extern void rx_rto_setPeerTimeoutSecs(struct rx_peer *, int secs);
+
+ extern int rx_Init(u_int port);
+ extern int rx_InitHost(u_int host, u_int port);
+-#ifdef AFS_NT40_ENV
++
+ extern void rx_DebugOnOff(int on);
+ extern void rx_StatsOnOff(int on);
++#ifdef AFS_NT40_ENV
+ extern void rx_StartClientThread(void);
+ #endif
+ extern void rx_StartServer(int donateMe);
+@@ -332,6 +333,8 @@ extern void rxi_ListenerProc(osi_socket usockp, int *tnop,
+ extern void rxk_init(void);
+ # endif
+
++extern osi_socket *rxk_NewSocketHost(afs_uint32 ahost, short aport);
++
+ /* UKERNEL/rx_knet.c */
+ # ifdef UKERNEL
+ extern void afs_rxevent_daemon(void);
+--
+2.44.0
+
diff --git a/0021-afs-fix-ops-variable-may-be-used-uninitialized.patch b/0021-afs-fix-ops-variable-may-be-used-uninitialized.patch
new file mode 100644
index 000000000000..e62db4e1379c
--- /dev/null
+++ b/0021-afs-fix-ops-variable-may-be-used-uninitialized.patch
@@ -0,0 +1,80 @@
+From 216078c99ab6d65ba607d5d7522fdb154048ea59 Mon Sep 17 00:00:00 2001
+From: Cheyenne Wills <cwills@sinenomine.net>
+Date: Fri, 9 Feb 2024 09:01:33 -0700
+Subject: [PATCH 21/29] afs: fix 'ops' variable may be used uninitialized
+
+When the function rxfs_storeInit() has the static attribute, gcc flags
+the variable 'ops' as possibly uninitialized.
+
+In function 'afs_CacheStoreDCaches',
+ inlined from 'afs_CacheStoreVCache' at
+ .../src/afs/afs_fetchstore.c:630:14:
+ .../afs/afs_fetchstore.c:535:17: error: 'ops' may be used
+ uninitialized [-Werror=maybe-uninitialized]
+ 535 | code = (*ops->destroy)(&rock, code);
+ | ~^~~~~~~~~~~~~~
+ ...src/afs/afs_fetchstore.c: In function 'afs_CacheStoreVCache':
+ ...src/afs/afs_fetchstore.c:567:22: note: 'ops' was declared here
+ 567 | struct storeOps *ops;
+ | ^~~
+ cc1: all warnings being treated as errors
+
+This is a false positive report by the gcc compiler.
+
+The function rxfs_storeInit() returns a 0 only when it has successfully
+assigned a value to the ops variable, and afs_CacheStoreDcaches() is
+only called if the return value from rxfs_storeInit() is 0.
+
+The ops variable is only used within a block that is within a for loop,
+which could leave a stray value if the variable isn't initialized within
+that loop.
+
+Assigning a NULL to ops is sufficient to avoid the compiler error, and
+relocating the declaration of the ops variable into the block where it
+is actually used ensures that it's always initialized before its use
+within the loop.
+
+Clean up whitespace in the statement that follows the new location for
+the ops variable.
+
+Note, this commit is being added before a commit that adds the static
+attribute to the rxfs_storeInit() function which also "fixes" the
+compiler error (see: afs: Add static attribute to internal functions).
+
+Reviewed-on: https://gerrit.openafs.org/15630
+Reviewed-by: Andrew Deason <adeason@sinenomine.net>
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
+Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
+(cherry picked from commit 36e4c02ff27b9d66755b9544778896b9b1e5c391)
+
+Change-Id: I9d8a07e576c6bf889f8f182c6fc0d34dc997c004
+---
+ src/afs/afs_fetchstore.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/afs/afs_fetchstore.c b/src/afs/afs_fetchstore.c
+index 7b35b8f7f..63b370dae 100644
+--- a/src/afs/afs_fetchstore.c
++++ b/src/afs/afs_fetchstore.c
+@@ -564,7 +564,6 @@ afs_CacheStoreVCache(struct dcache **dcList, struct vcache *avc,
+ afs_hyper_t *anewDV, afs_size_t *amaxStoredLength)
+ {
+ afs_int32 code = 0;
+- struct storeOps *ops;
+ void * rock = NULL;
+ unsigned int i, j;
+
+@@ -619,7 +618,8 @@ afs_CacheStoreVCache(struct dcache **dcList, struct vcache *avc,
+ ICL_HANDLE_OFFSET(length));
+
+ do {
+- tc = afs_Conn(&avc->f.fid, areq, 0, &rxconn);
++ struct storeOps *ops = NULL;
++ tc = afs_Conn(&avc->f.fid, areq, 0, &rxconn);
+
+ #ifdef AFS_64BIT_CLIENT
+ restart:
+--
+2.44.0
+
diff --git a/0022-afs-Add-static-attribute-to-internal-functions.patch b/0022-afs-Add-static-attribute-to-internal-functions.patch
new file mode 100644
index 000000000000..f6426e79cb4b
--- /dev/null
+++ b/0022-afs-Add-static-attribute-to-internal-functions.patch
@@ -0,0 +1,487 @@
+From d82082f27ba7308c41c7e2ef7585ed33d384bad7 Mon Sep 17 00:00:00 2001
+From: Cheyenne Wills <cwills@sinenomine.net>
+Date: Thu, 29 Feb 2024 17:53:31 -0700
+Subject: [PATCH 22/29] afs: Add static attribute to internal functions
+
+When building against a Linux 6.8 kernel, functions that are missing
+prototypes or declarations are flagged.
+
+We can add the static attribute to functions that are not referenced
+outside of the file that implements them to avoid having these functions
+flagged by the compiler.
+
+These functions are flagged due to missing prototypes when building
+against a Linux 6.8 kernel (which sets the -Wmissing-declarations and
+-Wmissing-prototypes compiler flags as default). Linux 6.8 commit:
+ 'Makefile.extrawarn: turn on missing-prototypes globally' (0fcb70851f).
+
+When building against a kernel with CONFIG_WERROR=y, the build fails.
+
+There are no functional changes in this commit.
+
+Reviewed-on: https://gerrit.openafs.org/15625
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
+(cherry picked from commit efee796f28b53bf3ffc03186f81790c36c23c94c)
+
+Change-Id: I0d923a65731f825d6c190056b0ccc3d362236706
+---
+ src/afs/LINUX/osi_file.c | 2 +-
+ src/afs/LINUX/osi_module.c | 4 ++--
+ src/afs/LINUX/osi_pag_module.c | 4 ++--
+ src/afs/afs_call.c | 6 ++---
+ src/afs/afs_disconnected.c | 20 ++++++++--------
+ src/afs/afs_fetchstore.c | 42 +++++++++++++++++-----------------
+ src/afs/afs_icl.c | 4 ++--
+ src/afs/afs_pag_cred.c | 4 ++--
+ src/afs/afs_server.c | 2 +-
+ src/afs/afs_vcache.c | 2 +-
+ 10 files changed, 45 insertions(+), 45 deletions(-)
+
+diff --git a/src/afs/LINUX/osi_file.c b/src/afs/LINUX/osi_file.c
+index e8c298068..cb91ecb0a 100644
+--- a/src/afs/LINUX/osi_file.c
++++ b/src/afs/LINUX/osi_file.c
+@@ -47,7 +47,7 @@ extern struct cred *cache_creds;
+ #endif
+
+ /* Old export ops: decode_fh will call back here. Accept any dentry it suggests */
+-int
++static int
+ afs_fh_acceptable(void *context, struct dentry *dp)
+ {
+ return 1;
+diff --git a/src/afs/LINUX/osi_module.c b/src/afs/LINUX/osi_module.c
+index fdc347d2c..30ac048d3 100644
+--- a/src/afs/LINUX/osi_module.c
++++ b/src/afs/LINUX/osi_module.c
+@@ -64,7 +64,7 @@ afs_init_idmap(void)
+ }
+ #endif
+
+-int __init
++static int __init
+ afs_init(void)
+ {
+ int err;
+@@ -114,7 +114,7 @@ afs_init(void)
+ return 0;
+ }
+
+-void __exit
++static void __exit
+ afs_cleanup(void)
+ {
+ afs_shutdown_pagecopy();
+diff --git a/src/afs/LINUX/osi_pag_module.c b/src/afs/LINUX/osi_pag_module.c
+index e832c5abd..24b938f0e 100644
+--- a/src/afs/LINUX/osi_pag_module.c
++++ b/src/afs/LINUX/osi_pag_module.c
+@@ -58,7 +58,7 @@ int afs_global_owner = 0;
+ struct user_namespace *afs_ns;
+ #endif
+
+-int __init
++static int __init
+ afspag_init(void)
+ {
+ #if !defined(EXPORTED_PROC_ROOT_FS)
+@@ -90,7 +90,7 @@ afspag_init(void)
+ return 0;
+ }
+
+-void __exit
++static void __exit
+ afspag_cleanup(void)
+ {
+ #if !defined(EXPORTED_PROC_ROOT_FS)
+diff --git a/src/afs/afs_call.c b/src/afs/afs_call.c
+index ba78bce6e..4ac63b187 100644
+--- a/src/afs/afs_call.c
++++ b/src/afs/afs_call.c
+@@ -267,7 +267,7 @@ afsd_thread(int *rock)
+ }
+ }
+
+-void
++static void
+ afs_DaemonOp(long parm, long parm2, long parm3, long parm4, long parm5,
+ long parm6)
+ {
+@@ -436,7 +436,7 @@ afsd_thread(void *rock)
+ return 0;
+ }
+
+-void
++static void
+ # if defined(AFS_LINUX_ENV) && !defined(INIT_WORK_HAS_DATA)
+ afsd_launcher(struct work_struct *work)
+ # else
+@@ -457,7 +457,7 @@ afsd_launcher(void *rock)
+ # endif /* !HAVE_LINUX_KTHREAD_RUN */
+ }
+
+-void
++static void
+ afs_DaemonOp(long parm, long parm2, long parm3, long parm4, long parm5,
+ long parm6)
+ {
+diff --git a/src/afs/afs_disconnected.c b/src/afs/afs_disconnected.c
+index 1aaabd905..03ff90f7e 100644
+--- a/src/afs/afs_disconnected.c
++++ b/src/afs/afs_disconnected.c
+@@ -102,7 +102,7 @@ afs_FindDCacheByFid(struct VenusFid *afid)
+ *
+ * \return Mask of operations.
+ */
+-int
++static int
+ afs_GenStoreStatus(struct vcache *avc, struct AFSStoreStatus *astat)
+ {
+ if (!avc || !astat || !avc->f.ddirty_flags)
+@@ -157,7 +157,7 @@ get_parent_dir_fid_hook(void *hdata, char *aname, afs_int32 vnode,
+ *
+ * \return 0 on success, -1 on failure
+ */
+-int
++static int
+ afs_GetParentDirFid(struct vcache *avc, struct VenusFid *afid)
+ {
+ struct dcache *tdc;
+@@ -234,7 +234,7 @@ get_vnode_name_hook(void *hdata, char *aname, afs_int32 vnode,
+ * \param deleted Has this file been deleted? If yes, use the shadow
+ * dir for looking up the name.
+ */
+-int
++static int
+ afs_GetVnodeName(struct vcache *avc, struct VenusFid *afid, char *aname,
+ int deleted)
+ {
+@@ -358,7 +358,7 @@ chk_del_children_hook(void *hdata, char *aname, afs_int32 vnode,
+ *
+ * \note afs_DDirtyVCListLock must be write locked.
+ */
+-int
++static int
+ afs_CheckDeletedChildren(struct vcache *avc)
+ {
+ struct dcache *tdc;
+@@ -452,7 +452,7 @@ fix_children_fids_hook(void *hdata, char *aname, afs_int32 vnode,
+ * \param old_fid The current dir's fid.
+ * \param new_fid The new dir's fid.
+ */
+-void
++static void
+ afs_FixChildrenFids(struct VenusFid *old_fid, struct VenusFid *new_fid)
+ {
+ struct dcache *tdc;
+@@ -499,7 +499,7 @@ afs_DbgListDirEntries(struct VenusFid *afid)
+ * be deferred to later in the resync process
+ */
+
+-int
++static int
+ afs_GetParentVCache(struct vcache *avc, int deleted, struct VenusFid *afid,
+ char *aname, struct vcache **adp)
+ {
+@@ -548,7 +548,7 @@ end:
+ * - Get the new name from the current dir.
+ * - Old dir fid and new dir fid are collected along the way.
+ * */
+-int
++static int
+ afs_ProcessOpRename(struct vcache *avc, struct vrequest *areq)
+ {
+ struct VenusFid old_pdir_fid, new_pdir_fid;
+@@ -651,7 +651,7 @@ done:
+ * - Handle errors.
+ * - Reorder vhash and dcaches in their hashes, using the newly acquired fid.
+ */
+-int
++static int
+ afs_ProcessOpCreate(struct vcache *avc, struct vrequest *areq,
+ afs_ucred_t *acred)
+ {
+@@ -921,7 +921,7 @@ end:
+ *
+ * \note avc must be write locked.
+ */
+-int
++static int
+ afs_ProcessOpRemove(struct vcache *avc, struct vrequest *areq)
+ {
+ char *tname = NULL;
+@@ -1022,7 +1022,7 @@ end:
+ *
+ * \return 0 for success. On failure, other error codes.
+ */
+-int
++static int
+ afs_SendChanges(struct vcache *avc, struct vrequest *areq)
+ {
+ struct afs_conn *tc;
+diff --git a/src/afs/afs_fetchstore.c b/src/afs/afs_fetchstore.c
+index 63b370dae..97d067181 100644
+--- a/src/afs/afs_fetchstore.c
++++ b/src/afs/afs_fetchstore.c
+@@ -77,14 +77,14 @@ FillStoreStats(int code, int idx, osi_timeval32_t xferStartTime,
+
+
+
+-afs_int32
++static afs_int32
+ rxfs_storeUfsPrepare(void *r, afs_uint32 size, afs_uint32 *tlen)
+ {
+ *tlen = (size > AFS_LRALLOCSIZ ? AFS_LRALLOCSIZ : size);
+ return 0;
+ }
+
+-afs_int32
++static afs_int32
+ rxfs_storeMemPrepare(void *r, afs_uint32 size, afs_uint32 *tlen)
+ {
+ afs_int32 code;
+@@ -105,7 +105,7 @@ rxfs_storeMemPrepare(void *r, afs_uint32 size, afs_uint32 *tlen)
+ return code;
+ }
+
+-afs_int32
++static afs_int32
+ rxfs_storeUfsRead(void *r, struct osi_file *tfile, afs_uint32 offset,
+ afs_uint32 tlen, afs_uint32 *bytesread)
+ {
+@@ -126,7 +126,7 @@ rxfs_storeUfsRead(void *r, struct osi_file *tfile, afs_uint32 offset,
+ return 0;
+ }
+
+-afs_int32
++static afs_int32
+ rxfs_storeMemRead(void *r, struct osi_file *tfile, afs_uint32 offset,
+ afs_uint32 tlen, afs_uint32 *bytesread)
+ {
+@@ -142,7 +142,7 @@ rxfs_storeMemRead(void *r, struct osi_file *tfile, afs_uint32 offset,
+ return 0;
+ }
+
+-afs_int32
++static afs_int32
+ rxfs_storeMemWrite(void *r, afs_uint32 l, afs_uint32 *byteswritten)
+ {
+ afs_int32 code;
+@@ -159,7 +159,7 @@ rxfs_storeMemWrite(void *r, afs_uint32 l, afs_uint32 *byteswritten)
+ return 0;
+ }
+
+-afs_int32
++static afs_int32
+ rxfs_storeUfsWrite(void *r, afs_uint32 l, afs_uint32 *byteswritten)
+ {
+ afs_int32 code;
+@@ -179,7 +179,7 @@ rxfs_storeUfsWrite(void *r, afs_uint32 l, afs_uint32 *byteswritten)
+ return 0;
+ }
+
+-afs_int32
++static afs_int32
+ rxfs_storePadd(void *rock, afs_uint32 size)
+ {
+ afs_int32 code = 0;
+@@ -203,7 +203,7 @@ rxfs_storePadd(void *rock, afs_uint32 size)
+ return 0;
+ }
+
+-afs_int32
++static afs_int32
+ rxfs_storeStatus(void *rock)
+ {
+ struct rxfs_storeVariables *v = (struct rxfs_storeVariables *)rock;
+@@ -213,7 +213,7 @@ rxfs_storeStatus(void *rock)
+ return 1;
+ }
+
+-afs_int32
++static afs_int32
+ rxfs_storeClose(void *r, struct AFSFetchStatus *OutStatus, int *doProcessFS)
+ {
+ afs_int32 code;
+@@ -236,7 +236,7 @@ rxfs_storeClose(void *r, struct AFSFetchStatus *OutStatus, int *doProcessFS)
+ return code;
+ }
+
+-afs_int32
++static afs_int32
+ rxfs_storeDestroy(void **r, afs_int32 code)
+ {
+ struct rxfs_storeVariables *v = (struct rxfs_storeVariables *)*r;
+@@ -255,7 +255,7 @@ rxfs_storeDestroy(void **r, afs_int32 code)
+ return code;
+ }
+
+-afs_int32
++static afs_int32
+ afs_GenericStoreProc(struct storeOps *ops, void *rock,
+ struct dcache *tdc, int *shouldwake,
+ afs_size_t *bytesXferred)
+@@ -353,7 +353,7 @@ struct storeOps rxfs_storeMemOps = {
+ #endif
+ };
+
+-afs_int32
++static afs_int32
+ rxfs_storeInit(struct vcache *avc, struct afs_conn *tc,
+ struct rx_connection *rxconn, afs_size_t base,
+ afs_size_t bytes, afs_size_t length,
+@@ -437,7 +437,7 @@ unsigned int storeallmissing = 0;
+ * \param ops pointer to the block of storeOps to be used for this operation
+ * \param rock pointer to the opaque protocol-specific data of this operation
+ */
+-afs_int32
++static afs_int32
+ afs_CacheStoreDCaches(struct vcache *avc, struct dcache **dclist,
+ afs_size_t bytes, afs_hyper_t *anewDV, int *doProcessFS,
+ struct AFSFetchStatus *OutStatus, afs_uint32 nchunks,
+@@ -720,7 +720,7 @@ struct rxfs_fetchVariables {
+ afs_int32 iovmax;
+ };
+
+-afs_int32
++static afs_int32
+ rxfs_fetchUfsRead(void *r, afs_uint32 size, afs_uint32 *bytesread)
+ {
+ afs_int32 code;
+@@ -738,7 +738,7 @@ rxfs_fetchUfsRead(void *r, afs_uint32 size, afs_uint32 *bytesread)
+ return 0;
+ }
+
+-afs_int32
++static afs_int32
+ rxfs_fetchMemRead(void *r, afs_uint32 tlen, afs_uint32 *bytesread)
+ {
+ afs_int32 code;
+@@ -755,7 +755,7 @@ rxfs_fetchMemRead(void *r, afs_uint32 tlen, afs_uint32 *bytesread)
+ }
+
+
+-afs_int32
++static afs_int32
+ rxfs_fetchMemWrite(void *r, struct osi_file *fP, afs_uint32 offset,
+ afs_uint32 tlen, afs_uint32 *byteswritten)
+ {
+@@ -771,7 +771,7 @@ rxfs_fetchMemWrite(void *r, struct osi_file *fP, afs_uint32 offset,
+ return 0;
+ }
+
+-afs_int32
++static afs_int32
+ rxfs_fetchUfsWrite(void *r, struct osi_file *fP, afs_uint32 offset,
+ afs_uint32 tlen, afs_uint32 *byteswritten)
+ {
+@@ -787,7 +787,7 @@ rxfs_fetchUfsWrite(void *r, struct osi_file *fP, afs_uint32 offset,
+ }
+
+
+-afs_int32
++static afs_int32
+ rxfs_fetchClose(void *r, struct vcache *avc, struct dcache * adc,
+ struct afs_FetchOutput *o)
+ {
+@@ -814,7 +814,7 @@ rxfs_fetchClose(void *r, struct vcache *avc, struct dcache * adc,
+ return code;
+ }
+
+-afs_int32
++static afs_int32
+ rxfs_fetchDestroy(void **r, afs_int32 code)
+ {
+ struct rxfs_fetchVariables *v = (struct rxfs_fetchVariables *)*r;
+@@ -833,7 +833,7 @@ rxfs_fetchDestroy(void **r, afs_int32 code)
+ return code;
+ }
+
+-afs_int32
++static afs_int32
+ rxfs_fetchMore(void *r, afs_int32 *length, afs_uint32 *moredata)
+ {
+ afs_int32 code;
+@@ -882,7 +882,7 @@ struct fetchOps rxfs_fetchMemOps = {
+ rxfs_fetchDestroy
+ };
+
+-afs_int32
++static afs_int32
+ rxfs_fetchInit(struct afs_conn *tc, struct rx_connection *rxconn,
+ struct vcache *avc, afs_offs_t base,
+ afs_uint32 size, afs_int32 *alength, struct dcache *adc,
+diff --git a/src/afs/afs_icl.c b/src/afs/afs_icl.c
+index 42b4a0ccb..08a166020 100644
+--- a/src/afs/afs_icl.c
++++ b/src/afs/afs_icl.c
+@@ -34,7 +34,7 @@ int afs_icl_sizeofLong = ICL_LONG;
+ int afs_icl_inited = 0;
+
+ /* init function, called once, under afs_icl_lock */
+-int
++static int
+ afs_icl_Init(void)
+ {
+ afs_icl_inited = 1;
+@@ -539,7 +539,7 @@ afs_icl_AppendString(struct afs_icl_log *logp, char *astr)
+ #endif
+
+
+-void
++static void
+ afs_icl_AppendOne(struct afs_icl_log *logp, int type, long parm)
+ {
+ if (type) {
+diff --git a/src/afs/afs_pag_cred.c b/src/afs/afs_pag_cred.c
+index 3dce8543b..e77cf8ae3 100644
+--- a/src/afs/afs_pag_cred.c
++++ b/src/afs/afs_pag_cred.c
+@@ -32,7 +32,7 @@ static struct afspag_cell *cells = 0;
+ static struct afspag_cell *primary_cell = 0;
+
+
+-struct afspag_cell *
++static struct afspag_cell *
+ afspag_GetCell(char *acell)
+ {
+ struct afspag_cell *tcell;
+@@ -66,7 +66,7 @@ out:
+ }
+
+
+-struct afspag_cell *
++static struct afspag_cell *
+ afspag_GetPrimaryCell(void)
+ {
+ struct afspag_cell *tcell;
+diff --git a/src/afs/afs_server.c b/src/afs/afs_server.c
+index 3674eff43..9d2d93cde 100644
+--- a/src/afs/afs_server.c
++++ b/src/afs/afs_server.c
+@@ -556,7 +556,7 @@ CkSrv_MarkUpDown(struct afs_conn **conns, struct rx_connection **rxconns,
+ }
+ }
+
+-void
++static void
+ CkSrv_GetCaps(int nconns, struct rx_connection **rxconns,
+ struct afs_conn **conns)
+ {
+diff --git a/src/afs/afs_vcache.c b/src/afs/afs_vcache.c
+index e72b45ea4..f500b65a3 100644
+--- a/src/afs/afs_vcache.c
++++ b/src/afs/afs_vcache.c
+@@ -727,7 +727,7 @@ afs_FlushReclaimedVcaches(void)
+ #endif
+ }
+
+-void
++static void
+ afs_PostPopulateVCache(struct vcache *avc, struct VenusFid *afid, int seq)
+ {
+ /*
+--
+2.44.0
+
diff --git a/0023-rx-Add-static-attribute-to-internal-functions.patch b/0023-rx-Add-static-attribute-to-internal-functions.patch
new file mode 100644
index 000000000000..4b4736ce91c5
--- /dev/null
+++ b/0023-rx-Add-static-attribute-to-internal-functions.patch
@@ -0,0 +1,76 @@
+From 5c40a30514681080a304c9a284e991371ad33689 Mon Sep 17 00:00:00 2001
+From: Cheyenne Wills <cwills@sinenomine.net>
+Date: Fri, 12 Jan 2024 15:30:23 -0700
+Subject: [PATCH 23/29] rx: Add static attribute to internal functions
+
+When building against a Linux 6.8 kernel, functions that are missing
+prototypes or declarations are flagged.
+
+We can add the static attribute to functions that are not referenced
+outside of the file that implements them to avoid having these functions
+flagged by the compiler.
+
+These functions are flagged due to missing prototypes when building
+against a Linux 6.8 kernel (which sets the -Wmissing-declarations and
+-Wmissing-prototypes compiler flags as default). Linux 6.8 commit:
+ 'Makefile.extrawarn: turn on missing-prototypes globally' (0fcb70851f).
+
+When building against a kernel with CONFIG_WERROR=y, the build fails.
+
+There are no functional changes in this commit.
+
+Reviewed-on: https://gerrit.openafs.org/15626
+Reviewed-by: Andrew Deason <adeason@sinenomine.net>
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
+Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
+(cherry picked from commit 55adceba2d561ec4e89235de329782a68e603a11)
+
+Change-Id: I1b2a6e1c07bd4b75b7b83e177f17865eb903e488
+---
+ src/rx/rx.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/src/rx/rx.c b/src/rx/rx.c
+index aaec60907..d6c52c369 100644
+--- a/src/rx/rx.c
++++ b/src/rx/rx.c
+@@ -6513,7 +6513,7 @@ mtuout:
+ return -1;
+ }
+
+-void
++static void
+ rxi_NatKeepAliveEvent(struct rxevent *event, void *arg1,
+ void *dummy, int dummy2)
+ {
+@@ -6615,7 +6615,7 @@ rx_SetConnSecondsUntilNatPing(struct rx_connection *conn, afs_int32 seconds)
+ * declared dead; if nothing has been sent for a while, we send a
+ * keep-alive packet (if we're actually trying to keep the call alive)
+ */
+-void
++static void
+ rxi_KeepAliveEvent(struct rxevent *event, void *arg1, void *dummy,
+ int dummy2)
+ {
+@@ -6656,7 +6656,7 @@ rxi_KeepAliveEvent(struct rxevent *event, void *arg1, void *dummy,
+ }
+
+ /* Does what's on the nameplate. */
+-void
++static void
+ rxi_GrowMTUEvent(struct rxevent *event, void *arg1, void *dummy, int dummy2)
+ {
+ struct rx_call *call = arg1;
+@@ -8266,7 +8266,7 @@ static int rxi_monitor_processStats = 0;
+ static int rxi_monitor_peerStats = 0;
+
+
+-void
++static void
+ rxi_ClearRPCOpStat(rx_function_entry_v1_p rpc_stat)
+ {
+ rpc_stat->invocations = 0;
+--
+2.44.0
+
diff --git a/0024-rxgen-Declare-generated-PKG_TranslateOpCode.patch b/0024-rxgen-Declare-generated-PKG_TranslateOpCode.patch
new file mode 100644
index 000000000000..ed16d683fa47
--- /dev/null
+++ b/0024-rxgen-Declare-generated-PKG_TranslateOpCode.patch
@@ -0,0 +1,52 @@
+From 8b9831622af6da269d12668e1b50816872dafcc7 Mon Sep 17 00:00:00 2001
+From: Andrew Deason <adeason@sinenomine.net>
+Date: Tue, 7 Dec 2021 15:43:35 -0600
+Subject: [PATCH 24/29] rxgen: Declare generated PKG_TranslateOpCode()
+
+Ever since commit 5c77a6ca (rxgen: add *TranslateOpcode functions to
+XDR code), rxgen generates a PKG_TranslateOpCode function in the
+relevant .xdr.c source, which can translate an RPC opcode into the RPC
+name. But we never declare this function in a header file, making it
+impossible to use without compiler warnings (unless the caller
+declares the function itself).
+
+To make it possible to actually use this function, declare this
+function in the generated header file.
+
+Reviewed-on: https://gerrit.openafs.org/14871
+Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
+Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
+(cherry picked from commit 9b2c27fc6d299cb0b23eca3e8cb25b7e0c41b11a)
+
+Change-Id: I2479ff7f6579769b3319b2939ffde60fe570c880
+---
+ src/rxgen/rpc_parse.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/rxgen/rpc_parse.c b/src/rxgen/rpc_parse.c
+index 768e42f3b..59854f4d5 100644
+--- a/src/rxgen/rpc_parse.c
++++ b/src/rxgen/rpc_parse.c
+@@ -2150,6 +2150,8 @@ h_ProcMainBody_setup(void)
+ {
+ f_print(fout,"\nextern int %s%sExecuteRequest(struct rx_call *);\n",
+ prefix, PackagePrefix[PackageIndex]);
++ f_print(fout,"extern char * %s%sTranslateOpCode(int op);\n", prefix,
++ PackagePrefix[PackageIndex]);
+ }
+
+ static void
+@@ -2161,6 +2163,8 @@ h_HeadofOldStyleProc_setup(void)
+ f_print(fout,"\nextern int %s%sExecuteRequest(struct rx_call *);\n",
+ prefix, pprefix);
+ f_print(fout,"\nextern int %sOpCodeIndex(int op);\n", PackagePrefix[PackageIndex]);
++ f_print(fout, "extern char * %s%sTranslateOpCode(int op);\n",
++ prefix, pprefix);
+ }
+
+ void
+--
+2.44.0
+
diff --git a/0025-rxgen-Declare-generated-PKG_OpCodeStats.patch b/0025-rxgen-Declare-generated-PKG_OpCodeStats.patch
new file mode 100644
index 000000000000..e74a7bfb8214
--- /dev/null
+++ b/0025-rxgen-Declare-generated-PKG_OpCodeStats.patch
@@ -0,0 +1,70 @@
+From 53c988023e7e6087026d6ed795ed4a13ea39cb94 Mon Sep 17 00:00:00 2001
+From: Cheyenne Wills <cwills@sinenomine.net>
+Date: Tue, 5 Mar 2024 07:40:08 -0700
+Subject: [PATCH 25/29] rxgen: Declare generated PKG_OpCodeStats()
+
+The function {PKG}_OpCodeStats() is generated by rxgen, however a
+prototype for the function is not generated.
+
+The functions h_ProcMainBody_setup() and h_HeadofOldStyleProc_setup()
+in rpc_parse.c emit prototypes for {PKG}_ExecuteRequest() and
+{PKG}_TranslateOpCode(), but do not emit a prototype for
+{PKG}_OpCodeStats().
+
+Update rxgen to emit a function prototype for {PKG}_OpCodeStats() in the
+generated header file.
+
+Use a variable to point to "PackagePrefix[PackageIndex]" in
+h_ProcMainBody_setup to improve readability.
+
+{PKG}_OpCodeStats(), specifically RXSTATS_OpCodeStats(), is flagged due
+to a missing prototype when building against a Linux 6.8 kernel (which
+sets the -Wmissing-declarations and -Wmissing-prototypes compiler flags
+as default). Linux 6.8 commit: 'Makefile.extrawarn: turn on
+missing-prototypes globally' (0fcb70851f). When building against a
+kernel with CONFIG_WERROR=y, the build fails.
+
+Reviewed-on: https://gerrit.openafs.org/15631
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
+Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
+(cherry picked from commit 26bb4d143b31ba027cf2721ac731df67a174c43b)
+
+Change-Id: I9072d22d142b5b7a2f59b0cfc4026066ef1d9501
+---
+ src/rxgen/rpc_parse.c | 10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/src/rxgen/rpc_parse.c b/src/rxgen/rpc_parse.c
+index 59854f4d5..e648a6600 100644
+--- a/src/rxgen/rpc_parse.c
++++ b/src/rxgen/rpc_parse.c
+@@ -2148,10 +2148,14 @@ er_TailofOldStyleProc_setup(void)
+ static void
+ h_ProcMainBody_setup(void)
+ {
++ char *pprefix = PackagePrefix[PackageIndex];
+ f_print(fout,"\nextern int %s%sExecuteRequest(struct rx_call *);\n",
+- prefix, PackagePrefix[PackageIndex]);
++ prefix, pprefix);
+ f_print(fout,"extern char * %s%sTranslateOpCode(int op);\n", prefix,
+- PackagePrefix[PackageIndex]);
++ pprefix);
++ f_print(fout,"extern struct %s%sstats *%s%sOpCodeStats(int op);\n",
++ prefix, pprefix,
++ prefix, pprefix);
+ }
+
+ static void
+@@ -2165,6 +2169,8 @@ h_HeadofOldStyleProc_setup(void)
+ f_print(fout,"\nextern int %sOpCodeIndex(int op);\n", PackagePrefix[PackageIndex]);
+ f_print(fout, "extern char * %s%sTranslateOpCode(int op);\n",
+ prefix, pprefix);
++ f_print(fout, "extern struct %s%sstats *%s%sOpCodeStats(int op);\n",
++ prefix, pprefix, prefix, pprefix);
+ }
+
+ void
+--
+2.44.0
+
diff --git a/0026-Linux-6.8-use-hlist-iteration-for-dentry-children.patch b/0026-Linux-6.8-use-hlist-iteration-for-dentry-children.patch
new file mode 100644
index 000000000000..e15bc3b11325
--- /dev/null
+++ b/0026-Linux-6.8-use-hlist-iteration-for-dentry-children.patch
@@ -0,0 +1,72 @@
+From 9befccd11d338dfc7220a3ae3695634cefd2c359 Mon Sep 17 00:00:00 2001
+From: Cheyenne Wills <cwills@sinenomine.net>
+Date: Mon, 12 Feb 2024 12:31:30 -0700
+Subject: [PATCH 26/29] Linux 6.8: use hlist iteration for dentry children
+
+Linux 6.8 commit 'dentry: switch the lists of children to hlist'
+(da549bdd15) replaces the dentry lists d_subdirs/d_child with the hlist
+d_children/d_sib.
+
+Add an autoconf test for a d_children member in the dentry structure.
+
+Define a macro that uses the applicable Linux function for iterating
+over a dentry's children.
+
+Reviewed-on: https://gerrit.openafs.org/15632
+Reviewed-by: Andrew Deason <adeason@sinenomine.net>
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
+Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
+(cherry picked from commit 8e0bbe6a07523dd2e7efb3c9d1b4ad9e19fc9bb7)
+
+Change-Id: Ief4c334c4ef3e54822e068dcdf654541e86b9176
+---
+ src/afs/LINUX/osi_vcache.c | 10 +++++++++-
+ src/cf/linux-kernel-struct.m4 | 3 +++
+ 2 files changed, 12 insertions(+), 1 deletion(-)
+
+diff --git a/src/afs/LINUX/osi_vcache.c b/src/afs/LINUX/osi_vcache.c
+index 897fd37ab..43644f44b 100644
+--- a/src/afs/LINUX/osi_vcache.c
++++ b/src/afs/LINUX/osi_vcache.c
+@@ -15,6 +15,14 @@
+
+ #include "osi_compat.h"
+
++#if defined(STRUCT_DENTRY_HAS_D_CHILDREN)
++# define afs_for_each_child(child, parent) \
++ hlist_for_each_entry((child), &(parent)->d_children, d_sib)
++#else
++# define afs_for_each_child(child, parent) \
++ list_for_each_entry((child), &(parent)->d_subdirs, d_child)
++#endif
++
+ static void
+ TryEvictDirDentries(struct inode *inode)
+ {
+@@ -312,7 +320,7 @@ osi_ResetVCache(struct vcache *avc)
+ * because 'dp' is an ancestor of 'child'.
+ */
+ struct dentry *child;
+- list_for_each_entry(child, &dp->d_subdirs, d_child) {
++ afs_for_each_child(child, dp) {
+ spin_lock(&child->d_lock);
+ child->d_time = 0;
+ spin_unlock(&child->d_lock);
+diff --git a/src/cf/linux-kernel-struct.m4 b/src/cf/linux-kernel-struct.m4
+index 2824ec198..5cd346fb5 100644
+--- a/src/cf/linux-kernel-struct.m4
++++ b/src/cf/linux-kernel-struct.m4
+@@ -17,6 +17,9 @@ AC_CHECK_LINUX_STRUCT([dentry], [d_u.d_alias], [dcache.h])
+ dnl linux 2.6.16 moved dentry->d_child to dentry->d_u.d_child
+ dnl linux 3.19 moved it back to dentry->d_child
+ AC_CHECK_LINUX_STRUCT([dentry], [d_u.d_child], [dcache.h])
++dnl linux 6.8 uses hlist for dentry children and renamed
++dnl d_subdirs/d_child to d_childern/d_sib
++AC_CHECK_LINUX_STRUCT([dentry], [d_children], [dcache.h])
+ AC_CHECK_LINUX_STRUCT([dentry_operations], [d_automount], [dcache.h])
+ AC_CHECK_LINUX_STRUCT([group_info], [gid], [cred.h])
+ AC_CHECK_LINUX_STRUCT([inode], [i_alloc_sem], [fs.h])
+--
+2.44.0
+
diff --git a/0027-Linux-6.8-Remove-ctl_table-sentinels.patch b/0027-Linux-6.8-Remove-ctl_table-sentinels.patch
new file mode 100644
index 000000000000..24bbd0b973c6
--- /dev/null
+++ b/0027-Linux-6.8-Remove-ctl_table-sentinels.patch
@@ -0,0 +1,86 @@
+From f9f074e6f9a3114b1926a90bd7810bfa192f9886 Mon Sep 17 00:00:00 2001
+From: Cheyenne Wills <cwills@sinenomine.net>
+Date: Tue, 5 Mar 2024 08:37:47 -0700
+Subject: [PATCH 27/29] Linux 6.8: Remove ctl_table sentinels
+
+The Linux 6.8 commit 'sysctl: Remove the now superfluous sentinel
+elements from ctl_table array' (c8a65501d3) was a clean up commit
+that removed the sentinel entry in the ctl_table array (e.g. the
+"null" entry at the end of the table).
+
+As of Linux 6.8, including the sentinel entry (.procname =) in the
+ctl_table is unnecessary, but doesn't yet break anything. But it is
+likely that including the sentinel will start to cause runtime errors in
+future Linux versions very soon, so avoid the sentinel when we can, to
+avoid possible problems in the future.
+
+Define a new macro that can be used as the last entry of a ctl_table
+that will either add a "null" entry, or nothing.
+
+There is not a specific build test we can use within configure, so we
+must explicitly test the Linux version to decide if we need to use a
+sentinel or not when defining the macro. We are selecting 6.8 to match
+the version where the Linux kernel is removing the sentinels from the in
+kernel filesystems.
+
+Note: See the Linux merge commits 'Merge tag 'sysctl-6.8-rc1' of
+git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux' (a05aea98d4)
+for more details behind the staged removal of the sentinels in the
+ctl_table structures and the potential future change for removing the
+actual check for the sentinel within the Linux kernel.
+
+Reviewed-on: https://gerrit.openafs.org/15645
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
+Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
+(cherry picked from commit 35c8c1bf0b1cb48178f676ba5bcf16ad59c5a33b)
+
+Change-Id: I34cb7586003e10a6c7438d7205123d57af30585e
+---
+ src/afs/LINUX/osi_sysctl.c | 16 ++++++++++------
+ 1 file changed, 10 insertions(+), 6 deletions(-)
+
+diff --git a/src/afs/LINUX/osi_sysctl.c b/src/afs/LINUX/osi_sysctl.c
+index a0a039892..c1116fc79 100644
+--- a/src/afs/LINUX/osi_sysctl.c
++++ b/src/afs/LINUX/osi_sysctl.c
+@@ -54,6 +54,14 @@ extern afs_int32 afs_pct2;
+ # define AFS_SYSCTL_INT(num, perms, var) \
+ AFS_SYSCTL_INT2(num, perms, #var, var)
+
++# if LINUX_VERSION_CODE >= KERNEL_VERSION(6,8,0)
++/* end of list sentinel not needed */
++# define AFS_SYSCTL_SENTINEL
++# else
++/* NULL entry to mark the end of the list */
++# define AFS_SYSCTL_SENTINEL { .procname = NULL }
++# endif
++
+ static struct ctl_table_header *afs_sysctl = NULL;
+
+ static struct ctl_table afs_sysctl_table[] = {
+@@ -75,9 +83,7 @@ static struct ctl_table afs_sysctl_table[] = {
+ AFS_SYSCTL_INT( 13, 0644, afs_cacheBlocks),
+ AFS_SYSCTL_INT2(14, 0644, "md5inum", afs_md5inum),
+
+- {
+- .procname = 0
+- }
++ AFS_SYSCTL_SENTINEL
+ };
+ # if !defined(HAVE_LINUX_REGISTER_SYSCTL)
+ static struct ctl_table fs_sysctl_table[] = {
+@@ -87,9 +93,7 @@ static struct ctl_table fs_sysctl_table[] = {
+ .mode = 0555,
+ .child = afs_sysctl_table
+ },
+- {
+- .procname = 0
+- }
++ AFS_SYSCTL_SENTINEL
+ };
+ # endif
+ int
+--
+2.44.0
+
diff --git a/0028-Linux-6.8-Use-roken-s-strlcpy-in-kernel-module.patch b/0028-Linux-6.8-Use-roken-s-strlcpy-in-kernel-module.patch
new file mode 100644
index 000000000000..16b7091a1d7e
--- /dev/null
+++ b/0028-Linux-6.8-Use-roken-s-strlcpy-in-kernel-module.patch
@@ -0,0 +1,156 @@
+From b6458796f2deef285fd0ad06480b5fc35cd8acb3 Mon Sep 17 00:00:00 2001
+From: Cheyenne Wills <cwills@sinenomine.net>
+Date: Mon, 11 Mar 2024 09:05:33 -0600
+Subject: [PATCH 28/29] Linux 6.8: Use roken's strlcpy() in kernel module
+
+The Linux 6.8 commit 'string: Remove strlcpy()' (d26270061a) removed the
+the strlcpy function from the Linux kernel. The replacement function,
+strscpy(), cannot be used as a drop-in replacement as its currently a
+Linux kernel specific function and there are differences in the returned
+value.
+
+We can use roken's strlcpy() (provided in roken/strlcpy.c).
+
+Create a configure test to that defines its own strlcpy() to test
+if the kernel doesn't provide one itself. Note, we need to use a
+different function signature for strlcpy() from what the kernel might
+have otherwise the test build succeeds when the kernel does provide a
+strlcpy().
+
+Update the OpenAFS kernel specific roken.h to define the prototype for
+strlcpy when it's not present in the Linux kernel. We need to match the
+defines used in the 'real' roken.h so the roken/strlcpy.c can build
+properly. Add defines for ROKEN_LIB_FUNCTION, ROKEN_LIB_CALL and
+ROKEN_LIB_VARIABLE to the kernel roken.h
+
+Update Linux's osi_machdep.h to include roken.h so the strlcpy protoype
+is available.
+
+Update the Linux MakefileProto to include the strcpy-kernel object
+when building the kernel module.
+
+Reviewed-on: https://gerrit.openafs.org/15646
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
+(cherry picked from commit 30b18c165752e6d0ce7b6daa6a90453f5e5e6d17)
+
+Change-Id: I8013623e8f735d15bb7d4ac84ed0867f12b77783
+---
+ src/afs/LINUX/osi_machdep.h | 1 +
+ src/cf/linux-kernel-func.m4 | 11 +++++++++++
+ src/crypto/hcrypto/kernel/roken.h | 29 +++++++++++++++++++++++++++++
+ src/external/libafsdep | 1 +
+ src/libafs/MakefileProto.LINUX.in | 6 ++++--
+ 5 files changed, 46 insertions(+), 2 deletions(-)
+
+diff --git a/src/afs/LINUX/osi_machdep.h b/src/afs/LINUX/osi_machdep.h
+index 916a1dfed..263c8633c 100644
+--- a/src/afs/LINUX/osi_machdep.h
++++ b/src/afs/LINUX/osi_machdep.h
+@@ -77,6 +77,7 @@
+ #endif
+
+ #include "afs/sysincludes.h"
++#include "roken.h"
+
+ #if !defined(HAVE_LINUX_TIME_T)
+ typedef time64_t time_t;
+diff --git a/src/cf/linux-kernel-func.m4 b/src/cf/linux-kernel-func.m4
+index 7f3000fc1..6f9d35022 100644
+--- a/src/cf/linux-kernel-func.m4
++++ b/src/cf/linux-kernel-func.m4
+@@ -252,6 +252,17 @@ AC_CHECK_LINUX_FUNC([inode_atime_mtime_accessors],
+ [inode_set_atime(NULL, 0, 0);
+ inode_set_mtime(NULL, 0, 0);])
+
++dnl Linux 6.8 removed the strlcpy() function. We test to see if we can redefine
++dnl a strlcpy() function. We use a totally different function signature to
++dnl to ensure that this fails when the kernel does provide strlcpy().
++AC_CHECK_LINUX_FUNC([no_strlcpy],
++ [[#include <linux/string.h>
++ size_t strlcpy(char *d);
++ size_t strlcpy(char *d) { return strlen(d); }]],
++ [[static char buff[10];
++ size_t s;
++ s = strlcpy(buff);]])
++
+ 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"],
+diff --git a/src/crypto/hcrypto/kernel/roken.h b/src/crypto/hcrypto/kernel/roken.h
+index f8c233468..6cb060131 100644
+--- a/src/crypto/hcrypto/kernel/roken.h
++++ b/src/crypto/hcrypto/kernel/roken.h
+@@ -11,6 +11,35 @@
+ # error "This header is for kernel code only"
+ #endif
+
++/*
++ * The following function annotations are not needed when building for kernel
++ * space
++ */
++#define ROKEN_LIB_FUNCTION
++#define ROKEN_LIB_CALL
++#define ROKEN_LIB_VARIABLE
++
++/*
++ * Our HAVE_STRLCPY from autoconf refers to whether strlcpy() is available in
++ * userspace. Whether it's available in the kernel is another question, so
++ * override HAVE_STRLCPY here. Usually it is available (only a few cases lack
++ * it), so turn it on by default, and turn it off for a few cases below.
++ */
++#undef HAVE_STRLCPY
++#define HAVE_STRLCPY 1
++
++#ifdef AFS_AIX_ENV
++# undef HAVE_STRLCPY
++#elif defined(AFS_LINUX_ENV) && defined(HAVE_LINUX_NO_STRLCPY)
++# undef HAVE_STRLCPY
++#endif
++
++/* strlcpy.c */
++#if defined (AFS_LINUX_ENV) && !defined(HAVE_STRLCPY)
++# define strlcpy rk_strlcpy
++ROKEN_LIB_FUNCTION size_t ROKEN_LIB_CALL strlcpy (char *, const char *, size_t);
++#endif
++
+ /* ct.c */
+ int ct_memcmp(const void *p1, const void *p2, size_t len);
+
+diff --git a/src/external/libafsdep b/src/external/libafsdep
+index fb365df2d..9d36a30c0 100644
+--- a/src/external/libafsdep
++++ b/src/external/libafsdep
+@@ -24,3 +24,4 @@ heimdal/krb5/crypto-evp.c
+ heimdal/krb5/keyblock.c
+ heimdal/krb5/store-int.c
+ heimdal/roken/ct.c
++heimdal/roken/strlcpy.c
+\ No newline at end of file
+diff --git a/src/libafs/MakefileProto.LINUX.in b/src/libafs/MakefileProto.LINUX.in
+index 8744ab8b6..6e62c8c97 100644
+--- a/src/libafs/MakefileProto.LINUX.in
++++ b/src/libafs/MakefileProto.LINUX.in
+@@ -42,7 +42,8 @@ AFS_OS_OBJS = \
+ osi_ioctl.o \
+ osi_proc.o \
+ osi_vnodeops.o \
+- osi_pagecopy.o
++ osi_pagecopy.o \
++ strlcpy-kernel.o
+
+ AFS_OS_PAGOBJS = \
+ osi_alloc.o \
+@@ -59,7 +60,8 @@ AFS_OS_PAGOBJS = \
+ osi_flush.o \
+ <all>
+ osi_ioctl.o \
+- osi_pag_module.o
++ osi_pag_module.o \
++ strlcpy-kernel.o
+
+ AFS_OS_NFSOBJS =
+
+--
+2.44.0
+
diff --git a/0029-afs-Drop-GLOCK-for-various-Rx-calls.patch b/0029-afs-Drop-GLOCK-for-various-Rx-calls.patch
new file mode 100644
index 000000000000..02b30b80d7b2
--- /dev/null
+++ b/0029-afs-Drop-GLOCK-for-various-Rx-calls.patch
@@ -0,0 +1,362 @@
+From 35c339ec6b648deb02f7598c02df07b0c2ad0021 Mon Sep 17 00:00:00 2001
+From: Andrew Deason <adeason@dson.org>
+Date: Sun, 3 May 2020 10:33:28 -0500
+Subject: [PATCH 29/29] afs: Drop GLOCK for various Rx calls
+
+Most calls into Rx from libafs do so without the AFS_GLOCK, but a few
+pieces of code still hold AFS_GLOCK while making some Rx calls. A few
+calls into Rx also currently require AFS_GLOCK, but drop AFS_GLOCK
+internally, which is somewhat confusing/inconsistent. Calling Rx
+functions with AFS_GLOCK held can potentially cause locking/allocation
+problems on various platforms, such as FreeBSD where we get WITNESS
+warnings about acquiring sleepable Rx locks while holding the
+non-sleepable AFS_GLOCK.
+
+Fix a variety of Rx calls from libafs to drop AFS_GLOCK before calling
+into Rx. Specifically, this commit handles calls to rxi_GetIFInfo,
+rx_InitHost, rx_StartServer, rx_ServerProc, rx_GetConnection,
+rx_DestroyConnection/rx_PutConnection, and
+rx_SetConnSecondsUntilNatPing.
+
+For calls made via afs_start_thread, adjust afs_start_thread to accept
+a new argument that says whether to acquire AFS_GLOCK for the relevant
+function or not.
+
+For a call to rx_InitHost inside afs_InitSetup, dropping GLOCK makes
+it possible for another thread to also enter afs_InitSetup while we're
+running, before afs_InitSetup_done is set. To prevent two threads from
+running afs_InitSetup in parallel, introduce afs_InitSetup_running
+(which is set while afs_InitSetup is running), and simply wait for it
+to be cleared if it is set when we enter afs_InitSetup.
+
+This commit does not handle strictly all calls into Rx from libafs,
+since many Rx calls don't do anything interesting besides set some
+internal variables, and so AFS_GLOCK doesn't really matter for them,
+and dropping/reacquiring it around those calls may have performance
+impact.
+
+Reviewed-on: https://gerrit.openafs.org/14184
+Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+(cherry picked from commit d5e1428a3bd4a7fbb4401cf17176474f0c1825d3)
+
+ Conflicts:
+ src/afs/afs_call.c - context only due to not having commit:
+ 'Log binding ip address and port during startup' (02dede5d40)
+
+Change-Id: I0d14105d5dc8bfd4740c7a9adfc61c36f8a2318c
+---
+ src/afs/LINUX/osi_misc.c | 22 +++++++++++++++++++---
+ src/afs/LINUX/osi_prototypes.h | 2 +-
+ src/afs/afs_call.c | 19 ++++++++++++++++++-
+ src/afs/afs_callback.c | 2 ++
+ src/afs/afs_conn.c | 6 ++++++
+ src/afs/afs_daemons.c | 14 ++++++++------
+ src/afs/afs_init.c | 2 ++
+ src/afs/afs_pag_call.c | 15 ++++++++++-----
+ src/rx/rx_kcommon.c | 10 ----------
+ 9 files changed, 66 insertions(+), 26 deletions(-)
+
+diff --git a/src/afs/LINUX/osi_misc.c b/src/afs/LINUX/osi_misc.c
+index aa5d5fc93..be6984661 100644
+--- a/src/afs/LINUX/osi_misc.c
++++ b/src/afs/LINUX/osi_misc.c
+@@ -155,7 +155,18 @@ int osi_abspath(char *aname, char *buf, int buflen,
+
+
+ /* This could use some work, and support on more platforms. */
+-int afs_thread_wrapper(void *rock)
++static int
++afs_thread_wrapper(void *rock)
++{
++ void (*proc)(void) = rock;
++ __module_get(THIS_MODULE);
++ (*proc)();
++ module_put(THIS_MODULE);
++ return 0;
++}
++
++static int
++afs_thread_wrapper_glock(void *rock)
+ {
+ void (*proc)(void) = rock;
+ __module_get(THIS_MODULE);
+@@ -166,7 +177,12 @@ int afs_thread_wrapper(void *rock)
+ return 0;
+ }
+
+-void afs_start_thread(void (*proc)(void), char *name)
++void
++afs_start_thread(void (*proc)(void), char *name, int needs_glock)
+ {
+- kthread_run(afs_thread_wrapper, proc, "%s", name);
++ if (needs_glock) {
++ kthread_run(afs_thread_wrapper_glock, proc, "%s", name);
++ } else {
++ kthread_run(afs_thread_wrapper, proc, "%s", name);
++ }
+ }
+diff --git a/src/afs/LINUX/osi_prototypes.h b/src/afs/LINUX/osi_prototypes.h
+index 130b5660e..2ed054339 100644
+--- a/src/afs/LINUX/osi_prototypes.h
++++ b/src/afs/LINUX/osi_prototypes.h
+@@ -50,7 +50,7 @@ extern int osi_lookupname(char *aname, uio_seg_t seg, int followlink,
+ struct dentry **dpp);
+ extern int osi_abspath(char *aname, char *buf, int buflen,
+ int followlink, char **pathp);
+-extern void afs_start_thread(void (*proc)(void), char *name);
++extern void afs_start_thread(void (*proc)(void), char *name, int needs_glock);
+
+ /* osi_probe.c */
+ extern void *osi_find_syscall_table(int which);
+diff --git a/src/afs/afs_call.c b/src/afs/afs_call.c
+index 4ac63b187..7fb323c29 100644
+--- a/src/afs/afs_call.c
++++ b/src/afs/afs_call.c
+@@ -104,11 +104,19 @@ extern afs_int32 afs_md5inum;
+ static int
+ afs_InitSetup(int preallocs)
+ {
++ static int afs_InitSetup_running;
++
+ int code;
+
++ while (afs_InitSetup_running) {
++ afs_osi_Sleep(&afs_InitSetup_running);
++ }
++
+ if (afs_InitSetup_done)
+ return EAGAIN;
+
++ afs_InitSetup_running = 1;
++
+ #ifdef AFS_SUN510_ENV
+ /* Initialize a RW lock for the ifinfo global array */
+ rw_init(&afsifinfo_lock, NULL, RW_DRIVER, NULL);
+@@ -133,10 +141,12 @@ afs_InitSetup(int preallocs)
+ /* start RX */
+ if(!afscall_set_rxpck_received)
+ rx_extraPackets = AFS_NRXPACKETS; /* smaller # of packets */
++ AFS_GUNLOCK();
+ code = rx_InitHost(rx_bindhost, htons(7001));
++ AFS_GLOCK();
+ if (code) {
+ afs_warn("AFS: RX failed to initialize %d).\n", code);
+- return code;
++ goto done;
+ }
+ rx_SetRxDeadTime(afs_rx_deadtime);
+ /* resource init creates the services */
+@@ -145,6 +155,9 @@ afs_InitSetup(int preallocs)
+ afs_InitSetup_done = 1;
+ afs_osi_Wakeup(&afs_InitSetup_done);
+
++ done:
++ afs_InitSetup_running = 0;
++ afs_osi_Wakeup(&afs_InitSetup_running);
+ return code;
+ }
+
+@@ -1703,7 +1716,9 @@ afs_shutdown(enum afs_shutdown_type cold_flag)
+ afs_warn("CB... ");
+
+ afs_termState = AFSOP_STOP_RXCALLBACK;
++ AFS_GUNLOCK();
+ rx_WakeupServerProcs();
++ AFS_GLOCK();
+ #ifdef AFS_AIX51_ENV
+ shutdown_rxkernel();
+ #endif
+@@ -1756,7 +1771,9 @@ afs_shutdown(enum afs_shutdown_type cold_flag)
+ afs_warn("NetIfPoller... ");
+ osi_StopNetIfPoller();
+ #endif
++ AFS_GUNLOCK();
+ rxi_FreeAllPackets();
++ AFS_GLOCK();
+
+ afs_termState = AFSOP_STOP_COMPLETE;
+
+diff --git a/src/afs/afs_callback.c b/src/afs/afs_callback.c
+index 1fe990edf..7cffef6ff 100644
+--- a/src/afs/afs_callback.c
++++ b/src/afs/afs_callback.c
+@@ -985,7 +985,9 @@ afs_RXCallBackServer(void)
+ /*
+ * Donate this process to Rx.
+ */
++ AFS_GUNLOCK();
+ rx_ServerProc(NULL);
++ AFS_GLOCK();
+ return (0);
+
+ } /*afs_RXCallBackServer */
+diff --git a/src/afs/afs_conn.c b/src/afs/afs_conn.c
+index 2a3a513b2..8728ce518 100644
+--- a/src/afs/afs_conn.c
++++ b/src/afs/afs_conn.c
+@@ -532,7 +532,9 @@ afs_ConnBySA(struct srvAddr *sap, unsigned short aport, afs_int32 acell,
+ */
+ if ((service != 52) && (sap->natping == NULL)) {
+ sap->natping = tc;
++ AFS_GUNLOCK();
+ rx_SetConnSecondsUntilNatPing(tc->id, 20);
++ AFS_GLOCK();
+ }
+
+ tc->forceConnectFS = 0; /* apparently we're appropriately connected now */
+@@ -542,7 +544,9 @@ afs_ConnBySA(struct srvAddr *sap, unsigned short aport, afs_int32 acell,
+ } /* end of if (tc->forceConnectFS)*/
+
+ *rxconn = tc->id;
++ AFS_GUNLOCK();
+ rx_GetConnection(*rxconn);
++ AFS_GLOCK();
+
+ ReleaseSharedLock(&afs_xconn);
+ return tc;
+@@ -672,7 +676,9 @@ afs_PutConn(struct afs_conn *ac, struct rx_connection *rxconn,
+ (unsigned long)(uintptrsz)ac, (int)ac->refCount);
+ }
+ ac->parent->refCount--;
++ AFS_GUNLOCK();
+ rx_PutConnection(rxconn);
++ AFS_GLOCK();
+ } /*afs_PutConn */
+
+
+diff --git a/src/afs/afs_daemons.c b/src/afs/afs_daemons.c
+index 1879772fb..632aa849b 100644
+--- a/src/afs/afs_daemons.c
++++ b/src/afs/afs_daemons.c
+@@ -223,19 +223,21 @@ afs_Daemon(void)
+ }
+ }
+ if (last10MinCheck + 600 < now) {
++ int addrs_changed;
+ #ifdef AFS_USERSPACE_IP_ADDR
+ extern int rxi_GetcbiInfo(void);
+ #endif
+ afs_Trace1(afs_iclSetp, CM_TRACE_PROBEUP, ICL_TYPE_INT32, 600);
+ #ifdef AFS_USERSPACE_IP_ADDR
+- if (rxi_GetcbiInfo()) { /* addresses changed from last time */
+- afs_FlushCBs();
+- }
+-#else /* AFS_USERSPACE_IP_ADDR */
+- if (rxi_GetIFInfo()) { /* addresses changed from last time */
++ addrs_changed = rxi_GetcbiInfo();
++#else
++ AFS_GUNLOCK();
++ addrs_changed = rxi_GetIFInfo();
++ AFS_GLOCK();
++#endif
++ if (addrs_changed) { /* addresses changed from last time */
+ afs_FlushCBs();
+ }
+-#endif /* else AFS_USERSPACE_IP_ADDR */
+ if (!afs_CheckServerDaemonStarted)
+ afs_CheckServers(0, NULL);
+ afs_GCUserData(); /* gc old conns */
+diff --git a/src/afs/afs_init.c b/src/afs/afs_init.c
+index bdb791c1a..efa513256 100644
+--- a/src/afs/afs_init.c
++++ b/src/afs/afs_init.c
+@@ -554,7 +554,9 @@ afs_ResourceInit(int preallocs)
+ afs_server =
+ rx_NewService(0, RX_STATS_SERVICE_ID, "rpcstats", &secobj, 1,
+ RXSTATS_ExecuteRequest);
++ AFS_GUNLOCK();
+ rx_StartServer(0);
++ AFS_GLOCK();
+ afs_osi_Wakeup(&afs_server); /* wakeup anyone waiting for it */
+ return 0;
+
+diff --git a/src/afs/afs_pag_call.c b/src/afs/afs_pag_call.c
+index 610cfb3a8..9b7a90631 100644
+--- a/src/afs/afs_pag_call.c
++++ b/src/afs/afs_pag_call.c
+@@ -91,10 +91,13 @@ afspag_Init(afs_int32 nfs_server_addr)
+ afs_uuid_create(&afs_cb_interface.uuid);
+
+ AFS_GLOCK();
+-
+ afs_InitStats();
++ AFS_GUNLOCK();
++
+ rx_Init(htons(7001));
+
++ AFS_GLOCK();
++
+ AFS_STATCNT(afs_ResourceInit);
+ AFS_RWLOCK_INIT(&afs_xuser, "afs_xuser");
+ AFS_RWLOCK_INIT(&afs_xpagcell, "afs_xpagcell");
+@@ -117,18 +120,20 @@ afspag_Init(afs_int32 nfs_server_addr)
+ 1, RXSTATS_ExecuteRequest);
+ pagcb_svc = rx_NewService(0, PAGCB_SERVICEID, "pagcb", &srv_secobj,
+ 1, PAGCB_ExecuteRequest);
++ AFS_GUNLOCK();
+ rx_StartServer(0);
++ AFS_GLOCK();
+
+ clt_secobj = rxnull_NewClientSecurityObject();
+ rmtsys_conn = rx_NewConnection(nfs_server_addr, htons(7009),
+ RMTSYS_SERVICEID, clt_secobj, 0);
+
+ #ifdef RXK_LISTENER_ENV
+- afs_start_thread(rxk_Listener, "Rx Listener");
++ afs_start_thread(rxk_Listener, "Rx Listener", 1);
+ #endif
+- afs_start_thread((void *)(void *)rx_ServerProc, "Rx Server Thread");
+- afs_start_thread(afs_rxevent_daemon, "Rx Event Daemon");
+- afs_start_thread(afs_Daemon, "AFS PAG Daemon");
++ afs_start_thread((void *)(void *)rx_ServerProc, "Rx Server Thread", 0);
++ afs_start_thread(afs_rxevent_daemon, "Rx Event Daemon", 1);
++ afs_start_thread(afs_Daemon, "AFS PAG Daemon", 1);
+
+ afs_icl_InitLogs();
+
+diff --git a/src/rx/rx_kcommon.c b/src/rx/rx_kcommon.c
+index c90df3d36..239cf1607 100644
+--- a/src/rx/rx_kcommon.c
++++ b/src/rx/rx_kcommon.c
+@@ -267,13 +267,7 @@ rx_ServerProc(void *unused)
+ threadID = rxi_availProcs++;
+ MUTEX_EXIT(&rx_quota_mutex);
+
+-# ifdef RX_ENABLE_LOCKS
+- AFS_GUNLOCK();
+-# endif /* RX_ENABLE_LOCKS */
+ rxi_ServerProc(threadID, NULL, NULL);
+-# ifdef RX_ENABLE_LOCKS
+- AFS_GLOCK();
+-# endif /* RX_ENABLE_LOCKS */
+
+ return NULL;
+ }
+@@ -856,8 +850,6 @@ rxk_NewSocketHost(afs_uint32 ahost, short aport)
+ # if (defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)) && defined(KERNEL_FUNNEL)
+ thread_funnel_switch(KERNEL_FUNNEL, NETWORK_FUNNEL);
+ # endif
+- AFS_ASSERT_GLOCK();
+- AFS_GUNLOCK();
+ # if defined(AFS_HPUX102_ENV)
+ # if defined(AFS_HPUX110_ENV)
+ /* we need a file associated with the socket so sosend in NetSend
+@@ -997,14 +989,12 @@ rxk_NewSocketHost(afs_uint32 ahost, short aport)
+ # endif /* else defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) */
+ # endif /* else AFS_HPUX110_ENV */
+
+- AFS_GLOCK();
+ # if defined(AFS_DARWIN_ENV) && defined(KERNEL_FUNNEL)
+ thread_funnel_switch(NETWORK_FUNNEL, KERNEL_FUNNEL);
+ # endif
+ return (osi_socket *)newSocket;
+
+ bad:
+- AFS_GLOCK();
+ # if defined(AFS_DARWIN_ENV) && defined(KERNEL_FUNNEL)
+ thread_funnel_switch(NETWORK_FUNNEL, KERNEL_FUNNEL);
+ # endif
+--
+2.44.0
+
diff --git a/PKGBUILD b/PKGBUILD
index aaf76a21a807..0bdb3072f690 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -5,30 +5,124 @@
pkgname=openafs-modules
_srcname=openafs
-pkgver=1.8.4
+pkgver=1.8.11
pkgrel=1
pkgdesc="Kernel module for OpenAFS"
arch=('i686' 'x86_64' 'armv7h')
url="http://www.openafs.org"
-license=('custom:"IBM Public License Version 1.0"')
+license=(IPL-1.0)
depends=('openafs')
makedepends=('libelf' 'linux-headers')
conflicts=('openafs-features-libafs' 'openafs<1.6.6-2')
options=(!emptydirs)
-source=("http://openafs.org/dl/openafs/${pkgver}/${_srcname}-${pkgver}-src.tar.bz2")
install=openafs-modules.install
-sha256sums=('b18a654b8224bbefcff4e63ead312da2754aca17943ded60b9475062b506639a')
+source=(http://openafs.org/dl/openafs/${pkgver}/${_srcname}-${pkgver}-src.tar.bz2
+ 0001-afs-Make-afs_AllocDCache-static.patch
+ 0002-LINUX-Minor-osi_vfsop.c-cleanup.patch
+ 0003-afs-Remove-SRXAFSCB_GetDE.patch
+ 0004-afs-remove-dead-ICL-fstrace-code.patch
+ 0005-cf-Add-function-prototypes-for-linux-conftest.patch
+ 0006-afs-Remove-DFlushDCache.patch
+ 0007-afs-Remove-afs_MemExtendEntry.patch
+ 0008-afs-Remove-afs_osi_UnmaskUserLoop.patch
+ 0009-afs-Remove-dummy_PSetAcl.patch
+ 0010-afs-Remove-SRXAFSCB_FetchData-StoreData.patch
+ 0011-afs-Remove-afs_DbgDisconFiles.patch
+ 0012-afs-Add-declaration-for-RXAFS_ResidencyCmd.patch
+ 0013-roken-Declare-ct_memcmp-in-hcrypto-kernel-roken.h.patch
+ 0014-Linux-6.8-Add-function-prototypes-for-krb5.patch
+ 0015-afs-Declare-init_hckernel_mutex.patch
+ 0016-afs-Add-includes-to-pick-up-function-prototypes.patch
+ 0017-afs-Move-function-prototypes-into-headers.patch
+ 0018-afs-Add-afs_xioctl-prototyes-to-afs_prototypes.h.patch
+ 0019-afs-Remove-SRXAFSCB-protos-from-afs_prototypes.h.patch
+ 0020-rx-Add-function-prototypes-to-rx_prototypes.h.patch
+ 0021-afs-fix-ops-variable-may-be-used-uninitialized.patch
+ 0022-afs-Add-static-attribute-to-internal-functions.patch
+ 0023-rx-Add-static-attribute-to-internal-functions.patch
+ 0024-rxgen-Declare-generated-PKG_TranslateOpCode.patch
+ 0025-rxgen-Declare-generated-PKG_OpCodeStats.patch
+ 0026-Linux-6.8-use-hlist-iteration-for-dentry-children.patch
+ 0027-Linux-6.8-Remove-ctl_table-sentinels.patch
+ 0028-Linux-6.8-Use-roken-s-strlcpy-in-kernel-module.patch
+ 0029-afs-Drop-GLOCK-for-various-Rx-calls.patch)
+sha256sums=('e2efb4710996b7d23198b53c56295a8f9e24e8a555317c5fc63b8125a3714ecd'
+ 'e85f5656f76700e4236b1033cf4b7f08c59ab757d52d2a67dcb2c65762388733'
+ '8d48b727e77b1e952310ad9f94bd4ece9e64e1f03a35463bb23dffa1009738d8'
+ 'c44c91e31df1ec77f1a39eb7b172c4e348e41b293ae05606288bfe333ad7c29b'
+ '48dd1065f8bcb90d0bdc7ae5b484da5a1a5d93461f6ac1d6ceef103d2b807f22'
+ 'ce054eadb9c84173b0bd1318ef88cb9500049431779252e501491d9389141bad'
+ 'ae525167f5f6f7e0301eee70b3424e51e45e56e9fe9588b95cf72d5fa96717b9'
+ '974861c174969591351c5fb4a47946e02f979c2b5590f89d9d16dfbe4238451f'
+ 'e5d72b5e08c63df10299b56bfebf3c5c44e07d16c0436fb2c0eef3614ad505e3'
+ '8143496d251dd1f13b8603b4e692fbd67f925caccd12035598e70542d24389f5'
+ '216e684f8181adc4a4b3c4ba934997cada10831c5608e724e91d09e836ec626d'
+ '2e573535da21f8be5b83c8e82166c0bdc5896293b28e793fa4c1bdb9ff942dbd'
+ '0535fbdd3c8431b7b16842f1fa6592355f647ae456112e97d34d541e74204be5'
+ '7aacef8bd6832f119472f7d52af36951a56f1e54d36d9bce59998fcf818517e5'
+ '3db5177c80a7694c1be3b74f419570a5076edc519b40112cf17e68fecc7574a3'
+ '9fe647d54c999e358597fe671dc7e88da609a69bb93624e15919d9b4cc4fdb5a'
+ '7ced2ca2d4f54b2fa15c584869de122810ee0d1b024d1bf541f38d77172e311c'
+ 'c88c8b8e1c993da773eea3ae4f17e5171189ed7e1fc5769fdb49d82cae0cffd3'
+ 'c57c826c9f26568241bcb17eff04067a1b5e388f72523765aa80d480c3690325'
+ 'd508dd6136170fcb4794e283178f9c5f4ede12f415b882ba7c13470e8f09bdde'
+ '894eb7e7889749cefa9cbf86e2eceda470d20510a5a7a5be2cd851f8570e076c'
+ 'fb36b0ef833811910cae42d8411a00dcf2aff08c8799f766e32cda3ad5a7f0e2'
+ 'd08d38ff53890632900de5d69dc105711d5bce2d02a55ffe70c87b38ca39aca7'
+ 'db700b5f62e979af60856278306e8fce6df21dfb24996dd0d690c82222f4d793'
+ '46294f8323bf71ee96c8f765bb36fc5e0af6b2257deac7eaea4f4cb9568d9fe1'
+ '5d4a2614065046a32ef805198349e70476d3ed9e079a4ef7577e71e0dac1d2fa'
+ '4c8201265f558bac146bf8cee38f8c925b2c2262133ae88d9eb2f0623a0ada07'
+ 'ceb02a7a5e596434215693f065ad6221f568f85aab173df4752248d2c4d8f971'
+ '2b05242c5516871191a251a617c6c02e80f34b92b6cfeb0c9c6a1f3e0ff915d9'
+ '82b197ac5f2639d891c8a646963ef6b87ef4171c7a70ac6ca7a9a55511090952')
# Heuristic to determine version of installed kernel
# You can modify this if the heuristic fails
-_kernelver=$(ls -dt /usr/lib/modules/* | head -n1 | cut -d/ -f5)
+if uname -r | grep -q lts; then
+ # if you are currently running an lts kernel, only consider lts versions
+ _kernelver=$(ls -dt /usr/lib/modules/*lts* | head -n1 | cut -d/ -f5)
+else
+ _kernelver=$(ls -dt /usr/lib/modules/* | head -n1 | cut -d/ -f5)
+fi
_extramodules="/usr/lib/modules/${_kernelver}/extramodules"
prepare() {
cd "${srcdir}/${_srcname}-${pkgver}"
+ # Compatibility with Linux 6.8
+ patch -p1 < "$srcdir"/0001-afs-Make-afs_AllocDCache-static.patch
+ patch -p1 < "$srcdir"/0002-LINUX-Minor-osi_vfsop.c-cleanup.patch
+ patch -p1 < "$srcdir"/0003-afs-Remove-SRXAFSCB_GetDE.patch
+ patch -p1 < "$srcdir"/0004-afs-remove-dead-ICL-fstrace-code.patch
+ patch -p1 < "$srcdir"/0005-cf-Add-function-prototypes-for-linux-conftest.patch
+ patch -p1 < "$srcdir"/0006-afs-Remove-DFlushDCache.patch
+ patch -p1 < "$srcdir"/0007-afs-Remove-afs_MemExtendEntry.patch
+ patch -p1 < "$srcdir"/0008-afs-Remove-afs_osi_UnmaskUserLoop.patch
+ patch -p1 < "$srcdir"/0009-afs-Remove-dummy_PSetAcl.patch
+ patch -p1 < "$srcdir"/0010-afs-Remove-SRXAFSCB_FetchData-StoreData.patch
+ patch -p1 < "$srcdir"/0011-afs-Remove-afs_DbgDisconFiles.patch
+ patch -p1 < "$srcdir"/0012-afs-Add-declaration-for-RXAFS_ResidencyCmd.patch
+ patch -p1 < "$srcdir"/0013-roken-Declare-ct_memcmp-in-hcrypto-kernel-roken.h.patch
+ patch -p1 < "$srcdir"/0014-Linux-6.8-Add-function-prototypes-for-krb5.patch
+ patch -p1 < "$srcdir"/0015-afs-Declare-init_hckernel_mutex.patch
+ patch -p1 < "$srcdir"/0016-afs-Add-includes-to-pick-up-function-prototypes.patch
+ patch -p1 < "$srcdir"/0017-afs-Move-function-prototypes-into-headers.patch
+ patch -p1 < "$srcdir"/0018-afs-Add-afs_xioctl-prototyes-to-afs_prototypes.h.patch
+ patch -p1 < "$srcdir"/0019-afs-Remove-SRXAFSCB-protos-from-afs_prototypes.h.patch
+ patch -p1 < "$srcdir"/0020-rx-Add-function-prototypes-to-rx_prototypes.h.patch
+ patch -p1 < "$srcdir"/0021-afs-fix-ops-variable-may-be-used-uninitialized.patch
+ patch -p1 < "$srcdir"/0022-afs-Add-static-attribute-to-internal-functions.patch
+ patch -p1 < "$srcdir"/0023-rx-Add-static-attribute-to-internal-functions.patch
+ patch -p1 < "$srcdir"/0024-rxgen-Declare-generated-PKG_TranslateOpCode.patch
+ patch -p1 < "$srcdir"/0025-rxgen-Declare-generated-PKG_OpCodeStats.patch
+ patch -p1 < "$srcdir"/0026-Linux-6.8-use-hlist-iteration-for-dentry-children.patch
+ patch -p1 < "$srcdir"/0027-Linux-6.8-Remove-ctl_table-sentinels.patch
+ patch -p1 < "$srcdir"/0028-Linux-6.8-Use-roken-s-strlcpy-in-kernel-module.patch
+ patch -p1 < "$srcdir"/0029-afs-Drop-GLOCK-for-various-Rx-calls.patch
+
# Only needed when changes to configure were made
- # ./regen.sh -q
+ ./regen.sh -q
}
build() {