From ee77161eb82749e58bc8392b79468d7510167efa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20La=C3=9F?= Date: Thu, 31 Oct 2024 07:19:22 +0100 Subject: [PATCH] openafs: update to 1.8.12.2 --- nvchecker.json | 2 +- openafs-modules-dkms/.SRCINFO | 18 +- ...-symbolic-names-for-Rx-magic-numbers.patch | 121 -- ...-MIN-MAX-macros-with-opr_min-opr_max.patch | 1545 ----------------- ...Remove-MIN-and-MAX-macro-definitions.patch | 885 ---------- ...-includes-for-MIN-MAX-in-rx_packet.h.patch | 55 - openafs-modules-dkms/PKGBUILD | 20 +- openafs-modules/.SRCINFO | 16 +- ...-symbolic-names-for-Rx-magic-numbers.patch | 121 -- ...-MIN-MAX-macros-with-opr_min-opr_max.patch | 1545 ----------------- ...Remove-MIN-and-MAX-macro-definitions.patch | 885 ---------- ...-includes-for-MIN-MAX-in-rx_packet.h.patch | 55 - openafs-modules/PKGBUILD | 22 +- openafs/.SRCINFO | 20 +- ...-symbolic-names-for-Rx-magic-numbers.patch | 121 -- ...-MIN-MAX-macros-with-opr_min-opr_max.patch | 1545 ----------------- ...Remove-MIN-and-MAX-macro-definitions.patch | 885 ---------- ...-includes-for-MIN-MAX-in-rx_packet.h.patch | 55 - openafs/PKGBUILD | 26 +- 19 files changed, 29 insertions(+), 7913 deletions(-) delete mode 100644 openafs-modules-dkms/0001-rx-Define-symbolic-names-for-Rx-magic-numbers.patch delete mode 100644 openafs-modules-dkms/0002-opr-replace-MIN-MAX-macros-with-opr_min-opr_max.patch delete mode 100644 openafs-modules-dkms/0003-Remove-MIN-and-MAX-macro-definitions.patch delete mode 100644 openafs-modules-dkms/0004-rx-Remove-includes-for-MIN-MAX-in-rx_packet.h.patch delete mode 100644 openafs-modules/0001-rx-Define-symbolic-names-for-Rx-magic-numbers.patch delete mode 100644 openafs-modules/0002-opr-replace-MIN-MAX-macros-with-opr_min-opr_max.patch delete mode 100644 openafs-modules/0003-Remove-MIN-and-MAX-macro-definitions.patch delete mode 100644 openafs-modules/0004-rx-Remove-includes-for-MIN-MAX-in-rx_packet.h.patch delete mode 100644 openafs/0001-rx-Define-symbolic-names-for-Rx-magic-numbers.patch delete mode 100644 openafs/0002-opr-replace-MIN-MAX-macros-with-opr_min-opr_max.patch delete mode 100644 openafs/0003-Remove-MIN-and-MAX-macro-definitions.patch delete mode 100644 openafs/0004-rx-Remove-includes-for-MIN-MAX-in-rx_packet.h.patch diff --git a/nvchecker.json b/nvchecker.json index 36d3a8c..1f375b3 100644 --- a/nvchecker.json +++ b/nvchecker.json @@ -94,7 +94,7 @@ "url": "https://github.com/braice/MuMuDVB/releases/tag/2.1.0" }, "openafs": { - "version": "1.8.12.1" + "version": "1.8.12.2" }, "pidgin-latex": { "version": "1.5.0" diff --git a/openafs-modules-dkms/.SRCINFO b/openafs-modules-dkms/.SRCINFO index e1334e2..9e7dbcc 100644 --- a/openafs-modules-dkms/.SRCINFO +++ b/openafs-modules-dkms/.SRCINFO @@ -1,7 +1,7 @@ pkgbase = openafs-modules-dkms pkgdesc = Kernel module for OpenAFS (dkms) - pkgver = 1.8.12.1 - pkgrel = 2 + pkgver = 1.8.12.2 + pkgrel = 1 url = http://www.openafs.org arch = i686 arch = x86_64 @@ -10,22 +10,14 @@ pkgbase = openafs-modules-dkms depends = dkms depends = libelf depends = openafs>=1.8.12.1-2 - provides = openafs-modules=1.8.12.1 + provides = openafs-modules=1.8.12.2 conflicts = openafs-features-libafs conflicts = openafs-modules conflicts = openafs<1.6.6-2 options = !emptydirs - source = http://openafs.org/dl/openafs/1.8.12.1/openafs-1.8.12.1-src.tar.bz2 - source = 0001-rx-Define-symbolic-names-for-Rx-magic-numbers.patch - source = 0002-opr-replace-MIN-MAX-macros-with-opr_min-opr_max.patch - source = 0003-Remove-MIN-and-MAX-macro-definitions.patch - source = 0004-rx-Remove-includes-for-MIN-MAX-in-rx_packet.h.patch + source = http://openafs.org/dl/openafs/1.8.12.2/openafs-1.8.12.2-src.tar.bz2 source = dkms.conf - sha256sums = dfe2f39bef9fb3d6791d602e725be7c34b885e4299018266ff9743cb401e594a - sha256sums = 89858ec91fb7cef85f7996c2eeeeb087a7996ed5d902ae4e3ac668e086753b05 - sha256sums = 247fbe76610056123525b11511f4a426913c7ee61b59f88fdbc0871239af9a94 - sha256sums = 9b3cac93406f13b3c1ad41c424c43e4df2c997ba9af68e8b73caf3db7e4df42f - sha256sums = a7c4eb9dec81628459783705ceee531b29a81c254298e84c89cdc99e6c77729e + sha256sums = 1164194cc6ffd75c063c420fb37344e844c1e2edc155529f815ba4c781f45cab sha256sums = 5ea5e184f9b44f5ed45817d2b5a10149d15c8c54f49e0b5b4b773652673cb9b0 pkgname = openafs-modules-dkms diff --git a/openafs-modules-dkms/0001-rx-Define-symbolic-names-for-Rx-magic-numbers.patch b/openafs-modules-dkms/0001-rx-Define-symbolic-names-for-Rx-magic-numbers.patch deleted file mode 100644 index 69c6ff5..0000000 --- a/openafs-modules-dkms/0001-rx-Define-symbolic-names-for-Rx-magic-numbers.patch +++ /dev/null @@ -1,121 +0,0 @@ -From 4b7b53c8d081a0c12a16e91dbe40cc73eba41a26 Mon Sep 17 00:00:00 2001 -From: Mark Vitale -Date: Fri, 7 May 2021 18:20:11 -0400 -Subject: [PATCH 1/4] rx: Define symbolic names for Rx magic numbers - -Since the original IBM code import, the magic number '6' has been used -to specify the number of consecutive lost keepalives (ping acks) that -indicate a dead connection. By implication, this also defines the -minimum number of seconds (at the minimum keeplive periodicity of 1 -second) before a connection may be considered dead. - -Define and use symbolic names for both uses of '6', and document their -relationship. Both have the same assigned value '6', but -RX_PINGS_LOST_BEFORE_DEAD is use as an ordinal count, while -RX_MINDEADTIME is expressed in units of seconds. - -The magic number '12' is used in a couple of places for the default -value of rx_connDeadTime. Give this constant a name -(RX_DEFAULT_DEAD_TIME) and use it. - -No functional change is incurred by this commit. - -Reviewed-on: https://gerrit.openafs.org/14621 -Reviewed-by: Benjamin Kaduk -Tested-by: Benjamin Kaduk -(cherry picked from commit b4a4a2ae9c9546482dd94c7a89793b1bfa1714cd) - -Change-Id: I87c2de0c1a14a9414a86e6fc0744139a120fbab9 ---- - src/rx/rx.c | 12 ++++++------ - src/rx/rx.h | 12 ++++++++++++ - src/rx/rx_globals.h | 2 +- - 3 files changed, 19 insertions(+), 7 deletions(-) - -diff --git a/src/rx/rx.c b/src/rx/rx.c -index d6c52c369..b3cc50c9b 100644 ---- a/src/rx/rx.c -+++ b/src/rx/rx.c -@@ -550,7 +550,7 @@ rx_InitHost(u_int host, u_int port) - #endif /* RX_ENABLE_LOCKS && KERNEL */ - - rxi_nCalls = 0; -- rx_connDeadTime = 12; -+ rx_connDeadTime = RX_DEFAULT_DEAD_TIME; - rx_tranquil = 0; /* reset flag */ - rxi_ResetStatistics(); - htable = osi_Alloc(rx_hashTableSize * sizeof(struct rx_connection *)); -@@ -1118,12 +1118,12 @@ rxi_CheckConnTimeouts(struct rx_connection *conn) - /* a connection's timeouts must have the relationship - * deadTime <= idleDeadTime <= hardDeadTime. Otherwise, for example, a - * total loss of network to a peer may cause an idle timeout instead of a -- * dead timeout, simply because the idle timeout gets hit first. Also set -- * a minimum deadTime of 6, just to ensure it doesn't get set too low. */ -+ * dead timeout, simply because the idle timeout gets hit first. Also -+ * enforce a minimum deadTime, just to ensure it doesn't get set too low. */ - /* this logic is slightly complicated by the fact that - * idleDeadTime/hardDeadTime may not be set at all, but it's not too bad. - */ -- conn->secondsUntilDead = MAX(conn->secondsUntilDead, 6); -+ conn->secondsUntilDead = MAX(conn->secondsUntilDead, RX_MINDEADTIME); - if (conn->idleDeadTime) { - conn->idleDeadTime = MAX(conn->idleDeadTime, conn->secondsUntilDead); - } -@@ -1143,7 +1143,7 @@ rx_SetConnDeadTime(struct rx_connection *conn, int seconds) - * keepalives to be dropped without timing out the connection. */ - conn->secondsUntilDead = seconds; - rxi_CheckConnTimeouts(conn); -- conn->secondsUntilPing = conn->secondsUntilDead / 6; -+ conn->secondsUntilPing = conn->secondsUntilDead / RX_PINGS_LOST_BEFORE_DEAD; - } - - void -@@ -6723,7 +6723,7 @@ rxi_ScheduleGrowMTUEvent(struct rx_call *call, int secs) - when = now; - if (!secs) { - if (call->conn->secondsUntilPing) -- secs = (6*call->conn->secondsUntilPing)-1; -+ secs = (RX_PINGS_LOST_BEFORE_DEAD * call->conn->secondsUntilPing)-1; - - if (call->conn->secondsUntilDead) - secs = MIN(secs, (call->conn->secondsUntilDead-1)); -diff --git a/src/rx/rx.h b/src/rx/rx.h -index ee1331e85..f9a387db6 100644 ---- a/src/rx/rx.h -+++ b/src/rx/rx.h -@@ -163,7 +163,19 @@ extern u_short rx_PortOf(struct rx_peer *peer); - - /* Configurable parameters */ - #define RX_IDLE_DEAD_TIME 60 /* default idle dead time */ -+#define RX_DEFAULT_DEAD_TIME 12 /* Default timeout for an unresponsive connection */ - #define RX_MAX_SERVICES 20 /* Maximum number of services that may be installed */ -+/* -+ * The number of consecutive keepalives (ping acks) that must be lost/missing -+ * before declaring an rx_call dead timeout (RX_CALL_DEAD). This number was -+ * chosen to be relatively small while allowing for "several" pings to be lost -+ * without triggering a timeout. (We are running on UDP after all). Since the -+ * miniumum non-zero secondsUntilPing is 1 second, this also determines the -+ * minimum rx dead time. -+ */ -+#define RX_PINGS_LOST_BEFORE_DEAD 6 -+#define RX_MINDEADTIME (RX_PINGS_LOST_BEFORE_DEAD * 1) -+ - #if defined(KERNEL) && defined(AFS_AIX51_ENV) && defined(__64__) - # define RX_DEFAULT_STACK_SIZE 24000 - #else -diff --git a/src/rx/rx_globals.h b/src/rx/rx_globals.h -index caf0d3bc9..558dc553b 100644 ---- a/src/rx/rx_globals.h -+++ b/src/rx/rx_globals.h -@@ -65,7 +65,7 @@ EXT int rx_extraPackets GLOBALSINIT(256); - EXT int rx_stackSize GLOBALSINIT(RX_DEFAULT_STACK_SIZE); - - /* Time until an unresponsive connection is declared dead */ --EXT int rx_connDeadTime GLOBALSINIT(12); -+EXT int rx_connDeadTime GLOBALSINIT(RX_DEFAULT_DEAD_TIME); - - /* Set rx default connection dead time; set on both services and connections at creation time */ - #ifdef AFS_NT40_ENV --- -2.46.1 - diff --git a/openafs-modules-dkms/0002-opr-replace-MIN-MAX-macros-with-opr_min-opr_max.patch b/openafs-modules-dkms/0002-opr-replace-MIN-MAX-macros-with-opr_min-opr_max.patch deleted file mode 100644 index 75d0765..0000000 --- a/openafs-modules-dkms/0002-opr-replace-MIN-MAX-macros-with-opr_min-opr_max.patch +++ /dev/null @@ -1,1545 +0,0 @@ -From fc95bb974bf35e7a43d76b0ac7883671b550e01f Mon Sep 17 00:00:00 2001 -From: Cheyenne Wills -Date: Mon, 9 Sep 2024 13:15:47 -0600 -Subject: [PATCH 2/4] opr: replace MIN/MAX macros with opr_min/opr_max - -Introduce new macros, opr_min() and opr_max(), to avoid collisions with -existing MIN()/MAX() macros defined elsewhere. - -Within OpenAFS, the MIN/MAX macros are defined in the platform specific -param.h include file. This same file is where AFS_{platform}_ENV is -defined, which is used throughout the OpenAFS source to determine which -platform specific headers are to be used. This can lead to collisions -if platform provided headers define MIN or MAX. - -Introduce opr_min and opr_max, using the same definitions that have been -used for MIN and MAX. Put the definitions in opr.h, which is already -included in most of the code that uses the MIN or MAX macros. - -Replace all uses of MIN and MAX with opr_min and opr_max. - -Add or move the include for afs/opr.h as needed. - -Note, this commit does not replace the min()/max() macros. - -A later commit will remove the defines for MIN and MAX (which will -correct a Linux 6.11 build failure due to a collision). - -Reviewed-on: https://gerrit.openafs.org/15813 -Tested-by: BuildBot -Reviewed-by: Michael Meffie -Reviewed-by: Andrew Deason -(cherry picked from commit 915c5cff168344797e011ee81913d4026c0cea80) - -[Backport: Move opr.h include in src/rx/rx.c. The MIN/MAX macros are -still present in the deprecated afsweb component.] - -Change-Id: I05fa833e00f31f07af55cebeb00a996a280bdcef ---- - src/afs/AIX/osi_groups.c | 3 +- - src/afs/DARWIN/osi_groups.c | 3 +- - src/afs/DARWIN/osi_vnodeops.c | 3 +- - src/afs/FBSD/osi_groups.c | 3 +- - src/afs/HPUX/osi_groups.c | 3 +- - src/afs/HPUX/osi_vnodeops.c | 9 ++-- - src/afs/IRIX/osi_groups.c | 3 +- - src/afs/IRIX/osi_vnodeops.c | 13 ++--- - src/afs/NBSD/osi_groups.c | 3 +- - src/afs/NBSD/osi_vnodeops.c | 3 +- - src/afs/OBSD/osi_groups.c | 3 +- - src/afs/UKERNEL/afs_usrops.c | 3 +- - src/afs/VNOPS/afs_vnop_strategy.c | 3 +- - src/afs/VNOPS/afs_vnop_write.c | 3 +- - src/afs/afs_call.c | 5 +- - src/lwp/iomgr.c | 2 +- - src/opr/opr.h | 3 ++ - src/rx/AIX/rx_knet.c | 7 +-- - src/rx/DARWIN/rx_knet.c | 7 +-- - src/rx/FBSD/rx_knet.c | 7 +-- - src/rx/IRIX/rx_knet.c | 8 ++-- - src/rx/SOLARIS/rx_knet.c | 13 ++--- - src/rx/rx.c | 79 +++++++++++++++---------------- - src/rx/rx_getaddr.c | 8 ++-- - src/rx/rx_globals.h | 2 +- - src/rx/rx_kcommon.c | 37 ++++++++------- - src/rx/rx_packet.c | 35 +++++++------- - src/rx/rx_packet.h | 2 +- - src/rx/rx_rdwr.c | 22 ++++----- - src/rx/rx_user.c | 28 +++++------ - src/rxkad/crypt_conn.c | 6 +-- - src/rxkad/rxkad_client.c | 3 +- - 32 files changed, 178 insertions(+), 154 deletions(-) - -diff --git a/src/afs/AIX/osi_groups.c b/src/afs/AIX/osi_groups.c -index 2ef317f42..219dd6db7 100644 ---- a/src/afs/AIX/osi_groups.c -+++ b/src/afs/AIX/osi_groups.c -@@ -19,6 +19,7 @@ - - #include "afs/sysincludes.h" - #include "afsincludes.h" -+#include "afs/opr.h" - #include "afs/afs_stats.h" /* statistics */ - - -@@ -130,7 +131,7 @@ afs_getgroups(struct ucred *cred, int ngroups, gid_t * gidset) - gidset[0] = gidset[1] = 0; - AFS_STATCNT(afs_getgroups); - -- savengrps = ngrps = MIN(ngroups, cred->cr_ngrps); -+ savengrps = ngrps = opr_min(ngroups, cred->cr_ngrps); - gp = cred->cr_groups; - while (ngrps--) - *gidset++ = *gp++; -diff --git a/src/afs/DARWIN/osi_groups.c b/src/afs/DARWIN/osi_groups.c -index 11e65e378..5899c7287 100644 ---- a/src/afs/DARWIN/osi_groups.c -+++ b/src/afs/DARWIN/osi_groups.c -@@ -18,6 +18,7 @@ - #include "afs/param.h" - #include "afs/sysincludes.h" - #include "afsincludes.h" -+#include "afs/opr.h" - #include "afs/afs_stats.h" /* statistics */ - - /* We should be doing something better anyway */ -@@ -122,7 +123,7 @@ afs_getgroups(struct ucred *cred, int ngroups, gid_t * gidset) - gid_t *gp; - - AFS_STATCNT(afs_getgroups); -- savengrps = ngrps = MIN(ngroups, cred->cr_ngroups); -+ savengrps = ngrps = opr_min(ngroups, cred->cr_ngroups); - gp = cred->cr_groups; - while (ngrps--) - *gidset++ = *gp++; -diff --git a/src/afs/DARWIN/osi_vnodeops.c b/src/afs/DARWIN/osi_vnodeops.c -index b903cc7c4..a92ed5358 100644 ---- a/src/afs/DARWIN/osi_vnodeops.c -+++ b/src/afs/DARWIN/osi_vnodeops.c -@@ -8,6 +8,7 @@ - #include /* Standard vendor system headers */ - #include /* Afs-based standard headers */ - #include /* statistics */ -+#include - #include - #include - #include -@@ -2103,7 +2104,7 @@ afs_vop_cmap(ap) - * } */ *ap; - { - *ap->a_bpn = (daddr_t) (ap->a_foffset / DEV_BSIZE); -- *ap->a_run = MAX(ap->a_size, AFS_CHUNKSIZE(ap->a_foffset)); -+ *ap->a_run = opr_max(ap->a_size, AFS_CHUNKSIZE(ap->a_foffset)); - return 0; - } - #endif -diff --git a/src/afs/FBSD/osi_groups.c b/src/afs/FBSD/osi_groups.c -index 6326f6c90..2267550bf 100644 ---- a/src/afs/FBSD/osi_groups.c -+++ b/src/afs/FBSD/osi_groups.c -@@ -22,6 +22,7 @@ - - #include "afs/sysincludes.h" - #include "afsincludes.h" -+#include "afs/opr.h" - #include "afs/afs_stats.h" /* statistics */ - - static int -@@ -106,7 +107,7 @@ afs_getgroups(struct ucred *cred, int ngroups, gid_t * gidset) - gid_t *gp; - - AFS_STATCNT(afs_getgroups); -- savengrps = ngrps = MIN(ngroups, cred->cr_ngroups); -+ savengrps = ngrps = opr_min(ngroups, cred->cr_ngroups); - gp = cred->cr_groups; - while (ngrps--) - *gidset++ = *gp++; -diff --git a/src/afs/HPUX/osi_groups.c b/src/afs/HPUX/osi_groups.c -index 8d6d9dbd7..c3b024c23 100644 ---- a/src/afs/HPUX/osi_groups.c -+++ b/src/afs/HPUX/osi_groups.c -@@ -19,6 +19,7 @@ - - #include "afs/sysincludes.h" - #include "afsincludes.h" -+#include "afs/opr.h" - #include "afs/afs_stats.h" /* statistics */ - - static int -@@ -104,7 +105,7 @@ afs_getgroups(struct ucred *cred, int ngroups, gid_t * gidset) - if (gp[-1] != NOGROUP) - break; - } -- savengrps = ngrps = MIN(ngroups, gp - cred->cr_groups); -+ savengrps = ngrps = opr_min(ngroups, gp - cred->cr_groups); - for (gp = cred->cr_groups; ngrps--;) - *gidset++ = *gp++; - return savengrps; -diff --git a/src/afs/HPUX/osi_vnodeops.c b/src/afs/HPUX/osi_vnodeops.c -index b54bf1a25..711cae8e0 100644 ---- a/src/afs/HPUX/osi_vnodeops.c -+++ b/src/afs/HPUX/osi_vnodeops.c -@@ -15,6 +15,7 @@ - - #include "afs/sysincludes.h" /* Standard vendor system headers */ - #include "afsincludes.h" /* Afs-based standard headers */ -+#include "afs/opr.h" - #include "afs/afs_stats.h" /* statistics stuff */ - - #include -@@ -87,7 +88,7 @@ m_cpytoc(m, off, len, cp) - if (m == NULL) - return (len); - -- ml = MIN(len, m->m_len - off); -+ ml = opr_min(len, m->m_len - off); - memcpy(cp, mtod(m, caddr_t) + off, (u_int) ml); - cp += ml; - len -= ml; -@@ -720,8 +721,8 @@ afspgin_setup_io_ranges(vfspage_t * vm_info, pgcnt_t bpages, k_off_t isize, - - maxpage = startindex + (bpages - (startindex + file_offset) % bpages); - maxpage = vm_reset_maxpage(vm_info, maxpage); -- maxpage = MIN(maxpage, (pgcnt_t) btorp(isize) - file_offset); -- maxpage = MIN(maxpage, startindex + maxpagein); -+ maxpage = opr_min(maxpage, (pgcnt_t) btorp(isize) - file_offset); -+ maxpage = opr_min(maxpage, startindex + maxpagein); - multio_maxpage = maxpage = vm_maxpage(vm_info, maxpage); - - if (!maxpage) -@@ -753,7 +754,7 @@ afspgin_setup_io_ranges(vfspage_t * vm_info, pgcnt_t bpages, k_off_t isize, - maxpage = startindex + count; - VASSERT(maxpage <= startindex + maxpagein); - minpage = startindex - (startindex + file_offset) % bpages; -- minpage = MAX(minpage, maxpage - maxpagein); -+ minpage = opr_max(minpage, maxpage - maxpagein); - VASSERT(startindex >= VM_BASE_OFFSET(vm_info)); - minpage = vm_minpage(vm_info, minpage); - VASSERT(minpage <= startindex); -diff --git a/src/afs/IRIX/osi_groups.c b/src/afs/IRIX/osi_groups.c -index 208ddcde5..d3f8b3347 100644 ---- a/src/afs/IRIX/osi_groups.c -+++ b/src/afs/IRIX/osi_groups.c -@@ -21,6 +21,7 @@ - - #include "afs/sysincludes.h" - #include "afsincludes.h" -+#include "afs/opr.h" - #include "afs/afs_stats.h" /* statistics */ - - -@@ -229,7 +230,7 @@ afs_getgroups(struct ucred *cred, int ngroups, gid_t * gidset) - - gidset[0] = gidset[1] = 0; - AFS_STATCNT(afs_getgroups); -- savengrps = ngrps = MIN(ngroups, cred->cr_ngroups); -+ savengrps = ngrps = opr_min(ngroups, cred->cr_ngroups); - gp = cred->cr_groups; - while (ngrps--) - *gidset++ = *gp++; -diff --git a/src/afs/IRIX/osi_vnodeops.c b/src/afs/IRIX/osi_vnodeops.c -index 1d4a26cff..da0df46c4 100644 ---- a/src/afs/IRIX/osi_vnodeops.c -+++ b/src/afs/IRIX/osi_vnodeops.c -@@ -16,6 +16,7 @@ - - #include "afs/sysincludes.h" /* Standard vendor system headers */ - #include "afsincludes.h" /* Afs-based standard headers */ -+#include "afs/opr.h" - #include "afs/afs_stats.h" /* statistics */ - #include "sys/flock.h" - #include "afs/nfsclient.h" -@@ -408,7 +409,7 @@ afsrwvp(struct vcache *avc, struct uio *uio, enum uio_rw rw, - /* - * compute minimum of rest of block and rest of file - */ -- cnt = MIN(bsize - off, rem); -+ cnt = opr_min(bsize - off, rem); - osi_Assert((off + cnt) <= bsize); - bsize = ctob(btoc(off + cnt)); - len = BTOBBT(bsize); -@@ -417,7 +418,7 @@ afsrwvp(struct vcache *avc, struct uio *uio, enum uio_rw rw, - bmv[0].length = len; - bmv[0].bsize = bsize; - bmv[0].pboff = off; -- bmv[0].pbsize = MIN(cnt, uio->uio_resid); -+ bmv[0].pbsize = opr_min(cnt, uio->uio_resid); - bmv[0].eof = 0; - bmv[0].pbdev = vp->v_rdev; - bmv[0].pmp = uio->uio_pmp; -@@ -439,7 +440,7 @@ afsrwvp(struct vcache *avc, struct uio *uio, enum uio_rw rw, - bsize = AFSBSIZE; - bmv[1].bn = bmv[1].offset = bn + len; - osi_Assert((BBTOB(bn + len) % bsize) == 0); -- acnt = MIN(bsize, rem); -+ acnt = opr_min(bsize, rem); - bsize = ctob(btoc(acnt)); - len = BTOBBT(bsize); - nmaps = 2; -@@ -500,7 +501,7 @@ afsrwvp(struct vcache *avc, struct uio *uio, enum uio_rw rw, - } - counter++; - -- cnt = MIN(bsize - off, uio->uio_resid); -+ cnt = opr_min(bsize - off, uio->uio_resid); - bsize = ctob(btoc(off + cnt)); - len = BTOBBT(bsize); - bmv[0].bn = bn; -@@ -637,7 +638,7 @@ OSI_VC_DECL(avc); - if (rem <= 0) - cnt = 0; /* EOF */ - else -- cnt = MIN(bsize - off, rem); -+ cnt = opr_min(bsize - off, rem); - - /* - * It is benign to ignore *nbmv > 1, since it is only for requesting -@@ -650,7 +651,7 @@ OSI_VC_DECL(avc); - */ - osi_Assert((off + cnt) <= bsize); - bsize = ctob(btoc(off + cnt)); -- bmv->pbsize = MIN(cnt, count); -+ bmv->pbsize = opr_min(cnt, count); - bmv->eof = 0; - bmv->pmp = NULL; - bmv->pbdev = avc->v.v_rdev; -diff --git a/src/afs/NBSD/osi_groups.c b/src/afs/NBSD/osi_groups.c -index 78b80e70b..9ee543932 100644 ---- a/src/afs/NBSD/osi_groups.c -+++ b/src/afs/NBSD/osi_groups.c -@@ -21,6 +21,7 @@ - - #include "afs/sysincludes.h" - #include "afs/afsincludes.h" -+#include "afs/opr.h" - #include "afs/afs_stats.h" /* statistics */ - #include "sys/syscallargs.h" - -@@ -106,7 +107,7 @@ osi_getgroups(afs_ucred_t *cred, int ngroups, gid_t *gidset) - { - AFS_STATCNT(afs_getgroups); - -- ngroups = MIN(kauth_cred_ngroups(cred), ngroups); -+ ngroups = opr_min(kauth_cred_ngroups(cred), ngroups); - - kauth_cred_getgroups(cred, gidset, ngroups, UIO_SYSSPACE); - return ngroups; -diff --git a/src/afs/NBSD/osi_vnodeops.c b/src/afs/NBSD/osi_vnodeops.c -index 2dc0a9b0c..f6c604919 100644 ---- a/src/afs/NBSD/osi_vnodeops.c -+++ b/src/afs/NBSD/osi_vnodeops.c -@@ -100,6 +100,7 @@ NONINFRINGEMENT. - - #include "afs/sysincludes.h" /* Standard vendor system headers */ - #include "afs/afsincludes.h" /* Afs-based standard headers */ -+#include "afs/opr.h" - #include "afs/afs_stats.h" /* statistics */ - - #include -@@ -206,7 +207,7 @@ static void - afs_nbsd_gop_size(struct vnode *vp, off_t size, off_t *eobp, int flags) - { - -- *eobp = MAX(size, vp->v_size); -+ *eobp = opr_max(size, vp->v_size); - } - - static int -diff --git a/src/afs/OBSD/osi_groups.c b/src/afs/OBSD/osi_groups.c -index e26088f19..208e5a744 100644 ---- a/src/afs/OBSD/osi_groups.c -+++ b/src/afs/OBSD/osi_groups.c -@@ -21,6 +21,7 @@ - - #include "afs/sysincludes.h" - #include "afs/afsincludes.h" -+#include "afs/opr.h" - #include "afs/afs_stats.h" /* statistics */ - #include "sys/syscallargs.h" - -@@ -115,7 +116,7 @@ afs_getgroups(struct ucred *cred, int ngroups, gid_t * gidset) - gid_t *gp; - - AFS_STATCNT(afs_getgroups); -- savengrps = ngrps = MIN(ngroups, cred->cr_ngroups); -+ savengrps = ngrps = opr_min(ngroups, cred->cr_ngroups); - gp = cred->cr_groups; - while (ngrps--) - *gidset++ = *gp++; -diff --git a/src/afs/UKERNEL/afs_usrops.c b/src/afs/UKERNEL/afs_usrops.c -index 2d11b445a..a6ca52a79 100644 ---- a/src/afs/UKERNEL/afs_usrops.c -+++ b/src/afs/UKERNEL/afs_usrops.c -@@ -30,6 +30,7 @@ - #include "afs/afs_bypasscache.h" - #include "rx/rx_globals.h" - #include "afsd/afsd.h" -+#include "afs/opr.h" - - #define VFS 1 - #undef VIRTUE -@@ -276,7 +277,7 @@ usr_uiomove(char *kbuf, int n, int rw, struct usr_uio *uio) - */ - ptr = kbuf; - while (nio > 0 && n > 0) { -- len = MIN(n, iovp->iov_len); -+ len = opr_min(n, iovp->iov_len); - if (rw == UIO_READ) { - memcpy(iovp->iov_base, ptr, len); - } else { -diff --git a/src/afs/VNOPS/afs_vnop_strategy.c b/src/afs/VNOPS/afs_vnop_strategy.c -index c4296bb6f..4aeb87a4a 100644 ---- a/src/afs/VNOPS/afs_vnop_strategy.c -+++ b/src/afs/VNOPS/afs_vnop_strategy.c -@@ -24,6 +24,7 @@ - #include "afs/afs_cbqueue.h" - #include "afs/nfsclient.h" - #include "afs/afs_osidnlc.h" -+#include "afs/opr.h" - - - -@@ -177,7 +178,7 @@ int afs_ustrategy(struct buf *abp) - * XXX It this really right? Ideally we should always write block size multiple - * and not any arbitrary size, right? XXX - */ -- len = MIN(len, tvc->f.m.Length - dbtob(abp->b_blkno)); -+ len = opr_min(len, tvc->f.m.Length - dbtob(abp->b_blkno)); - #endif - tuio.afsio_resid = len; - #if defined(AFS_NBSD40_ENV) || defined(FBSD_STRUCT_BUF_NO_SAVEADDR) -diff --git a/src/afs/VNOPS/afs_vnop_write.c b/src/afs/VNOPS/afs_vnop_write.c -index 3479348e1..c206a0394 100644 ---- a/src/afs/VNOPS/afs_vnop_write.c -+++ b/src/afs/VNOPS/afs_vnop_write.c -@@ -26,6 +26,7 @@ - #include "afs/afs_cbqueue.h" - #include "afs/nfsclient.h" - #include "afs/afs_osidnlc.h" -+#include "afs/opr.h" - - - extern unsigned char *afs_indexFlags; -@@ -250,7 +251,7 @@ afs_write(struct vcache *avc, struct uio *auio, int aio, - */ - osi_Assert(filePos <= avc->f.m.Length); - diff = avc->f.m.Length - filePos; -- AFS_UIO_SETRESID(auio, MIN(totalLength, diff)); -+ AFS_UIO_SETRESID(auio, opr_min(totalLength, diff)); - totalLength = AFS_UIO_RESID(auio); - } - #else -diff --git a/src/afs/afs_call.c b/src/afs/afs_call.c -index 4ac63b187..45b3f55eb 100644 ---- a/src/afs/afs_call.c -+++ b/src/afs/afs_call.c -@@ -18,6 +18,7 @@ - #include "afsincludes.h" /* Afs-based standard headers */ - #include "afs/afs_stats.h" - #include "rx/rx_globals.h" -+#include "afs/opr.h" - #if !defined(UKERNEL) - # if defined(AFS_LINUX_ENV) - # include "osi_compat.h" -@@ -968,9 +969,9 @@ afs_syscall_call(long parm, long parm2, long parm3, - if (mvParam->reqtype == AFS_USPC_UMV) { - /* don't copy out random kernel memory */ - AFS_COPYOUT(param2, AFSKPTR(parm4), -- MIN(namebufsz, strlen((char *)param2)+1), code); -+ opr_min(namebufsz, strlen((char *)param2)+1), code); - AFS_COPYOUT(param1, AFSKPTR(parm3), -- MIN(namebufsz, strlen((char *)param1)+1), code); -+ opr_min(namebufsz, strlen((char *)param1)+1), code); - } - AFS_COPYOUT((caddr_t)mvParam, AFSKPTR(parm2), - sizeof(struct afs_uspc_param), code); -diff --git a/src/lwp/iomgr.c b/src/lwp/iomgr.c -index 1251d06ca..2c88b56a9 100644 ---- a/src/lwp/iomgr.c -+++ b/src/lwp/iomgr.c -@@ -601,7 +601,7 @@ static void SignalIO(int fds, fd_set *readfds, fd_set *writefds, - struct IoRequest *req; - PROCESS pid; - req = (struct IoRequest *) r -> BackPointer; -- nfds = MIN(fds, req->nfds); -+ nfds = opr_min(fds, req->nfds); - if (FDSetCmp(nfds, req->readfds, readfds) || - FDSetCmp(nfds, req->writefds, writefds) || - FDSetCmp(nfds, req->exceptfds, exceptfds)) { -diff --git a/src/opr/opr.h b/src/opr/opr.h -index aae17e3cb..6bb2dc8b7 100644 ---- a/src/opr/opr.h -+++ b/src/opr/opr.h -@@ -21,6 +21,9 @@ extern void opr_NTAbort(void); - # define opr_abort() abort() - #endif - -+#define opr_min(a, b) ((a) < (b) ? (a) : (b)) -+#define opr_max(a, b) ((a) > (b) ? (a) : (b)) -+ - extern void opr_AssertionFailed(const char *, int) AFS_NORETURN; - extern void opr_AssertFailU(const char *, const char *, int) AFS_NORETURN; - -diff --git a/src/rx/AIX/rx_knet.c b/src/rx/AIX/rx_knet.c -index 5f47ff631..740be552d 100644 ---- a/src/rx/AIX/rx_knet.c -+++ b/src/rx/AIX/rx_knet.c -@@ -9,6 +9,7 @@ - - #include - #include "afs/param.h" -+#include "afs/opr.h" - - - #ifdef AFS_AIX41_ENV -@@ -406,9 +407,9 @@ osi_NetSend(osi_socket asocket, struct sockaddr_in *addr, struct iovec *dvec, - } - /* now compute usable size */ - if (M_HASCL(m)) { -- len = MIN(m->m_ext.ext_size, asize); -+ len = opr_min(m->m_ext.ext_size, asize); - } else { -- len = MIN(mlen, asize); -+ len = opr_min(mlen, asize); - } - - tpa = mtod(m, caddr_t); -@@ -416,7 +417,7 @@ osi_NetSend(osi_socket asocket, struct sockaddr_in *addr, struct iovec *dvec, - mp = &m->m_next; - m->m_len = 0; - while (len) { -- rlen = MIN(len, tl); -+ rlen = opr_min(len, tl); - memcpy(tpa, tdata, rlen); - asize -= rlen; - len -= rlen; -diff --git a/src/rx/DARWIN/rx_knet.c b/src/rx/DARWIN/rx_knet.c -index 405e35312..99bba8dc9 100644 ---- a/src/rx/DARWIN/rx_knet.c -+++ b/src/rx/DARWIN/rx_knet.c -@@ -9,6 +9,7 @@ - - #include - #include "afs/param.h" -+#include "afs/opr.h" - - #ifdef AFS_SOCKPROXY_ENV - # include -@@ -716,7 +717,7 @@ rx_upcall_common(socket_t so, struct afs_pkt_hdr *pkt) - noffset = 0; - - for (i = 0; i < p->niovecs && resid > 0; i++) { -- sz = MIN(resid, p->wirevec[i].iov_len); -+ sz = opr_min(resid, p->wirevec[i].iov_len); - memcpy(p->wirevec[i].iov_base, payload, sz); - resid -= sz; - noffset += sz; -@@ -732,7 +733,7 @@ rx_upcall_common(socket_t so, struct afs_pkt_hdr *pkt) - noffset = 0; - resid = nbytes; - for (i=0;iniovecs && resid;i++) { -- sz=MIN(resid, p->wirevec[i].iov_len); -+ sz=opr_min(resid, p->wirevec[i].iov_len); - error = mbuf_copydata(m, offset, sz, p->wirevec[i].iov_base); - if (error) - break; -@@ -853,7 +854,7 @@ osi_NetReceive(osi_socket so, struct sockaddr_in *addr, struct iovec *dvec, - size_t offset=0,sz; - resid = *alength; - for (i=0;i - #include "afs/param.h" -+#include "afs/opr.h" - - - #include -@@ -446,18 +447,18 @@ osi_NetSend(osi_socket asocket, struct sockaddr_in *addr, struct iovec *dvec, - mlen = MCLBYTES; - - /* now compute usable size */ -- len = MIN(mlen, asize); -+ len = opr_min(mlen, asize); - /* Should I look at MAPPED_MBUFS??? */ - } else { - nopages: -- len = MIN(mlen, asize); -+ len = opr_min(mlen, asize); - } - m->m_len = 0; - *mp = m; /* XXXX */ - top->m_pkthdr.len += len; - tpa = mtod(m, caddr_t); - while (len) { -- rlen = MIN(len, tl); -+ rlen = opr_min(len, tl); - memcpy(tpa, tdata, rlen); - asize -= rlen; - len -= rlen; -diff --git a/src/rx/IRIX/rx_knet.c b/src/rx/IRIX/rx_knet.c -index 788c5e268..4fc1cbd17 100644 ---- a/src/rx/IRIX/rx_knet.c -+++ b/src/rx/IRIX/rx_knet.c -@@ -9,7 +9,7 @@ - - #include - #include "afs/param.h" -- -+#include "afs/opr.h" - - #include "rx/rx_kcommon.h" - #include "rx/rx_packet.h" -@@ -366,8 +366,8 @@ rxi_EnumGetIfInfo(struct hashbucket *h, caddr_t key, caddr_t arg1, - } - rxmtu = rxmtu * rxi_nRecvFrags + ((rxi_nRecvFrags - 1) * UDP_HDR_SIZE); - if (!rx_IsLoopbackAddr(ifinaddr) && (rxmtu > rx_maxReceiveSize)) { -- rx_maxReceiveSize = MIN(RX_MAX_PACKET_SIZE, rxmtu); -- rx_maxReceiveSize = MIN(rx_maxReceiveSize, rx_maxReceiveSizeUser); -+ rx_maxReceiveSize = opr_min(RX_MAX_PACKET_SIZE, rxmtu); -+ rx_maxReceiveSize = opr_min(rx_maxReceiveSize, rx_maxReceiveSizeUser); - } - - *(int *)arg2 = i + 1; -@@ -390,7 +390,7 @@ rxi_GetIFInfo() - rx_maxJumboRecvSize = - RX_HEADER_SIZE + rxi_nDgramPackets * RX_JUMBOBUFFERSIZE + - (rxi_nDgramPackets - 1) * RX_JUMBOHEADERSIZE; -- rx_maxJumboRecvSize = MAX(rx_maxJumboRecvSize, rx_maxReceiveSize); -+ rx_maxJumboRecvSize = opr_max(rx_maxJumboRecvSize, rx_maxReceiveSize); - - return different; - } -diff --git a/src/rx/SOLARIS/rx_knet.c b/src/rx/SOLARIS/rx_knet.c -index fe85e63b8..74339375f 100644 ---- a/src/rx/SOLARIS/rx_knet.c -+++ b/src/rx/SOLARIS/rx_knet.c -@@ -9,6 +9,7 @@ - - #include - #include "afs/param.h" -+#include "afs/opr.h" - - - #ifdef AFS_SUN5_ENV -@@ -121,9 +122,9 @@ rxi_GetIFInfo() - addrs[i] = ifinaddr; - - if (!rx_IsLoopbackAddr(ifinaddr) && maxmtu > rx_maxReceiveSize) { -- rx_maxReceiveSize = MIN(RX_MAX_PACKET_SIZE, maxmtu); -+ rx_maxReceiveSize = opr_min(RX_MAX_PACKET_SIZE, maxmtu); - rx_maxReceiveSize = -- MIN(rx_maxReceiveSize, rx_maxReceiveSizeUser); -+ opr_min(rx_maxReceiveSize, rx_maxReceiveSizeUser); - } - - } -@@ -133,7 +134,7 @@ rxi_GetIFInfo() - rx_maxJumboRecvSize = - RX_HEADER_SIZE + rxi_nDgramPackets * RX_JUMBOBUFFERSIZE + - (rxi_nDgramPackets - 1) * RX_JUMBOHEADERSIZE; -- rx_maxJumboRecvSize = MAX(rx_maxJumboRecvSize, rx_maxReceiveSize); -+ rx_maxJumboRecvSize = opr_max(rx_maxJumboRecvSize, rx_maxReceiveSize); - - if (different) { - int j; -@@ -180,9 +181,9 @@ rxi_GetIFInfo() - i++; - - if (!rx_IsLoopbackAddr(ifinaddr) && maxmtu > rx_maxReceiveSize) { -- rx_maxReceiveSize = MIN(RX_MAX_PACKET_SIZE, maxmtu); -+ rx_maxReceiveSize = opr_min(RX_MAX_PACKET_SIZE, maxmtu); - rx_maxReceiveSize = -- MIN(rx_maxReceiveSize, rx_maxReceiveSizeUser); -+ opr_min(rx_maxReceiveSize, rx_maxReceiveSizeUser); - } - } - } -@@ -190,7 +191,7 @@ rxi_GetIFInfo() - rx_maxJumboRecvSize = - RX_HEADER_SIZE + rxi_nDgramPackets * RX_JUMBOBUFFERSIZE + - (rxi_nDgramPackets - 1) * RX_JUMBOHEADERSIZE; -- rx_maxJumboRecvSize = MAX(rx_maxJumboRecvSize, rx_maxReceiveSize); -+ rx_maxJumboRecvSize = opr_max(rx_maxJumboRecvSize, rx_maxReceiveSize); - - if (different) { - int j; -diff --git a/src/rx/rx.c b/src/rx/rx.c -index b3cc50c9b..162d2297e 100644 ---- a/src/rx/rx.c -+++ b/src/rx/rx.c -@@ -67,11 +67,10 @@ extern afs_int32 afs_termState; - # include - # endif - --# include -- - # include "rx_user.h" - #endif /* KERNEL */ - -+#include - #include - #include - -@@ -1123,15 +1122,15 @@ rxi_CheckConnTimeouts(struct rx_connection *conn) - /* this logic is slightly complicated by the fact that - * idleDeadTime/hardDeadTime may not be set at all, but it's not too bad. - */ -- conn->secondsUntilDead = MAX(conn->secondsUntilDead, RX_MINDEADTIME); -+ conn->secondsUntilDead = opr_max(conn->secondsUntilDead, RX_MINDEADTIME); - if (conn->idleDeadTime) { -- conn->idleDeadTime = MAX(conn->idleDeadTime, conn->secondsUntilDead); -+ conn->idleDeadTime = opr_max(conn->idleDeadTime, conn->secondsUntilDead); - } - if (conn->hardDeadTime) { - if (conn->idleDeadTime) { -- conn->hardDeadTime = MAX(conn->idleDeadTime, conn->hardDeadTime); -+ conn->hardDeadTime = opr_max(conn->idleDeadTime, conn->hardDeadTime); - } else { -- conn->hardDeadTime = MAX(conn->secondsUntilDead, conn->hardDeadTime); -+ conn->hardDeadTime = opr_max(conn->secondsUntilDead, conn->hardDeadTime); - } - } - } -@@ -2898,11 +2897,11 @@ rxi_SetPeerMtu(struct rx_peer *peer, afs_uint32 host, afs_uint32 port, int mtu) - - MUTEX_ENTER(&peer->peer_lock); - /* We don't handle dropping below min, so don't */ -- mtu = MAX(mtu, RX_MIN_PACKET_SIZE); -- peer->ifMTU=MIN(mtu, peer->ifMTU); -+ mtu = opr_max(mtu, RX_MIN_PACKET_SIZE); -+ peer->ifMTU=opr_min(mtu, peer->ifMTU); - peer->natMTU = rxi_AdjustIfMTU(peer->ifMTU); - /* if we tweaked this down, need to tune our peer MTU too */ -- peer->MTU = MIN(peer->MTU, peer->natMTU); -+ peer->MTU = opr_min(peer->MTU, peer->natMTU); - /* if we discovered a sub-1500 mtu, degrade */ - if (peer->ifMTU < OLD_MAX_PACKET_SIZE) - peer->maxDgramPackets = 1; -@@ -4336,7 +4335,7 @@ rxi_ReceiveAckPacket(struct rx_call *call, struct rx_packet *np, - return np; /* truncated ack packet */ - - /* depends on ack packet struct */ -- nAcks = MIN((unsigned)nbytes, (unsigned)ap->nAcks); -+ nAcks = opr_min((unsigned)nbytes, (unsigned)ap->nAcks); - first = ntohl(ap->firstPacket); - prev = ntohl(ap->previousPacket); - serial = ntohl(ap->serial); -@@ -4566,7 +4565,7 @@ rxi_ReceiveAckPacket(struct rx_call *call, struct rx_packet *np, - tSize = RX_MAX_PACKET_SIZE; - if (tSize < RX_MIN_PACKET_SIZE) - tSize = RX_MIN_PACKET_SIZE; -- peer->natMTU = rxi_AdjustIfMTU(MIN(tSize, peer->ifMTU)); -+ peer->natMTU = rxi_AdjustIfMTU(opr_min(tSize, peer->ifMTU)); - - /* Get the maximum packet size to send to this peer */ - rx_packetread(np, rx_AckDataSize(ap->nAcks), (int)sizeof(afs_int32), -@@ -4576,7 +4575,7 @@ rxi_ReceiveAckPacket(struct rx_call *call, struct rx_packet *np, - tSize = RX_MAX_PACKET_SIZE; - if (tSize < RX_MIN_PACKET_SIZE) - tSize = RX_MIN_PACKET_SIZE; -- tSize = (afs_uint32) MIN(tSize, rx_MyMaxSendSize); -+ tSize = (afs_uint32) opr_min(tSize, rx_MyMaxSendSize); - tSize = rxi_AdjustMaxMTU(peer->natMTU, tSize); - - /* sanity check - peer might have restarted with different params. -@@ -4587,8 +4586,8 @@ rxi_ReceiveAckPacket(struct rx_call *call, struct rx_packet *np, - if (peer->maxMTU > tSize) /* possible cong., maxMTU decreased */ - peer->congestSeq++; - peer->maxMTU = tSize; -- peer->MTU = MIN(tSize, peer->MTU); -- call->MTU = MIN(call->MTU, tSize); -+ peer->MTU = opr_min(tSize, peer->MTU); -+ call->MTU = opr_min(call->MTU, tSize); - } - - if (np->length == rx_AckDataSize(ap->nAcks) + 3 * sizeof(afs_int32)) { -@@ -4603,7 +4602,7 @@ rxi_ReceiveAckPacket(struct rx_call *call, struct rx_packet *np, - tSize = rx_maxSendWindow; - if (tSize < call->twind) { /* smaller than our send */ - call->twind = tSize; /* window, we must send less... */ -- call->ssthresh = MIN(call->twind, call->ssthresh); -+ call->ssthresh = opr_min(call->twind, call->ssthresh); - call->conn->twind[call->channel] = call->twind; - } - -@@ -4632,7 +4631,7 @@ rxi_ReceiveAckPacket(struct rx_call *call, struct rx_packet *np, - if (tSize < call->twind) { - call->twind = tSize; - call->conn->twind[call->channel] = call->twind; -- call->ssthresh = MIN(call->twind, call->ssthresh); -+ call->ssthresh = opr_min(call->twind, call->ssthresh); - } else if (tSize > call->twind) { - call->twind = tSize; - call->conn->twind[call->channel] = call->twind; -@@ -4648,9 +4647,9 @@ rxi_ReceiveAckPacket(struct rx_call *call, struct rx_packet *np, - rx_AckDataSize(ap->nAcks) + 3 * (int)sizeof(afs_int32), - (int)sizeof(afs_int32), &tSize); - maxDgramPackets = (afs_uint32) ntohl(tSize); -- maxDgramPackets = MIN(maxDgramPackets, rxi_nDgramPackets); -+ maxDgramPackets = opr_min(maxDgramPackets, rxi_nDgramPackets); - maxDgramPackets = -- MIN(maxDgramPackets, (int)(peer->ifDgramPackets)); -+ opr_min(maxDgramPackets, (int)(peer->ifDgramPackets)); - if (maxDgramPackets > 1) { - peer->maxDgramPackets = maxDgramPackets; - call->MTU = RX_JUMBOBUFFERSIZE + RX_HEADER_SIZE; -@@ -4718,7 +4717,7 @@ rxi_ReceiveAckPacket(struct rx_call *call, struct rx_packet *np, - - if (call->flags & RX_CALL_FAST_RECOVER) { - if (newAckCount == 0) { -- call->cwind = MIN((int)(call->cwind + 1), rx_maxSendWindow); -+ call->cwind = opr_min((int)(call->cwind + 1), rx_maxSendWindow); - } else { - call->flags &= ~RX_CALL_FAST_RECOVER; - call->cwind = call->nextCwind; -@@ -4729,10 +4728,10 @@ rxi_ReceiveAckPacket(struct rx_call *call, struct rx_packet *np, - } else if (nNacked && call->nNacks >= (u_short) rx_nackThreshold) { - /* Three negative acks in a row trigger congestion recovery */ - call->flags |= RX_CALL_FAST_RECOVER; -- call->ssthresh = MAX(4, MIN((int)call->cwind, (int)call->twind)) >> 1; -+ call->ssthresh = opr_max(4, opr_min((int)call->cwind, (int)call->twind)) >> 1; - call->cwind = -- MIN((int)(call->ssthresh + rx_nackThreshold), rx_maxSendWindow); -- call->nDgramPackets = MAX(2, (int)call->nDgramPackets) >> 1; -+ opr_min((int)(call->ssthresh + rx_nackThreshold), rx_maxSendWindow); -+ call->nDgramPackets = opr_max(2, (int)call->nDgramPackets) >> 1; - call->nextCwind = call->ssthresh; - call->nAcks = 0; - call->nNacks = 0; -@@ -4767,13 +4766,13 @@ rxi_ReceiveAckPacket(struct rx_call *call, struct rx_packet *np, - * receive (linear growth). */ - if (call->cwind < call->ssthresh) { - call->cwind = -- MIN((int)call->ssthresh, (int)(call->cwind + newAckCount)); -+ opr_min((int)call->ssthresh, (int)(call->cwind + newAckCount)); - call->nCwindAcks = 0; - } else { - call->nCwindAcks += newAckCount; - if (call->nCwindAcks >= call->cwind) { - call->nCwindAcks = 0; -- call->cwind = MIN((int)(call->cwind + 1), rx_maxSendWindow); -+ call->cwind = opr_min((int)(call->cwind + 1), rx_maxSendWindow); - } - } - /* -@@ -4792,7 +4791,7 @@ rxi_ReceiveAckPacket(struct rx_call *call, struct rx_packet *np, - call->MTU = peer->ifMTU; - else { - call->MTU += peer->natMTU; -- call->MTU = MIN(call->MTU, peer->maxMTU); -+ call->MTU = opr_min(call->MTU, peer->maxMTU); - } - } - call->nAcks = 0; -@@ -5419,10 +5418,10 @@ rxi_ResetCall(struct rx_call *call, int newcall) - MUTEX_ENTER(&peer->peer_lock); - if (!newcall) { - if (call->congestSeq == peer->congestSeq) { -- peer->cwind = MAX(peer->cwind, call->cwind); -- peer->MTU = MAX(peer->MTU, call->MTU); -+ peer->cwind = opr_max(peer->cwind, call->cwind); -+ peer->MTU = opr_max(peer->MTU, call->MTU); - peer->nDgramPackets = -- MAX(peer->nDgramPackets, call->nDgramPackets); -+ opr_max(peer->nDgramPackets, call->nDgramPackets); - } - } else { - call->abortCode = 0; -@@ -5433,7 +5432,7 @@ rxi_ResetCall(struct rx_call *call, int newcall) - } else { - call->MTU = peer->MTU; - } -- call->cwind = MIN((int)peer->cwind, (int)peer->nDgramPackets); -+ call->cwind = opr_min((int)peer->cwind, (int)peer->nDgramPackets); - call->ssthresh = rx_maxSendWindow; - call->nDgramPackets = peer->nDgramPackets; - call->congestSeq = peer->congestSeq; -@@ -5441,7 +5440,7 @@ rxi_ResetCall(struct rx_call *call, int newcall) - call->rtt_dev = peer->rtt_dev; - clock_Zero(&call->rto); - clock_Addmsec(&call->rto, -- MAX(((call->rtt >> 3) + call->rtt_dev), rx_minPeerTimeout) + 200); -+ opr_max(((call->rtt >> 3) + call->rtt_dev), rx_minPeerTimeout) + 200); - MUTEX_EXIT(&peer->peer_lock); - - flags = call->flags; -@@ -5587,7 +5586,7 @@ rxi_SendAck(struct rx_call *call, - padbytes = call->conn->peer->maxMTU + 128; - - /* do always try a minimum size ping */ -- padbytes = MAX(padbytes, RX_MIN_PACKET_SIZE+RX_IPUDP_SIZE+4); -+ padbytes = opr_max(padbytes, RX_MIN_PACKET_SIZE+RX_IPUDP_SIZE+4); - - /* subtract the ack payload */ - padbytes -= (rx_AckDataSize(call->rwind) + 4 * sizeof(afs_int32)); -@@ -6133,9 +6132,9 @@ rxi_Resend(struct rxevent *event, void *arg0, void *arg1, int istack) - * and start again from the beginning */ - if (peer->maxDgramPackets >1) { - call->MTU = RX_JUMBOBUFFERSIZE + RX_HEADER_SIZE; -- call->MTU = MIN(peer->natMTU, peer->maxMTU); -+ call->MTU = opr_min(peer->natMTU, peer->maxMTU); - } -- call->ssthresh = MAX(4, MIN((int)call->cwind, (int)call->twind)) >> 1; -+ call->ssthresh = opr_max(4, opr_min((int)call->cwind, (int)call->twind)) >> 1; - call->nDgramPackets = 1; - call->cwind = 1; - call->nextCwind = 1; -@@ -6205,7 +6204,7 @@ rxi_Start(struct rx_call *call, int istack) - call->flags &= ~RX_CALL_NEED_START; - #endif /* RX_ENABLE_LOCKS */ - nXmitPackets = 0; -- maxXmitPackets = MIN(call->twind, call->cwind); -+ maxXmitPackets = opr_min(call->twind, call->cwind); - for (opr_queue_Scan(&call->tq, cursor)) { - struct rx_packet *p - = opr_queue_Entry(cursor, struct rx_packet, entry); -@@ -6222,7 +6221,7 @@ rxi_Start(struct rx_call *call, int istack) - p->header.flags &= RX_PRESET_FLAGS; - - if (p->header.seq >= -- call->tfirst + MIN((int)call->twind, -+ call->tfirst + opr_min((int)call->twind, - (int)(call->nSoftAcked + - call->cwind))) { - call->flags |= RX_CALL_WAIT_WINDOW_SEND; /* Wait for transmit window */ -@@ -6398,9 +6397,9 @@ rxi_CheckCall(struct rx_call *call, int haveCTLock) - if (now < call->lastSendTime) - clock_diff = call->lastSendTime - now; - if (now < call->startWait) -- clock_diff = MAX(clock_diff, call->startWait - now); -+ clock_diff = opr_max(clock_diff, call->startWait - now); - if (now < call->lastReceiveTime) -- clock_diff = MAX(clock_diff, call->lastReceiveTime - now); -+ clock_diff = opr_max(clock_diff, call->lastReceiveTime - now); - if (clock_diff > 5 * 60) - { - if (call->state == RX_STATE_ACTIVE) -@@ -6490,7 +6489,7 @@ mtuout: - * Shrink by 128 bytes and try again. */ - if (conn->peer->maxPacketSize < conn->lastPacketSize) - /* maxPacketSize will be cleared in rxi_SetPeerMtu */ -- newmtu = MAX(conn->peer->maxPacketSize + RX_HEADER_SIZE, -+ newmtu = opr_max(conn->peer->maxPacketSize + RX_HEADER_SIZE, - conn->lastPacketSize - 128 + RX_HEADER_SIZE); - else - newmtu = conn->lastPacketSize - 128 + RX_HEADER_SIZE; -@@ -6726,7 +6725,7 @@ rxi_ScheduleGrowMTUEvent(struct rx_call *call, int secs) - secs = (RX_PINGS_LOST_BEFORE_DEAD * call->conn->secondsUntilPing)-1; - - if (call->conn->secondsUntilDead) -- secs = MIN(secs, (call->conn->secondsUntilDead-1)); -+ secs = opr_min(secs, (call->conn->secondsUntilDead-1)); - } - - when.sec += secs; -@@ -7101,7 +7100,7 @@ rxi_ComputeRoundTripTime(struct rx_packet *p, - * add on a fixed 200ms to account for that timer expiring. - */ - -- rtt_timeout = MAX(((call->rtt >> 3) + call->rtt_dev), -+ rtt_timeout = opr_max(((call->rtt >> 3) + call->rtt_dev), - rx_minPeerTimeout) + 200; - clock_Zero(&call->rto); - clock_Addmsec(&call->rto, rtt_timeout); -diff --git a/src/rx/rx_getaddr.c b/src/rx/rx_getaddr.c -index 5bf7ed9c9..c340aaf15 100644 ---- a/src/rx/rx_getaddr.c -+++ b/src/rx/rx_getaddr.c -@@ -10,6 +10,8 @@ - #include - #include - -+#include "afs/opr.h" -+ - #ifndef KERNEL - - # include -@@ -409,7 +411,7 @@ rx_getAllAddr_internal(afs_uint32 buffer[], int maxSize, int loopbacks) - #ifdef AFS_AIX51_ENV - cp = cpnext - #else -- cp += sizeof(ifr->ifr_name) + MAX(a->sin_len, sizeof(*a)) -+ cp += sizeof(ifr->ifr_name) + opr_max(a->sin_len, sizeof(*a)) - #endif - #endif - ) -@@ -424,7 +426,7 @@ rx_getAllAddr_internal(afs_uint32 buffer[], int maxSize, int loopbacks) - #endif - a = (struct sockaddr_in *)&ifr->ifr_addr; - #ifdef AFS_AIX51_ENV -- cpnext = cp + sizeof(ifr->ifr_name) + MAX(a->sin_len, sizeof(*a)); -+ cpnext = cp + sizeof(ifr->ifr_name) + opr_max(a->sin_len, sizeof(*a)); - #endif - if (a->sin_family != AF_INET) - continue; -@@ -507,7 +509,7 @@ rx_getAllAddrMaskMtu(afs_uint32 addrBuffer[], afs_uint32 maskBuffer[], - ifc.ifc_len = sizeof(ifs); - for (cp = (char *)ifc.ifc_buf, cplim = ifc.ifc_buf + ifc.ifc_len; - cp < cplim; -- cp += sizeof(ifr->ifr_name) + MAX(a->sin_len, sizeof(*a))) { -+ cp += sizeof(ifr->ifr_name) + opr_max(a->sin_len, sizeof(*a))) { - ifr = (struct ifreq *)cp; - #else - for (i = 0; i < len; ++i) { -diff --git a/src/rx/rx_globals.h b/src/rx/rx_globals.h -index 558dc553b..5326af074 100644 ---- a/src/rx/rx_globals.h -+++ b/src/rx/rx_globals.h -@@ -295,7 +295,7 @@ EXT int rx_TSFPQMaxProcs GLOBALSINIT(0); /* max number of threads expected */ - do { \ - int i; \ - struct rx_packet * p; \ -- int tsize = MIN((rx_ts_info_p)->_FPQ.len, (rx_ts_info_p)->_FPQ.len - rx_TSFPQLocalMax + 3 * rx_TSFPQGlobSize); \ -+ int tsize = opr_min((rx_ts_info_p)->_FPQ.len, (rx_ts_info_p)->_FPQ.len - rx_TSFPQLocalMax + 3 * rx_TSFPQGlobSize); \ - if (tsize <= 0) break; \ - for (i=0,p=opr_queue_Last(&((rx_ts_info_p)->_FPQ.queue), \ - struct rx_packet, entry); \ -diff --git a/src/rx/rx_kcommon.c b/src/rx/rx_kcommon.c -index c90df3d36..f29bd56f0 100644 ---- a/src/rx/rx_kcommon.c -+++ b/src/rx/rx_kcommon.c -@@ -21,6 +21,7 @@ - #include "rx_internal.h" - #include "rx_stats.h" - #include "rx_peer.h" -+#include "afs/opr.h" - - #ifdef AFS_HPUX110_ENV - # include "h/tihdr.h" -@@ -372,10 +373,10 @@ rxi_InitPeerParams(struct rx_peer *pp) - i = rxi_Findcbi(pp->host); - if (i == -1) { - rx_rto_setPeerTimeoutSecs(pp, 3); -- pp->ifMTU = MIN(RX_REMOTE_PACKET_SIZE, rx_MyMaxSendSize); -+ pp->ifMTU = opr_min(RX_REMOTE_PACKET_SIZE, rx_MyMaxSendSize); - } else { - rx_rto_setPeerTimeoutSecs(pp, 2); -- pp->ifMTU = MIN(RX_MAX_PACKET_SIZE, rx_MyMaxSendSize); -+ pp->ifMTU = opr_min(RX_MAX_PACKET_SIZE, rx_MyMaxSendSize); - mtu = ntohl(afs_cb_interface.mtu[i]); - /* Diminish the packet size to one based on the MTU given by - * the interface. */ -@@ -398,7 +399,7 @@ rxi_InitPeerParams(struct rx_peer *pp) - ifn = rxi_FindIfnet(pp->host, NULL); - if (ifn) { - rx_rto_setPeerTimeoutSecs(pp, 2); -- pp->ifMTU = MIN(RX_MAX_PACKET_SIZE, rx_MyMaxSendSize); -+ pp->ifMTU = opr_min(RX_MAX_PACKET_SIZE, rx_MyMaxSendSize); - # ifdef IFF_POINTOPOINT - if (rx_ifnet_flags(ifn) & IFF_POINTOPOINT) { - /* wish we knew the bit rate and the chunk size, sigh. */ -@@ -415,7 +416,7 @@ rxi_InitPeerParams(struct rx_peer *pp) - } - } else { /* couldn't find the interface, so assume the worst */ - rx_rto_setPeerTimeoutSecs(pp, 3); -- pp->ifMTU = MIN(RX_REMOTE_PACKET_SIZE, rx_MyMaxSendSize); -+ pp->ifMTU = opr_min(RX_REMOTE_PACKET_SIZE, rx_MyMaxSendSize); - } - - RX_NET_EPOCH_EXIT(); -@@ -428,10 +429,10 @@ rxi_InitPeerParams(struct rx_peer *pp) - - if (mtu <= 0) { - rx_rto_setPeerTimeoutSecs(pp, 3); -- pp->ifMTU = MIN(RX_REMOTE_PACKET_SIZE, rx_MyMaxSendSize); -+ pp->ifMTU = opr_min(RX_REMOTE_PACKET_SIZE, rx_MyMaxSendSize); - } else { - rx_rto_setPeerTimeoutSecs(pp, 2); -- pp->ifMTU = MIN(RX_MAX_PACKET_SIZE, rx_MyMaxSendSize); -+ pp->ifMTU = opr_min(RX_MAX_PACKET_SIZE, rx_MyMaxSendSize); - - /* Diminish the packet size to one based on the MTU given by - * the interface. */ -@@ -444,14 +445,14 @@ rxi_InitPeerParams(struct rx_peer *pp) - #endif /* AFS_SUN5_ENV */ - pp->ifMTU = rxi_AdjustIfMTU(pp->ifMTU); - pp->maxMTU = OLD_MAX_PACKET_SIZE; /* for compatibility with old guys */ -- pp->natMTU = MIN(pp->ifMTU, OLD_MAX_PACKET_SIZE); -+ pp->natMTU = opr_min(pp->ifMTU, OLD_MAX_PACKET_SIZE); - pp->ifDgramPackets = -- MIN(rxi_nDgramPackets, -+ opr_min(rxi_nDgramPackets, - rxi_AdjustDgramPackets(rxi_nSendFrags, pp->ifMTU)); - pp->maxDgramPackets = 1; - - /* Initialize slow start parameters */ -- pp->MTU = MIN(pp->natMTU, pp->maxMTU); -+ pp->MTU = opr_min(pp->natMTU, pp->maxMTU); - pp->cwind = 1; - pp->nDgramPackets = 1; - pp->congestSeq = 0; -@@ -520,15 +521,15 @@ rxi_GetcbiInfo(void) - maxmtu = rxi_AdjustMaxMTU(rxmtu, maxmtu); - addrs[i++] = ifinaddr; - if (!rx_IsLoopbackAddr(ifinaddr) && (maxmtu > rx_maxReceiveSize)) { -- rx_maxReceiveSize = MIN(RX_MAX_PACKET_SIZE, maxmtu); -- rx_maxReceiveSize = MIN(rx_maxReceiveSize, rx_maxReceiveSizeUser); -+ rx_maxReceiveSize = opr_min(RX_MAX_PACKET_SIZE, maxmtu); -+ rx_maxReceiveSize = opr_min(rx_maxReceiveSize, rx_maxReceiveSizeUser); - } - } - - rx_maxJumboRecvSize = - RX_HEADER_SIZE + (rxi_nDgramPackets * RX_JUMBOBUFFERSIZE) + - ((rxi_nDgramPackets - 1) * RX_JUMBOHEADERSIZE); -- rx_maxJumboRecvSize = MAX(rx_maxJumboRecvSize, rx_maxReceiveSize); -+ rx_maxJumboRecvSize = opr_max(rx_maxJumboRecvSize, rx_maxReceiveSize); - - if (different) { - for (j = 0; j < i; j++) { -@@ -648,9 +649,9 @@ rxi_GetIFInfo(void) - if (!rx_IsLoopbackAddr(ifinaddr) && - (maxmtu > rx_maxReceiveSize)) { - rx_maxReceiveSize = -- MIN(RX_MAX_PACKET_SIZE, maxmtu); -+ opr_min(RX_MAX_PACKET_SIZE, maxmtu); - rx_maxReceiveSize = -- MIN(rx_maxReceiveSize, rx_maxReceiveSizeUser); -+ opr_min(rx_maxReceiveSize, rx_maxReceiveSizeUser); - } - cnt++; - } -@@ -710,9 +711,9 @@ rxi_GetIFInfo(void) - maxmtu = rxi_AdjustMaxMTU(rxmtu, maxmtu); - addrs[i++] = ifinaddr; - if (!rx_IsLoopbackAddr(ifinaddr) && (maxmtu > rx_maxReceiveSize)) { -- rx_maxReceiveSize = MIN(RX_MAX_PACKET_SIZE, maxmtu); -+ rx_maxReceiveSize = opr_min(RX_MAX_PACKET_SIZE, maxmtu); - rx_maxReceiveSize = -- MIN(rx_maxReceiveSize, rx_maxReceiveSizeUser); -+ opr_min(rx_maxReceiveSize, rx_maxReceiveSizeUser); - } - } - } -@@ -725,7 +726,7 @@ rxi_GetIFInfo(void) - rx_maxJumboRecvSize = - RX_HEADER_SIZE + rxi_nDgramPackets * RX_JUMBOBUFFERSIZE + - (rxi_nDgramPackets - 1) * RX_JUMBOHEADERSIZE; -- rx_maxJumboRecvSize = MAX(rx_maxJumboRecvSize, rx_maxReceiveSize); -+ rx_maxJumboRecvSize = opr_max(rx_maxJumboRecvSize, rx_maxReceiveSize); - - if (different) { - int l; -@@ -1084,7 +1085,7 @@ afs_rxevent_daemon(void) - "before afs_osi_Wait()"); - # endif - # ifdef RXK_TIMEDSLEEP_ENV -- afs_osi_TimedSleep(&afs_termState, MAX(500, ((temp.sec * 1000) + -+ afs_osi_TimedSleep(&afs_termState, opr_max(500, ((temp.sec * 1000) + - (temp.usec / 1000))), 0); - # else - afs_osi_Wait(500, NULL, 0); -diff --git a/src/rx/rx_packet.c b/src/rx/rx_packet.c -index 2898da189..693d7c0d9 100644 ---- a/src/rx/rx_packet.c -+++ b/src/rx/rx_packet.c -@@ -43,7 +43,6 @@ - #else /* KERNEL */ - # include - # include --# include - # if defined(AFS_NT40_ENV) - # ifndef EWOULDBLOCK - # define EWOULDBLOCK WSAEWOULDBLOCK -@@ -58,6 +57,8 @@ - # include - #endif - -+ -+#include - #include - - #include "rx.h" -@@ -194,7 +195,7 @@ rx_SlowReadPacket(struct rx_packet * packet, unsigned int offset, int resid, - */ - r = resid; - while ((r > 0) && (i < packet->niovecs)) { -- j = MIN(r, packet->wirevec[i].iov_len - (offset - l)); -+ j = opr_min(r, packet->wirevec[i].iov_len - (offset - l)); - memcpy(out, (char *)(packet->wirevec[i].iov_base) + (offset - l), j); - r -= j; - out += j; -@@ -237,7 +238,7 @@ rx_SlowWritePacket(struct rx_packet * packet, int offset, int resid, char *in) - break; - - b = (char *)(packet->wirevec[i].iov_base) + (offset - l); -- j = MIN(r, packet->wirevec[i].iov_len - (offset - l)); -+ j = opr_min(r, packet->wirevec[i].iov_len - (offset - l)); - memcpy(b, in, j); - r -= j; - in += j; -@@ -277,7 +278,7 @@ AllocPacketBufs(int class, int num_pkts, struct opr_queue * q) - if (transfer > 0) { - NETPRI; - MUTEX_ENTER(&rx_freePktQ_lock); -- transfer = MAX(transfer, rx_TSFPQGlobSize); -+ transfer = opr_max(transfer, rx_TSFPQGlobSize); - if (transfer > rx_nFreePackets) { - /* alloc enough for us, plus a few globs for other threads */ - rxi_MorePacketsNoLock(transfer + 4 * rx_initSendWindow); -@@ -344,7 +345,7 @@ AllocPacketBufs(int class, int num_pkts, struct opr_queue * q) - } - #else /* KERNEL */ - if (rx_nFreePackets < num_pkts) { -- rxi_MorePacketsNoLock(MAX((num_pkts-rx_nFreePackets), 4 * rx_initSendWindow)); -+ rxi_MorePacketsNoLock(opr_max((num_pkts-rx_nFreePackets), 4 * rx_initSendWindow)); - } - #endif /* KERNEL */ - -@@ -826,7 +827,7 @@ rxi_AdjustLocalPacketsTSFPQ(int num_keep_local, int allow_overcommit) - if ((num_keep_local > rx_TSFPQLocalMax) && !allow_overcommit) - xfer = rx_TSFPQLocalMax - rx_ts_info->_FPQ.len; - if (rx_nFreePackets < xfer) { -- rxi_MorePacketsNoLock(MAX(xfer - rx_nFreePackets, 4 * rx_initSendWindow)); -+ rxi_MorePacketsNoLock(opr_max(xfer - rx_nFreePackets, 4 * rx_initSendWindow)); - } - RX_TS_FPQ_GTOL2(rx_ts_info, xfer); - } -@@ -922,7 +923,7 @@ rxi_FreeDataBufsToQueue(struct rx_packet *p, afs_uint32 first, struct opr_queue - struct rx_packet * cb; - int count = 0; - -- for (first = MAX(2, first); first < p->niovecs; first++, count++) { -+ for (first = opr_max(2, first); first < p->niovecs; first++, count++) { - iov = &p->wirevec[first]; - if (!iov->iov_base) - osi_Panic("rxi_FreeDataBufsToQueue: unexpected NULL iov"); -@@ -950,7 +951,7 @@ rxi_FreeDataBufsNoLock(struct rx_packet *p, afs_uint32 first) - { - struct iovec *iov; - -- for (first = MAX(2, first); first < p->niovecs; first++) { -+ for (first = opr_max(2, first); first < p->niovecs; first++) { - iov = &p->wirevec[first]; - if (!iov->iov_base) - osi_Panic("rxi_FreeDataBufsNoLock: unexpected NULL iov"); -@@ -985,7 +986,7 @@ rxi_FreeDataBufsTSFPQ(struct rx_packet *p, afs_uint32 first, int flush_global) - - RX_TS_INFO_GET(rx_ts_info); - -- for (first = MAX(2, first); first < p->niovecs; first++) { -+ for (first = opr_max(2, first); first < p->niovecs; first++) { - iov = &p->wirevec[first]; - if (!iov->iov_base) - osi_Panic("rxi_FreeDataBufsTSFPQ: unexpected NULL iov"); -@@ -1333,7 +1334,7 @@ rxi_AllocSendPacket(struct rx_call *call, int want) - #ifdef RX_ENABLE_TSFPQ - if ((p = rxi_AllocPacketTSFPQ(RX_PACKET_CLASS_SEND, 0))) { - want += delta; -- want = MIN(want, mud); -+ want = opr_min(want, mud); - - if ((unsigned)want > p->length) - (void)rxi_AllocDataBuf(p, (want - p->length), -@@ -1359,7 +1360,7 @@ rxi_AllocSendPacket(struct rx_call *call, int want) - MUTEX_EXIT(&rx_freePktQ_lock); - - want += delta; -- want = MIN(want, mud); -+ want = opr_min(want, mud); - - if ((unsigned)want > p->length) - (void)rxi_AllocDataBuf(p, (want - p->length), -@@ -1646,7 +1647,7 @@ cpytoc(mblk_t * mp, int off, int len, char *cp) - if (mp->b_datap->db_type != M_DATA) { - return -1; - } -- n = MIN(len, (mp->b_wptr - mp->b_rptr)); -+ n = opr_min(len, (mp->b_wptr - mp->b_rptr)); - memcpy(cp, (char *)mp->b_rptr, n); - cp += n; - len -= n; -@@ -1669,7 +1670,7 @@ cpytoiovec(mblk_t * mp, int off, int len, struct iovec *iovs, - if (mp->b_datap->db_type != M_DATA) { - return -1; - } -- n = MIN(len, (mp->b_wptr - mp->b_rptr)); -+ n = opr_min(len, (mp->b_wptr - mp->b_rptr)); - len -= n; - while (n) { - if (!t) { -@@ -1677,7 +1678,7 @@ cpytoiovec(mblk_t * mp, int off, int len, struct iovec *iovs, - i++; - t = iovs[i].iov_len; - } -- m = MIN(n, t); -+ m = opr_min(n, t); - memcpy(iovs[i].iov_base + o, (char *)mp->b_rptr, m); - mp->b_rptr += m; - o += m; -@@ -1719,7 +1720,7 @@ m_cpytoiovec(struct mbuf *m, int off, int len, struct iovec iovs[], int niovs) - l2 = iovs[0].iov_len; - - while (len) { -- t = MIN(l1, MIN(l2, (unsigned int)len)); -+ t = opr_min(l1, opr_min(l2, (unsigned int)len)); - memcpy(p2, p1, t); - p1 += t; - p2 += t; -@@ -2860,7 +2861,7 @@ int - rxi_AdjustMaxMTU(int mtu, int peerMaxMTU) - { - int maxMTU = mtu * rxi_nSendFrags; -- maxMTU = MIN(maxMTU, peerMaxMTU); -+ maxMTU = opr_min(maxMTU, peerMaxMTU); - return rxi_AdjustIfMTU(maxMTU); - } - -@@ -2876,7 +2877,7 @@ rxi_AdjustDgramPackets(int frags, int mtu) - return 1; - } - maxMTU = (frags * (mtu + UDP_HDR_SIZE)) - UDP_HDR_SIZE; -- maxMTU = MIN(maxMTU, RX_MAX_PACKET_SIZE); -+ maxMTU = opr_min(maxMTU, RX_MAX_PACKET_SIZE); - /* subtract the size of the first and last packets */ - maxMTU -= RX_HEADER_SIZE + (2 * RX_JUMBOBUFFERSIZE) + RX_JUMBOHEADERSIZE; - if (maxMTU < 0) { -diff --git a/src/rx/rx_packet.h b/src/rx/rx_packet.h -index 46c07895d..11bf55000 100644 ---- a/src/rx/rx_packet.h -+++ b/src/rx/rx_packet.h -@@ -316,7 +316,7 @@ struct rx_packet { - /* return what the actual contiguous space is: should be min(length,size) */ - /* The things that call this really want something like ...pullup MTUXXX */ - #define rx_Contiguous(p) \ -- MIN((unsigned) (p)->length, (unsigned) ((p)->wirevec[1].iov_len)) -+ opr_min((unsigned) (p)->length, (unsigned) ((p)->wirevec[1].iov_len)) - - #ifndef TRUE - #define TRUE 1 -diff --git a/src/rx/rx_rdwr.c b/src/rx/rx_rdwr.c -index ee1c3e3d4..2bc75cb49 100644 ---- a/src/rx/rx_rdwr.c -+++ b/src/rx/rx_rdwr.c -@@ -50,9 +50,9 @@ - # include "afs/lock.h" - #else /* KERNEL */ - # include --# include - #endif /* KERNEL */ - -+#include - #include "rx.h" - #include "rx_clock.h" - #include "rx_globals.h" -@@ -252,8 +252,8 @@ rxi_ReadProc(struct rx_call *call, char *buf, - * the final portion of a received packet, it's almost certain that - * call->app.nLeft will be smaller than the final buffer. */ - while (nbytes && call->app.currentPacket) { -- t = MIN((int)call->app.curlen, nbytes); -- t = MIN(t, (int)call->app.nLeft); -+ t = opr_min((int)call->app.curlen, nbytes); -+ t = opr_min(t, (int)call->app.nLeft); - memcpy(buf, call->app.curpos, t); - buf += t; - nbytes -= t; -@@ -428,8 +428,8 @@ rxi_FillReadVec(struct rx_call *call, afs_uint32 serial) - && call->iovNext < call->iovMax - && call->app.currentPacket) { - -- t = MIN((int)call->app.curlen, call->iovNBytes); -- t = MIN(t, (int)call->app.nLeft); -+ t = opr_min((int)call->app.curlen, call->iovNBytes); -+ t = opr_min(t, (int)call->app.nLeft); - call_iov->iov_base = call->app.curpos; - call_iov->iov_len = t; - call_iov++; -@@ -724,7 +724,7 @@ rxi_WriteProc(struct rx_call *call, char *buf, - mud = rx_MaxUserDataSize(call); - if (mud > len) { - int want; -- want = MIN(nbytes - (int)call->app.nFree, mud - len); -+ want = opr_min(nbytes - (int)call->app.nFree, mud - len); - rxi_AllocDataBuf(call->app.currentPacket, want, - RX_PACKET_CLASS_SEND_CBUF); - if (call->app.currentPacket->length > (unsigned)mud) -@@ -743,8 +743,8 @@ rxi_WriteProc(struct rx_call *call, char *buf, - - while (nbytes && call->app.nFree) { - -- t = MIN((int)call->app.curlen, nbytes); -- t = MIN((int)call->app.nFree, t); -+ t = opr_min((int)call->app.curlen, nbytes); -+ t = opr_min((int)call->app.nFree, t); - memcpy(call->app.curpos, buf, t); - buf += t; - nbytes -= t; -@@ -952,7 +952,7 @@ rxi_WritevAlloc(struct rx_call *call, struct iovec *iov, int *nio, int maxio, - mud = rx_MaxUserDataSize(call); - if (mud > len) { - int want; -- want = MIN(nbytes - tnFree, mud - len); -+ want = opr_min(nbytes - tnFree, mud - len); - rxi_AllocDataBuf(cp, want, RX_PACKET_CLASS_SEND_CBUF); - if (cp->length > (unsigned)mud) - cp->length = mud; -@@ -964,8 +964,8 @@ rxi_WritevAlloc(struct rx_call *call, struct iovec *iov, int *nio, int maxio, - } - - /* fill in the next entry in the iovec */ -- t = MIN(tcurlen, nbytes); -- t = MIN(tnFree, t); -+ t = opr_min(tcurlen, nbytes); -+ t = opr_min(tnFree, t); - iov[nextio].iov_base = tcurpos; - iov[nextio].iov_len = t; - nbytes -= t; -diff --git a/src/rx/rx_user.c b/src/rx/rx_user.c -index 15695265e..1effe0a19 100644 ---- a/src/rx/rx_user.c -+++ b/src/rx/rx_user.c -@@ -404,12 +404,12 @@ rx_GetIFInfo(void) - rxi_nRecvFrags * rxsize + (rxi_nRecvFrags - 1) * UDP_HDR_SIZE; - maxsize = rxi_AdjustMaxMTU(rxsize, maxsize); - if (rx_maxReceiveSize > maxsize) { -- rx_maxReceiveSize = MIN(RX_MAX_PACKET_SIZE, maxsize); -+ rx_maxReceiveSize = opr_min(RX_MAX_PACKET_SIZE, maxsize); - rx_maxReceiveSize = -- MIN(rx_maxReceiveSize, rx_maxReceiveSizeUser); -+ opr_min(rx_maxReceiveSize, rx_maxReceiveSizeUser); - } - if (rx_MyMaxSendSize > maxsize) { -- rx_MyMaxSendSize = MIN(RX_MAX_PACKET_SIZE, maxsize); -+ rx_MyMaxSendSize = opr_min(RX_MAX_PACKET_SIZE, maxsize); - } - } - UNLOCK_IF; -@@ -517,10 +517,10 @@ rx_GetIFInfo(void) - - LOCK_IF; - #ifdef AFS_AIX41_ENV --#define size(p) MAX((p).sa_len, sizeof(p)) -+#define size(p) opr_max((p).sa_len, sizeof(p)) - cplim = buf + ifc.ifc_len; /*skip over if's with big ifr_addr's */ - for (cp = buf; cp < cplim; -- cp += sizeof(ifr->ifr_name) + MAX(a->sin_len, sizeof(*a))) { -+ cp += sizeof(ifr->ifr_name) + opr_max(a->sin_len, sizeof(*a))) { - if (rxi_numNetAddrs >= ADDRSPERSITE) - break; - -@@ -642,7 +642,7 @@ rx_GetIFInfo(void) - rxi_nRecvFrags * (myNetMTUs[rxi_numNetAddrs] - RX_IP_SIZE); - maxsize -= UDP_HDR_SIZE; /* only the first frag has a UDP hdr */ - if (rx_maxReceiveSize < maxsize) -- rx_maxReceiveSize = MIN(RX_MAX_PACKET_SIZE, maxsize); -+ rx_maxReceiveSize = opr_min(RX_MAX_PACKET_SIZE, maxsize); - ++rxi_numNetAddrs; - } - } -@@ -658,7 +658,7 @@ rx_GetIFInfo(void) - rx_maxJumboRecvSize = - RX_HEADER_SIZE + rxi_nDgramPackets * RX_JUMBOBUFFERSIZE + - (rxi_nDgramPackets - 1) * RX_JUMBOHEADERSIZE; -- rx_maxJumboRecvSize = MAX(rx_maxJumboRecvSize, rx_maxReceiveSize); -+ rx_maxJumboRecvSize = opr_max(rx_maxJumboRecvSize, rx_maxReceiveSize); - ncbufs = (rx_maxJumboRecvSize - RX_FIRSTBUFFERSIZE); - if (ncbufs > 0) { - ncbufs = ncbufs / RX_CBUFFERSIZE; -@@ -721,13 +721,13 @@ rxi_InitPeerParams(struct rx_peer *pp) - if (rxmtu < RX_MIN_PACKET_SIZE) - rxmtu = RX_MIN_PACKET_SIZE; - if (pp->ifMTU < rxmtu) -- pp->ifMTU = MIN(rx_MyMaxSendSize, rxmtu); -+ pp->ifMTU = opr_min(rx_MyMaxSendSize, rxmtu); - } - } - UNLOCK_IF; - if (!pp->ifMTU) { /* not local */ - rx_rto_setPeerTimeoutSecs(pp, 3); -- pp->ifMTU = MIN(rx_MyMaxSendSize, RX_REMOTE_PACKET_SIZE); -+ pp->ifMTU = opr_min(rx_MyMaxSendSize, RX_REMOTE_PACKET_SIZE); - } - #ifdef AFS_ADAPT_PMTU - sock=socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP); -@@ -740,7 +740,7 @@ rxi_InitPeerParams(struct rx_peer *pp) - int mtu=0; - socklen_t s = sizeof(mtu); - if (getsockopt(sock, SOL_IP, IP_MTU, &mtu, &s)== 0) { -- pp->ifMTU = MIN(mtu - RX_IPUDP_SIZE, pp->ifMTU); -+ pp->ifMTU = opr_min(mtu - RX_IPUDP_SIZE, pp->ifMTU); - } - } - # ifdef AFS_NT40_ENV -@@ -752,16 +752,16 @@ rxi_InitPeerParams(struct rx_peer *pp) - #endif - pp->ifMTU = rxi_AdjustIfMTU(pp->ifMTU); - pp->maxMTU = OLD_MAX_PACKET_SIZE; /* for compatibility with old guys */ -- pp->natMTU = MIN((int)pp->ifMTU, OLD_MAX_PACKET_SIZE); -+ pp->natMTU = opr_min((int)pp->ifMTU, OLD_MAX_PACKET_SIZE); - pp->maxDgramPackets = -- MIN(rxi_nDgramPackets, -+ opr_min(rxi_nDgramPackets, - rxi_AdjustDgramPackets(rxi_nSendFrags, pp->ifMTU)); - pp->ifDgramPackets = -- MIN(rxi_nDgramPackets, -+ opr_min(rxi_nDgramPackets, - rxi_AdjustDgramPackets(rxi_nSendFrags, pp->ifMTU)); - pp->maxDgramPackets = 1; - /* Initialize slow start parameters */ -- pp->MTU = MIN(pp->natMTU, pp->maxMTU); -+ pp->MTU = opr_min(pp->natMTU, pp->maxMTU); - pp->cwind = 1; - pp->nDgramPackets = 1; - pp->congestSeq = 0; -diff --git a/src/rxkad/crypt_conn.c b/src/rxkad/crypt_conn.c -index da708bcd7..10ba5d84c 100644 ---- a/src/rxkad/crypt_conn.c -+++ b/src/rxkad/crypt_conn.c -@@ -27,9 +27,9 @@ - #endif /* !UKERNEL */ - #else /* !KERNEL */ - #include --#include - #endif /* KERNEL */ - -+#include - #include - #include - #include -@@ -58,7 +58,7 @@ rxkad_DecryptPacket(const struct rx_connection *conn, - data = rx_data(packet, i, tlen); - if (!data || !tlen) - break; -- tlen = MIN(len, tlen); -+ tlen = opr_min(len, tlen); - fc_cbc_encrypt(data, data, tlen, *schedule, xor, DECRYPT); - len -= tlen; - } -@@ -99,7 +99,7 @@ rxkad_EncryptPacket(const struct rx_connection * conn, - data = rx_data(packet, i, tlen); - if (!data || !tlen) - break; -- tlen = MIN(len, tlen); -+ tlen = opr_min(len, tlen); - fc_cbc_encrypt(data, data, tlen, *schedule, xor, ENCRYPT); - len -= tlen; - } -diff --git a/src/rxkad/rxkad_client.c b/src/rxkad/rxkad_client.c -index 630488374..1f760b8c0 100644 ---- a/src/rxkad/rxkad_client.c -+++ b/src/rxkad/rxkad_client.c -@@ -33,10 +33,9 @@ - #endif /* !UKERNEL */ - #else /* ! KERNEL */ - #include --#include - #endif /* KERNEL */ - -- -+#include - #include - #include - #include --- -2.46.1 - diff --git a/openafs-modules-dkms/0003-Remove-MIN-and-MAX-macro-definitions.patch b/openafs-modules-dkms/0003-Remove-MIN-and-MAX-macro-definitions.patch deleted file mode 100644 index 2c9b37f..0000000 --- a/openafs-modules-dkms/0003-Remove-MIN-and-MAX-macro-definitions.patch +++ /dev/null @@ -1,885 +0,0 @@ -From 083e4c44085309665b66e9330aa0c4d30237e750 Mon Sep 17 00:00:00 2001 -From: Cheyenne Wills -Date: Tue, 13 Aug 2024 14:29:10 -0600 -Subject: [PATCH 3/4] Remove MIN and MAX macro definitions - -A prior commit: - "opr: replace MIN/MAX macros with opr_min/opr_max" - (Change I2d7b54193ec91f7ead9c5c5f714d9a8bc7533bf7) -replaced all uses of the MIN and MAX macros with opr_min and opr_max. - -As a cleanup and to resolve a failure when building the Linux kernel -module with Linux 6.11, remove all the defines for MIN and MAX. - -The Linux 6.11 commit: - 'minmax: make generic MIN() and MAX() macros available everywhere' - (1a251f52cf) -standardized and consolidated the definitions of the MIN and MAX macros -within the Linux kernel by defining them in an include file that is -widely used already (linux/minmax.h). - -With the above Linux commit, the kernel module fails with a redefined -error from the compiler: - "./include/linux/minmax.h:329: error: "MIN" redefined [-Werror]" - -Reviewed-on: https://gerrit.openafs.org/15814 -Reviewed-by: Andrew Deason -Reviewed-by: Michael Meffie -Tested-by: BuildBot -(cherry picked from commit 8e8ee623d1a21dc8476cde4b6b9d9e292b36691d) - -Change-Id: I096c386682afbf7de07f7bb882ab9442cbdeb13a ---- - src/afs/NBSD/osi_machdep.h | 8 -------- - src/afs/UKERNEL/afs_usrops.c | 7 ------- - src/config/afsconfig-windows.h | 3 --- - src/config/param.generic_fbsd.h | 10 ---------- - src/config/param.i386_dfbsd_23.h | 10 ---------- - src/config/param.linux26.h | 10 ---------- - src/config/param.nbsd15.h | 10 ---------- - src/config/param.nbsd16.h | 10 ---------- - src/config/param.nbsd20.h | 10 ---------- - src/config/param.nbsd21.h | 10 ---------- - src/config/param.nbsd30.h | 10 ---------- - src/config/param.nbsd40.h | 10 ---------- - src/config/param.nbsd50.h | 10 ---------- - src/config/param.nbsd60.h | 10 ---------- - src/config/param.nbsd70.h | 10 ---------- - src/config/param.obsd31.h | 8 -------- - src/config/param.obsd32.h | 8 -------- - src/config/param.obsd33.h | 8 -------- - src/config/param.obsd34.h | 8 -------- - src/config/param.obsd35.h | 8 -------- - src/config/param.obsd36.h | 8 -------- - src/config/param.obsd37.h | 8 -------- - src/config/param.obsd38.h | 8 -------- - src/config/param.obsd39.h | 8 -------- - src/config/param.obsd40.h | 8 -------- - src/config/param.obsd41.h | 8 -------- - src/config/param.obsd42.h | 8 -------- - src/config/param.obsd43.h | 8 -------- - src/config/param.obsd44.h | 8 -------- - src/config/param.obsd45.h | 8 -------- - src/config/param.obsd46.h | 8 -------- - src/config/param.obsd47.h | 8 -------- - src/config/param.obsd48.h | 8 -------- - src/config/param.obsd49.h | 8 -------- - src/config/param.obsd50.h | 8 -------- - src/config/param.obsd51.h | 8 -------- - src/config/param.obsd52.h | 8 -------- - src/config/param.obsd53.h | 8 -------- - src/config/param.obsd54.h | 8 -------- - src/lwp/iomgr.c | 4 ---- - src/rx/rx_getaddr.c | 4 ---- - src/rx/rx_packet.h | 9 +-------- - 42 files changed, 1 insertion(+), 346 deletions(-) - -diff --git a/src/afs/NBSD/osi_machdep.h b/src/afs/NBSD/osi_machdep.h -index 43aa62101..c8fc4d1f8 100644 ---- a/src/afs/NBSD/osi_machdep.h -+++ b/src/afs/NBSD/osi_machdep.h -@@ -184,14 +184,6 @@ extern struct lock afs_global_lock; - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) && !defined(IGNORE_STDS_H) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ASSEMBLER */ - - /* vnodes */ -diff --git a/src/afs/UKERNEL/afs_usrops.c b/src/afs/UKERNEL/afs_usrops.c -index a6ca52a79..c29dca709 100644 ---- a/src/afs/UKERNEL/afs_usrops.c -+++ b/src/afs/UKERNEL/afs_usrops.c -@@ -47,13 +47,6 @@ - #define CELLINFOFILE "CellItems" - #define MAXIPADDRS 64 - --#ifndef MIN --#define MIN(A,B) ((A)<(B)?(A):(B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A)>(B)?(A):(B)) --#endif -- - extern int cacheDiskType; - - char afs_LclCellName[64]; -diff --git a/src/config/afsconfig-windows.h b/src/config/afsconfig-windows.h -index 9c2baa0d2..2b36a568c 100644 ---- a/src/config/afsconfig-windows.h -+++ b/src/config/afsconfig-windows.h -@@ -271,6 +271,3 @@ typedef int errno_t; - - /* Build afsroken.dll as a dynamic library */ - #define ROKEN_LIB_DYNAMIC 1 -- --#define MAX(a,b) (((a) > (b)) ? (a) : (b)) --#define MIN(a,b) (((a) < (b)) ? (a) : (b)) -diff --git a/src/config/param.generic_fbsd.h b/src/config/param.generic_fbsd.h -index e09158b95..e74e84ffb 100644 ---- a/src/config/param.generic_fbsd.h -+++ b/src/config/param.generic_fbsd.h -@@ -88,16 +88,6 @@ - - # if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --# ifdef KERNEL --# ifndef MIN --# define MIN(A,B) ((A) < (B) ? (A) : (B)) --# endif --# ifndef MAX --# define MAX(A,B) ((A) > (B) ? (A) : (B)) --# endif --# endif /* KERNEL */ -- - # endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.i386_dfbsd_23.h b/src/config/param.i386_dfbsd_23.h -index 46b5aaf4b..aad44f55d 100644 ---- a/src/config/param.i386_dfbsd_23.h -+++ b/src/config/param.i386_dfbsd_23.h -@@ -100,16 +100,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifdef KERNEL --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif --#endif /* KERNEL */ -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.linux26.h b/src/config/param.linux26.h -index 8fa1e3cb9..2e9ee6fbe 100644 ---- a/src/config/param.linux26.h -+++ b/src/config/param.linux26.h -@@ -40,16 +40,6 @@ - #define AFS_GLOBAL_SUNLOCK - #endif /* __KERNEL__ */ - --#ifdef KERNEL --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- --#endif /* KERNEL */ -- - #ifndef KERNEL - #define __USE_LARGEFILE64 1 - #if !defined off64_t -diff --git a/src/config/param.nbsd15.h b/src/config/param.nbsd15.h -index 771ace046..5c5a17d74 100644 ---- a/src/config/param.nbsd15.h -+++ b/src/config/param.nbsd15.h -@@ -88,16 +88,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifdef KERNEL --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif --#endif /* KERNEL */ -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.nbsd16.h b/src/config/param.nbsd16.h -index 1630fdf20..355a5a240 100644 ---- a/src/config/param.nbsd16.h -+++ b/src/config/param.nbsd16.h -@@ -89,16 +89,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifdef KERNEL --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif --#endif /* KERNEL */ -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.nbsd20.h b/src/config/param.nbsd20.h -index 140e97164..bc5ee09ac 100644 ---- a/src/config/param.nbsd20.h -+++ b/src/config/param.nbsd20.h -@@ -95,16 +95,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) && !defined(IGNORE_STDS_H) - enum vcexcl { NONEXCL, EXCL }; -- --#ifdef KERNEL --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif --#endif /* KERNEL */ -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ && !defined(IGNORE_STDS_H) */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.nbsd21.h b/src/config/param.nbsd21.h -index 9402be5bb..35155da11 100644 ---- a/src/config/param.nbsd21.h -+++ b/src/config/param.nbsd21.h -@@ -95,16 +95,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) && !defined(IGNORE_STDS_H) - enum vcexcl { NONEXCL, EXCL }; -- --#ifdef KERNEL --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif --#endif /* KERNEL */ -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ && !defined(IGNORE_STDS_H) */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.nbsd30.h b/src/config/param.nbsd30.h -index 96e4a7395..d8129d248 100644 ---- a/src/config/param.nbsd30.h -+++ b/src/config/param.nbsd30.h -@@ -91,16 +91,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) && !defined(IGNORE_STDS_H) - enum vcexcl { NONEXCL, EXCL }; -- --#ifdef KERNEL --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif --#endif /* KERNEL */ -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ && !defined(IGNORE_STDS_H) */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.nbsd40.h b/src/config/param.nbsd40.h -index 7e3a92101..6c22e252a 100644 ---- a/src/config/param.nbsd40.h -+++ b/src/config/param.nbsd40.h -@@ -97,16 +97,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) && !defined(IGNORE_STDS_H) - enum vcexcl { NONEXCL, EXCL }; -- --#ifdef KERNEL --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif --#endif /* KERNEL */ -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ && !defined(IGNORE_STDS_H) */ - #endif /* _KERNEL_DEPRECATED */ - -diff --git a/src/config/param.nbsd50.h b/src/config/param.nbsd50.h -index fcb2077ca..268d0f304 100644 ---- a/src/config/param.nbsd50.h -+++ b/src/config/param.nbsd50.h -@@ -94,16 +94,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) && !defined(IGNORE_STDS_H) - enum vcexcl { NONEXCL, EXCL }; -- --#ifdef KERNEL --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif --#endif /* KERNEL */ -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ && !defined(IGNORE_STDS_H) */ - #endif /* _KERNEL_DEPRECATED */ - -diff --git a/src/config/param.nbsd60.h b/src/config/param.nbsd60.h -index dda79311e..6e08c4cae 100644 ---- a/src/config/param.nbsd60.h -+++ b/src/config/param.nbsd60.h -@@ -95,16 +95,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) && !defined(IGNORE_STDS_H) - enum vcexcl { NONEXCL, EXCL }; -- --#ifdef KERNEL --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif --#endif /* KERNEL */ -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ && !defined(IGNORE_STDS_H) */ - #endif /* _KERNEL_DEPRECATED */ - -diff --git a/src/config/param.nbsd70.h b/src/config/param.nbsd70.h -index bb7534fb3..4356226a6 100644 ---- a/src/config/param.nbsd70.h -+++ b/src/config/param.nbsd70.h -@@ -96,16 +96,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) && !defined(IGNORE_STDS_H) - enum vcexcl { NONEXCL, EXCL }; -- --#ifdef KERNEL --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif --#endif /* KERNEL */ -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ && !defined(IGNORE_STDS_H) */ - #endif /* _KERNEL_DEPRECATED */ - -diff --git a/src/config/param.obsd31.h b/src/config/param.obsd31.h -index edf9a73a4..f77cbcef7 100644 ---- a/src/config/param.obsd31.h -+++ b/src/config/param.obsd31.h -@@ -44,14 +44,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd32.h b/src/config/param.obsd32.h -index 3472178ef..26f19511d 100644 ---- a/src/config/param.obsd32.h -+++ b/src/config/param.obsd32.h -@@ -43,14 +43,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd33.h b/src/config/param.obsd33.h -index a82cb4302..0822cc3ea 100644 ---- a/src/config/param.obsd33.h -+++ b/src/config/param.obsd33.h -@@ -47,14 +47,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd34.h b/src/config/param.obsd34.h -index 62e606214..661a6f94d 100644 ---- a/src/config/param.obsd34.h -+++ b/src/config/param.obsd34.h -@@ -47,14 +47,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd35.h b/src/config/param.obsd35.h -index f03dce86d..43c9fe28d 100644 ---- a/src/config/param.obsd35.h -+++ b/src/config/param.obsd35.h -@@ -47,14 +47,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd36.h b/src/config/param.obsd36.h -index 0ee70960f..cc981888d 100644 ---- a/src/config/param.obsd36.h -+++ b/src/config/param.obsd36.h -@@ -49,14 +49,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd37.h b/src/config/param.obsd37.h -index fc26d85f1..032b054ed 100644 ---- a/src/config/param.obsd37.h -+++ b/src/config/param.obsd37.h -@@ -50,14 +50,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd38.h b/src/config/param.obsd38.h -index 6fa98fed6..5c33062c2 100644 ---- a/src/config/param.obsd38.h -+++ b/src/config/param.obsd38.h -@@ -51,14 +51,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd39.h b/src/config/param.obsd39.h -index 61626f94e..f4955de9d 100644 ---- a/src/config/param.obsd39.h -+++ b/src/config/param.obsd39.h -@@ -55,14 +55,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd40.h b/src/config/param.obsd40.h -index 23df49de3..f00a6b182 100644 ---- a/src/config/param.obsd40.h -+++ b/src/config/param.obsd40.h -@@ -51,14 +51,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd41.h b/src/config/param.obsd41.h -index e102260d6..d4a41e1f3 100644 ---- a/src/config/param.obsd41.h -+++ b/src/config/param.obsd41.h -@@ -54,14 +54,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd42.h b/src/config/param.obsd42.h -index b3f821bb9..c2c8ea678 100644 ---- a/src/config/param.obsd42.h -+++ b/src/config/param.obsd42.h -@@ -59,14 +59,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd43.h b/src/config/param.obsd43.h -index 6dd7baa7a..833458f7b 100644 ---- a/src/config/param.obsd43.h -+++ b/src/config/param.obsd43.h -@@ -60,14 +60,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd44.h b/src/config/param.obsd44.h -index 624795d38..89f396ccd 100644 ---- a/src/config/param.obsd44.h -+++ b/src/config/param.obsd44.h -@@ -61,14 +61,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd45.h b/src/config/param.obsd45.h -index aab537e7c..cbe786603 100644 ---- a/src/config/param.obsd45.h -+++ b/src/config/param.obsd45.h -@@ -61,14 +61,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd46.h b/src/config/param.obsd46.h -index ef123d7f7..d515f8576 100644 ---- a/src/config/param.obsd46.h -+++ b/src/config/param.obsd46.h -@@ -66,14 +66,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd47.h b/src/config/param.obsd47.h -index beabaa293..ffd56ca6b 100644 ---- a/src/config/param.obsd47.h -+++ b/src/config/param.obsd47.h -@@ -67,14 +67,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd48.h b/src/config/param.obsd48.h -index d87d53d28..7b6a8e7dd 100644 ---- a/src/config/param.obsd48.h -+++ b/src/config/param.obsd48.h -@@ -64,14 +64,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd49.h b/src/config/param.obsd49.h -index 28e383890..0cba5fbf9 100644 ---- a/src/config/param.obsd49.h -+++ b/src/config/param.obsd49.h -@@ -65,14 +65,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd50.h b/src/config/param.obsd50.h -index effaccdd1..5df568d97 100644 ---- a/src/config/param.obsd50.h -+++ b/src/config/param.obsd50.h -@@ -66,14 +66,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd51.h b/src/config/param.obsd51.h -index 49b5c3304..52fb2fa98 100644 ---- a/src/config/param.obsd51.h -+++ b/src/config/param.obsd51.h -@@ -67,14 +67,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd52.h b/src/config/param.obsd52.h -index 9cfa12c5a..0b2f43072 100644 ---- a/src/config/param.obsd52.h -+++ b/src/config/param.obsd52.h -@@ -68,14 +68,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd53.h b/src/config/param.obsd53.h -index d140dc066..a6c168863 100644 ---- a/src/config/param.obsd53.h -+++ b/src/config/param.obsd53.h -@@ -69,14 +69,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd54.h b/src/config/param.obsd54.h -index 797ca45a3..88277bbf8 100644 ---- a/src/config/param.obsd54.h -+++ b/src/config/param.obsd54.h -@@ -70,14 +70,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/lwp/iomgr.c b/src/lwp/iomgr.c -index 2c88b56a9..82b576fe2 100644 ---- a/src/lwp/iomgr.c -+++ b/src/lwp/iomgr.c -@@ -51,10 +51,6 @@ typedef unsigned char bool; - #define FALSE 0 - #define TRUE 1 - --#ifndef MIN --#define MIN(a,b) (((a)>(b)) ? (b) : (a)) --#endif -- - #ifndef NSIG - #define NSIG 8*sizeof(sigset_t) - #endif -diff --git a/src/rx/rx_getaddr.c b/src/rx/rx_getaddr.c -index c340aaf15..2420b0468 100644 ---- a/src/rx/rx_getaddr.c -+++ b/src/rx/rx_getaddr.c -@@ -106,10 +106,6 @@ rxi_getaddr(void) - - #if !defined(KERNEL) || defined(UKERNEL) - --#ifndef MAX --#define MAX(A,B) (((A)<(B)) ? (B) : (A)) --#endif -- - #ifdef UKERNEL - #undef ioctl - #endif /* UKERNEL */ -diff --git a/src/rx/rx_packet.h b/src/rx/rx_packet.h -index 11bf55000..48736d3f8 100644 ---- a/src/rx/rx_packet.h -+++ b/src/rx/rx_packet.h -@@ -32,14 +32,7 @@ - */ - - --#if defined(AFS_NT40_ENV) --# ifndef MIN --# define MIN(a,b) ((a)<(b)?(a):(b)) --# endif --# ifndef MAX --# define MAX(a,b) ((a)>(b)?(a):(b)) --# endif --#else /* AFS_NT40_ENV */ -+#if !defined(AFS_NT40_ENV) - # if !defined(AFS_DARWIN_ENV) && !defined(AFS_USR_DARWIN_ENV) \ - && !defined(AFS_XBSD_ENV) && !defined(AFS_USR_FBSD_ENV) \ - && !defined(AFS_USR_DFBSD_ENV) && !defined(AFS_LINUX_ENV) --- -2.46.1 - diff --git a/openafs-modules-dkms/0004-rx-Remove-includes-for-MIN-MAX-in-rx_packet.h.patch b/openafs-modules-dkms/0004-rx-Remove-includes-for-MIN-MAX-in-rx_packet.h.patch deleted file mode 100644 index 2512bc0..0000000 --- a/openafs-modules-dkms/0004-rx-Remove-includes-for-MIN-MAX-in-rx_packet.h.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 88151d1e26b68580c0c1ea23469b069334678b36 Mon Sep 17 00:00:00 2001 -From: Cheyenne Wills -Date: Thu, 15 Aug 2024 16:08:18 -0600 -Subject: [PATCH 4/4] rx: Remove includes for MIN/MAX in rx_packet.h - -The commit: - "opr: replace MIN/MAX macros with opr_min/opr_max" - (Change I2d7b54193ec91f7ead9c5c5f714d9a8bc7533bf7) -replaced all uses of the MIN and MAX macros with opr_min and opr_max. - -The include for sys/param.h and sys/sysmacros.h in rx_packet.h are no -longer needed for MIN/MAX. - -Remove the preprocessor conditionals and the includes for param.h and -sysmacros.h. - -Reviewed-on: https://gerrit.openafs.org/15823 -Reviewed-by: Andrew Deason -Reviewed-by: Michael Meffie -Tested-by: BuildBot -(cherry picked from commit d299dfbfe90482b26b5f5551eb5be1b8e76d6ac4) - -Change-Id: Ic1dec6f69bb8f9fd6eaffd0d893f0b2113193ae7 ---- - src/rx/rx_packet.h | 14 -------------- - 1 file changed, 14 deletions(-) - -diff --git a/src/rx/rx_packet.h b/src/rx/rx_packet.h -index 48736d3f8..173762af7 100644 ---- a/src/rx/rx_packet.h -+++ b/src/rx/rx_packet.h -@@ -31,20 +31,6 @@ - * and that the offsets are as well. - */ - -- --#if !defined(AFS_NT40_ENV) --# if !defined(AFS_DARWIN_ENV) && !defined(AFS_USR_DARWIN_ENV) \ -- && !defined(AFS_XBSD_ENV) && !defined(AFS_USR_FBSD_ENV) \ -- && !defined(AFS_USR_DFBSD_ENV) && !defined(AFS_LINUX_ENV) --# include /* MIN, MAX on most commercial UNIX */ --# endif --/* Linux 3.7 doesn't have sys/param.h in kernel space, and afs/param.h ensures -- * that MIN and MAX are available for kernel builds. */ --# if !(defined(AFS_LINUX_ENV) && defined(KERNEL)) --# include /* MIN, MAX elsewhere */ --# endif --#endif /* !AFS_NT40_ENV */ -- - #define IPv6_HDR_SIZE 40 /* IPv6 Header */ - #define IPv6_FRAG_HDR_SIZE 8 /* IPv6 Fragment Header */ - #define UDP_HDR_SIZE 8 /* UDP Header */ --- -2.46.1 - diff --git a/openafs-modules-dkms/PKGBUILD b/openafs-modules-dkms/PKGBUILD index c9904a2..df7f653 100644 --- a/openafs-modules-dkms/PKGBUILD +++ b/openafs-modules-dkms/PKGBUILD @@ -6,8 +6,8 @@ pkgname=openafs-modules-dkms _srcname=openafs -pkgver=1.8.12.1 -pkgrel=2 +pkgver=1.8.12.2 +pkgrel=1 pkgdesc="Kernel module for OpenAFS (dkms)" arch=('i686' 'x86_64' 'armv7h') url="http://www.openafs.org" @@ -17,27 +17,13 @@ provides=("openafs-modules=$pkgver") conflicts=('openafs-features-libafs' 'openafs-modules' 'openafs<1.6.6-2') options=(!emptydirs) source=(http://openafs.org/dl/openafs/${pkgver}/${_srcname}-${pkgver}-src.tar.bz2 - 0001-rx-Define-symbolic-names-for-Rx-magic-numbers.patch - 0002-opr-replace-MIN-MAX-macros-with-opr_min-opr_max.patch - 0003-Remove-MIN-and-MAX-macro-definitions.patch - 0004-rx-Remove-includes-for-MIN-MAX-in-rx_packet.h.patch dkms.conf) -sha256sums=('dfe2f39bef9fb3d6791d602e725be7c34b885e4299018266ff9743cb401e594a' - '89858ec91fb7cef85f7996c2eeeeb087a7996ed5d902ae4e3ac668e086753b05' - '247fbe76610056123525b11511f4a426913c7ee61b59f88fdbc0871239af9a94' - '9b3cac93406f13b3c1ad41c424c43e4df2c997ba9af68e8b73caf3db7e4df42f' - 'a7c4eb9dec81628459783705ceee531b29a81c254298e84c89cdc99e6c77729e' +sha256sums=('1164194cc6ffd75c063c420fb37344e844c1e2edc155529f815ba4c781f45cab' '5ea5e184f9b44f5ed45817d2b5a10149d15c8c54f49e0b5b4b773652673cb9b0') prepare() { cd "${srcdir}/${_srcname}-${pkgver}" - # Patches for Linux 6.11 - patch -p1 < "$srcdir"/0001-rx-Define-symbolic-names-for-Rx-magic-numbers.patch - patch -p1 < "$srcdir"/0002-opr-replace-MIN-MAX-macros-with-opr_min-opr_max.patch - patch -p1 < "$srcdir"/0003-Remove-MIN-and-MAX-macro-definitions.patch - patch -p1 < "$srcdir"/0004-rx-Remove-includes-for-MIN-MAX-in-rx_packet.h.patch - # Only needed when changes to configure were made # ./regen.sh -q } diff --git a/openafs-modules/.SRCINFO b/openafs-modules/.SRCINFO index 34a932b..f3e4272 100644 --- a/openafs-modules/.SRCINFO +++ b/openafs-modules/.SRCINFO @@ -1,7 +1,7 @@ pkgbase = openafs-modules pkgdesc = Kernel module for OpenAFS - pkgver = 1.8.12.1 - pkgrel = 2 + pkgver = 1.8.12.2 + pkgrel = 1 url = http://www.openafs.org install = openafs-modules.install arch = i686 @@ -15,15 +15,7 @@ pkgbase = openafs-modules conflicts = openafs-features-libafs conflicts = openafs<1.6.6-2 options = !emptydirs - source = http://openafs.org/dl/openafs/1.8.12.1/openafs-1.8.12.1-src.tar.bz2 - source = 0001-rx-Define-symbolic-names-for-Rx-magic-numbers.patch - source = 0002-opr-replace-MIN-MAX-macros-with-opr_min-opr_max.patch - source = 0003-Remove-MIN-and-MAX-macro-definitions.patch - source = 0004-rx-Remove-includes-for-MIN-MAX-in-rx_packet.h.patch - sha256sums = dfe2f39bef9fb3d6791d602e725be7c34b885e4299018266ff9743cb401e594a - sha256sums = 89858ec91fb7cef85f7996c2eeeeb087a7996ed5d902ae4e3ac668e086753b05 - sha256sums = 247fbe76610056123525b11511f4a426913c7ee61b59f88fdbc0871239af9a94 - sha256sums = 9b3cac93406f13b3c1ad41c424c43e4df2c997ba9af68e8b73caf3db7e4df42f - sha256sums = a7c4eb9dec81628459783705ceee531b29a81c254298e84c89cdc99e6c77729e + source = http://openafs.org/dl/openafs/1.8.12.2/openafs-1.8.12.2-src.tar.bz2 + sha256sums = 1164194cc6ffd75c063c420fb37344e844c1e2edc155529f815ba4c781f45cab pkgname = openafs-modules diff --git a/openafs-modules/0001-rx-Define-symbolic-names-for-Rx-magic-numbers.patch b/openafs-modules/0001-rx-Define-symbolic-names-for-Rx-magic-numbers.patch deleted file mode 100644 index 69c6ff5..0000000 --- a/openafs-modules/0001-rx-Define-symbolic-names-for-Rx-magic-numbers.patch +++ /dev/null @@ -1,121 +0,0 @@ -From 4b7b53c8d081a0c12a16e91dbe40cc73eba41a26 Mon Sep 17 00:00:00 2001 -From: Mark Vitale -Date: Fri, 7 May 2021 18:20:11 -0400 -Subject: [PATCH 1/4] rx: Define symbolic names for Rx magic numbers - -Since the original IBM code import, the magic number '6' has been used -to specify the number of consecutive lost keepalives (ping acks) that -indicate a dead connection. By implication, this also defines the -minimum number of seconds (at the minimum keeplive periodicity of 1 -second) before a connection may be considered dead. - -Define and use symbolic names for both uses of '6', and document their -relationship. Both have the same assigned value '6', but -RX_PINGS_LOST_BEFORE_DEAD is use as an ordinal count, while -RX_MINDEADTIME is expressed in units of seconds. - -The magic number '12' is used in a couple of places for the default -value of rx_connDeadTime. Give this constant a name -(RX_DEFAULT_DEAD_TIME) and use it. - -No functional change is incurred by this commit. - -Reviewed-on: https://gerrit.openafs.org/14621 -Reviewed-by: Benjamin Kaduk -Tested-by: Benjamin Kaduk -(cherry picked from commit b4a4a2ae9c9546482dd94c7a89793b1bfa1714cd) - -Change-Id: I87c2de0c1a14a9414a86e6fc0744139a120fbab9 ---- - src/rx/rx.c | 12 ++++++------ - src/rx/rx.h | 12 ++++++++++++ - src/rx/rx_globals.h | 2 +- - 3 files changed, 19 insertions(+), 7 deletions(-) - -diff --git a/src/rx/rx.c b/src/rx/rx.c -index d6c52c369..b3cc50c9b 100644 ---- a/src/rx/rx.c -+++ b/src/rx/rx.c -@@ -550,7 +550,7 @@ rx_InitHost(u_int host, u_int port) - #endif /* RX_ENABLE_LOCKS && KERNEL */ - - rxi_nCalls = 0; -- rx_connDeadTime = 12; -+ rx_connDeadTime = RX_DEFAULT_DEAD_TIME; - rx_tranquil = 0; /* reset flag */ - rxi_ResetStatistics(); - htable = osi_Alloc(rx_hashTableSize * sizeof(struct rx_connection *)); -@@ -1118,12 +1118,12 @@ rxi_CheckConnTimeouts(struct rx_connection *conn) - /* a connection's timeouts must have the relationship - * deadTime <= idleDeadTime <= hardDeadTime. Otherwise, for example, a - * total loss of network to a peer may cause an idle timeout instead of a -- * dead timeout, simply because the idle timeout gets hit first. Also set -- * a minimum deadTime of 6, just to ensure it doesn't get set too low. */ -+ * dead timeout, simply because the idle timeout gets hit first. Also -+ * enforce a minimum deadTime, just to ensure it doesn't get set too low. */ - /* this logic is slightly complicated by the fact that - * idleDeadTime/hardDeadTime may not be set at all, but it's not too bad. - */ -- conn->secondsUntilDead = MAX(conn->secondsUntilDead, 6); -+ conn->secondsUntilDead = MAX(conn->secondsUntilDead, RX_MINDEADTIME); - if (conn->idleDeadTime) { - conn->idleDeadTime = MAX(conn->idleDeadTime, conn->secondsUntilDead); - } -@@ -1143,7 +1143,7 @@ rx_SetConnDeadTime(struct rx_connection *conn, int seconds) - * keepalives to be dropped without timing out the connection. */ - conn->secondsUntilDead = seconds; - rxi_CheckConnTimeouts(conn); -- conn->secondsUntilPing = conn->secondsUntilDead / 6; -+ conn->secondsUntilPing = conn->secondsUntilDead / RX_PINGS_LOST_BEFORE_DEAD; - } - - void -@@ -6723,7 +6723,7 @@ rxi_ScheduleGrowMTUEvent(struct rx_call *call, int secs) - when = now; - if (!secs) { - if (call->conn->secondsUntilPing) -- secs = (6*call->conn->secondsUntilPing)-1; -+ secs = (RX_PINGS_LOST_BEFORE_DEAD * call->conn->secondsUntilPing)-1; - - if (call->conn->secondsUntilDead) - secs = MIN(secs, (call->conn->secondsUntilDead-1)); -diff --git a/src/rx/rx.h b/src/rx/rx.h -index ee1331e85..f9a387db6 100644 ---- a/src/rx/rx.h -+++ b/src/rx/rx.h -@@ -163,7 +163,19 @@ extern u_short rx_PortOf(struct rx_peer *peer); - - /* Configurable parameters */ - #define RX_IDLE_DEAD_TIME 60 /* default idle dead time */ -+#define RX_DEFAULT_DEAD_TIME 12 /* Default timeout for an unresponsive connection */ - #define RX_MAX_SERVICES 20 /* Maximum number of services that may be installed */ -+/* -+ * The number of consecutive keepalives (ping acks) that must be lost/missing -+ * before declaring an rx_call dead timeout (RX_CALL_DEAD). This number was -+ * chosen to be relatively small while allowing for "several" pings to be lost -+ * without triggering a timeout. (We are running on UDP after all). Since the -+ * miniumum non-zero secondsUntilPing is 1 second, this also determines the -+ * minimum rx dead time. -+ */ -+#define RX_PINGS_LOST_BEFORE_DEAD 6 -+#define RX_MINDEADTIME (RX_PINGS_LOST_BEFORE_DEAD * 1) -+ - #if defined(KERNEL) && defined(AFS_AIX51_ENV) && defined(__64__) - # define RX_DEFAULT_STACK_SIZE 24000 - #else -diff --git a/src/rx/rx_globals.h b/src/rx/rx_globals.h -index caf0d3bc9..558dc553b 100644 ---- a/src/rx/rx_globals.h -+++ b/src/rx/rx_globals.h -@@ -65,7 +65,7 @@ EXT int rx_extraPackets GLOBALSINIT(256); - EXT int rx_stackSize GLOBALSINIT(RX_DEFAULT_STACK_SIZE); - - /* Time until an unresponsive connection is declared dead */ --EXT int rx_connDeadTime GLOBALSINIT(12); -+EXT int rx_connDeadTime GLOBALSINIT(RX_DEFAULT_DEAD_TIME); - - /* Set rx default connection dead time; set on both services and connections at creation time */ - #ifdef AFS_NT40_ENV --- -2.46.1 - diff --git a/openafs-modules/0002-opr-replace-MIN-MAX-macros-with-opr_min-opr_max.patch b/openafs-modules/0002-opr-replace-MIN-MAX-macros-with-opr_min-opr_max.patch deleted file mode 100644 index 75d0765..0000000 --- a/openafs-modules/0002-opr-replace-MIN-MAX-macros-with-opr_min-opr_max.patch +++ /dev/null @@ -1,1545 +0,0 @@ -From fc95bb974bf35e7a43d76b0ac7883671b550e01f Mon Sep 17 00:00:00 2001 -From: Cheyenne Wills -Date: Mon, 9 Sep 2024 13:15:47 -0600 -Subject: [PATCH 2/4] opr: replace MIN/MAX macros with opr_min/opr_max - -Introduce new macros, opr_min() and opr_max(), to avoid collisions with -existing MIN()/MAX() macros defined elsewhere. - -Within OpenAFS, the MIN/MAX macros are defined in the platform specific -param.h include file. This same file is where AFS_{platform}_ENV is -defined, which is used throughout the OpenAFS source to determine which -platform specific headers are to be used. This can lead to collisions -if platform provided headers define MIN or MAX. - -Introduce opr_min and opr_max, using the same definitions that have been -used for MIN and MAX. Put the definitions in opr.h, which is already -included in most of the code that uses the MIN or MAX macros. - -Replace all uses of MIN and MAX with opr_min and opr_max. - -Add or move the include for afs/opr.h as needed. - -Note, this commit does not replace the min()/max() macros. - -A later commit will remove the defines for MIN and MAX (which will -correct a Linux 6.11 build failure due to a collision). - -Reviewed-on: https://gerrit.openafs.org/15813 -Tested-by: BuildBot -Reviewed-by: Michael Meffie -Reviewed-by: Andrew Deason -(cherry picked from commit 915c5cff168344797e011ee81913d4026c0cea80) - -[Backport: Move opr.h include in src/rx/rx.c. The MIN/MAX macros are -still present in the deprecated afsweb component.] - -Change-Id: I05fa833e00f31f07af55cebeb00a996a280bdcef ---- - src/afs/AIX/osi_groups.c | 3 +- - src/afs/DARWIN/osi_groups.c | 3 +- - src/afs/DARWIN/osi_vnodeops.c | 3 +- - src/afs/FBSD/osi_groups.c | 3 +- - src/afs/HPUX/osi_groups.c | 3 +- - src/afs/HPUX/osi_vnodeops.c | 9 ++-- - src/afs/IRIX/osi_groups.c | 3 +- - src/afs/IRIX/osi_vnodeops.c | 13 ++--- - src/afs/NBSD/osi_groups.c | 3 +- - src/afs/NBSD/osi_vnodeops.c | 3 +- - src/afs/OBSD/osi_groups.c | 3 +- - src/afs/UKERNEL/afs_usrops.c | 3 +- - src/afs/VNOPS/afs_vnop_strategy.c | 3 +- - src/afs/VNOPS/afs_vnop_write.c | 3 +- - src/afs/afs_call.c | 5 +- - src/lwp/iomgr.c | 2 +- - src/opr/opr.h | 3 ++ - src/rx/AIX/rx_knet.c | 7 +-- - src/rx/DARWIN/rx_knet.c | 7 +-- - src/rx/FBSD/rx_knet.c | 7 +-- - src/rx/IRIX/rx_knet.c | 8 ++-- - src/rx/SOLARIS/rx_knet.c | 13 ++--- - src/rx/rx.c | 79 +++++++++++++++---------------- - src/rx/rx_getaddr.c | 8 ++-- - src/rx/rx_globals.h | 2 +- - src/rx/rx_kcommon.c | 37 ++++++++------- - src/rx/rx_packet.c | 35 +++++++------- - src/rx/rx_packet.h | 2 +- - src/rx/rx_rdwr.c | 22 ++++----- - src/rx/rx_user.c | 28 +++++------ - src/rxkad/crypt_conn.c | 6 +-- - src/rxkad/rxkad_client.c | 3 +- - 32 files changed, 178 insertions(+), 154 deletions(-) - -diff --git a/src/afs/AIX/osi_groups.c b/src/afs/AIX/osi_groups.c -index 2ef317f42..219dd6db7 100644 ---- a/src/afs/AIX/osi_groups.c -+++ b/src/afs/AIX/osi_groups.c -@@ -19,6 +19,7 @@ - - #include "afs/sysincludes.h" - #include "afsincludes.h" -+#include "afs/opr.h" - #include "afs/afs_stats.h" /* statistics */ - - -@@ -130,7 +131,7 @@ afs_getgroups(struct ucred *cred, int ngroups, gid_t * gidset) - gidset[0] = gidset[1] = 0; - AFS_STATCNT(afs_getgroups); - -- savengrps = ngrps = MIN(ngroups, cred->cr_ngrps); -+ savengrps = ngrps = opr_min(ngroups, cred->cr_ngrps); - gp = cred->cr_groups; - while (ngrps--) - *gidset++ = *gp++; -diff --git a/src/afs/DARWIN/osi_groups.c b/src/afs/DARWIN/osi_groups.c -index 11e65e378..5899c7287 100644 ---- a/src/afs/DARWIN/osi_groups.c -+++ b/src/afs/DARWIN/osi_groups.c -@@ -18,6 +18,7 @@ - #include "afs/param.h" - #include "afs/sysincludes.h" - #include "afsincludes.h" -+#include "afs/opr.h" - #include "afs/afs_stats.h" /* statistics */ - - /* We should be doing something better anyway */ -@@ -122,7 +123,7 @@ afs_getgroups(struct ucred *cred, int ngroups, gid_t * gidset) - gid_t *gp; - - AFS_STATCNT(afs_getgroups); -- savengrps = ngrps = MIN(ngroups, cred->cr_ngroups); -+ savengrps = ngrps = opr_min(ngroups, cred->cr_ngroups); - gp = cred->cr_groups; - while (ngrps--) - *gidset++ = *gp++; -diff --git a/src/afs/DARWIN/osi_vnodeops.c b/src/afs/DARWIN/osi_vnodeops.c -index b903cc7c4..a92ed5358 100644 ---- a/src/afs/DARWIN/osi_vnodeops.c -+++ b/src/afs/DARWIN/osi_vnodeops.c -@@ -8,6 +8,7 @@ - #include /* Standard vendor system headers */ - #include /* Afs-based standard headers */ - #include /* statistics */ -+#include - #include - #include - #include -@@ -2103,7 +2104,7 @@ afs_vop_cmap(ap) - * } */ *ap; - { - *ap->a_bpn = (daddr_t) (ap->a_foffset / DEV_BSIZE); -- *ap->a_run = MAX(ap->a_size, AFS_CHUNKSIZE(ap->a_foffset)); -+ *ap->a_run = opr_max(ap->a_size, AFS_CHUNKSIZE(ap->a_foffset)); - return 0; - } - #endif -diff --git a/src/afs/FBSD/osi_groups.c b/src/afs/FBSD/osi_groups.c -index 6326f6c90..2267550bf 100644 ---- a/src/afs/FBSD/osi_groups.c -+++ b/src/afs/FBSD/osi_groups.c -@@ -22,6 +22,7 @@ - - #include "afs/sysincludes.h" - #include "afsincludes.h" -+#include "afs/opr.h" - #include "afs/afs_stats.h" /* statistics */ - - static int -@@ -106,7 +107,7 @@ afs_getgroups(struct ucred *cred, int ngroups, gid_t * gidset) - gid_t *gp; - - AFS_STATCNT(afs_getgroups); -- savengrps = ngrps = MIN(ngroups, cred->cr_ngroups); -+ savengrps = ngrps = opr_min(ngroups, cred->cr_ngroups); - gp = cred->cr_groups; - while (ngrps--) - *gidset++ = *gp++; -diff --git a/src/afs/HPUX/osi_groups.c b/src/afs/HPUX/osi_groups.c -index 8d6d9dbd7..c3b024c23 100644 ---- a/src/afs/HPUX/osi_groups.c -+++ b/src/afs/HPUX/osi_groups.c -@@ -19,6 +19,7 @@ - - #include "afs/sysincludes.h" - #include "afsincludes.h" -+#include "afs/opr.h" - #include "afs/afs_stats.h" /* statistics */ - - static int -@@ -104,7 +105,7 @@ afs_getgroups(struct ucred *cred, int ngroups, gid_t * gidset) - if (gp[-1] != NOGROUP) - break; - } -- savengrps = ngrps = MIN(ngroups, gp - cred->cr_groups); -+ savengrps = ngrps = opr_min(ngroups, gp - cred->cr_groups); - for (gp = cred->cr_groups; ngrps--;) - *gidset++ = *gp++; - return savengrps; -diff --git a/src/afs/HPUX/osi_vnodeops.c b/src/afs/HPUX/osi_vnodeops.c -index b54bf1a25..711cae8e0 100644 ---- a/src/afs/HPUX/osi_vnodeops.c -+++ b/src/afs/HPUX/osi_vnodeops.c -@@ -15,6 +15,7 @@ - - #include "afs/sysincludes.h" /* Standard vendor system headers */ - #include "afsincludes.h" /* Afs-based standard headers */ -+#include "afs/opr.h" - #include "afs/afs_stats.h" /* statistics stuff */ - - #include -@@ -87,7 +88,7 @@ m_cpytoc(m, off, len, cp) - if (m == NULL) - return (len); - -- ml = MIN(len, m->m_len - off); -+ ml = opr_min(len, m->m_len - off); - memcpy(cp, mtod(m, caddr_t) + off, (u_int) ml); - cp += ml; - len -= ml; -@@ -720,8 +721,8 @@ afspgin_setup_io_ranges(vfspage_t * vm_info, pgcnt_t bpages, k_off_t isize, - - maxpage = startindex + (bpages - (startindex + file_offset) % bpages); - maxpage = vm_reset_maxpage(vm_info, maxpage); -- maxpage = MIN(maxpage, (pgcnt_t) btorp(isize) - file_offset); -- maxpage = MIN(maxpage, startindex + maxpagein); -+ maxpage = opr_min(maxpage, (pgcnt_t) btorp(isize) - file_offset); -+ maxpage = opr_min(maxpage, startindex + maxpagein); - multio_maxpage = maxpage = vm_maxpage(vm_info, maxpage); - - if (!maxpage) -@@ -753,7 +754,7 @@ afspgin_setup_io_ranges(vfspage_t * vm_info, pgcnt_t bpages, k_off_t isize, - maxpage = startindex + count; - VASSERT(maxpage <= startindex + maxpagein); - minpage = startindex - (startindex + file_offset) % bpages; -- minpage = MAX(minpage, maxpage - maxpagein); -+ minpage = opr_max(minpage, maxpage - maxpagein); - VASSERT(startindex >= VM_BASE_OFFSET(vm_info)); - minpage = vm_minpage(vm_info, minpage); - VASSERT(minpage <= startindex); -diff --git a/src/afs/IRIX/osi_groups.c b/src/afs/IRIX/osi_groups.c -index 208ddcde5..d3f8b3347 100644 ---- a/src/afs/IRIX/osi_groups.c -+++ b/src/afs/IRIX/osi_groups.c -@@ -21,6 +21,7 @@ - - #include "afs/sysincludes.h" - #include "afsincludes.h" -+#include "afs/opr.h" - #include "afs/afs_stats.h" /* statistics */ - - -@@ -229,7 +230,7 @@ afs_getgroups(struct ucred *cred, int ngroups, gid_t * gidset) - - gidset[0] = gidset[1] = 0; - AFS_STATCNT(afs_getgroups); -- savengrps = ngrps = MIN(ngroups, cred->cr_ngroups); -+ savengrps = ngrps = opr_min(ngroups, cred->cr_ngroups); - gp = cred->cr_groups; - while (ngrps--) - *gidset++ = *gp++; -diff --git a/src/afs/IRIX/osi_vnodeops.c b/src/afs/IRIX/osi_vnodeops.c -index 1d4a26cff..da0df46c4 100644 ---- a/src/afs/IRIX/osi_vnodeops.c -+++ b/src/afs/IRIX/osi_vnodeops.c -@@ -16,6 +16,7 @@ - - #include "afs/sysincludes.h" /* Standard vendor system headers */ - #include "afsincludes.h" /* Afs-based standard headers */ -+#include "afs/opr.h" - #include "afs/afs_stats.h" /* statistics */ - #include "sys/flock.h" - #include "afs/nfsclient.h" -@@ -408,7 +409,7 @@ afsrwvp(struct vcache *avc, struct uio *uio, enum uio_rw rw, - /* - * compute minimum of rest of block and rest of file - */ -- cnt = MIN(bsize - off, rem); -+ cnt = opr_min(bsize - off, rem); - osi_Assert((off + cnt) <= bsize); - bsize = ctob(btoc(off + cnt)); - len = BTOBBT(bsize); -@@ -417,7 +418,7 @@ afsrwvp(struct vcache *avc, struct uio *uio, enum uio_rw rw, - bmv[0].length = len; - bmv[0].bsize = bsize; - bmv[0].pboff = off; -- bmv[0].pbsize = MIN(cnt, uio->uio_resid); -+ bmv[0].pbsize = opr_min(cnt, uio->uio_resid); - bmv[0].eof = 0; - bmv[0].pbdev = vp->v_rdev; - bmv[0].pmp = uio->uio_pmp; -@@ -439,7 +440,7 @@ afsrwvp(struct vcache *avc, struct uio *uio, enum uio_rw rw, - bsize = AFSBSIZE; - bmv[1].bn = bmv[1].offset = bn + len; - osi_Assert((BBTOB(bn + len) % bsize) == 0); -- acnt = MIN(bsize, rem); -+ acnt = opr_min(bsize, rem); - bsize = ctob(btoc(acnt)); - len = BTOBBT(bsize); - nmaps = 2; -@@ -500,7 +501,7 @@ afsrwvp(struct vcache *avc, struct uio *uio, enum uio_rw rw, - } - counter++; - -- cnt = MIN(bsize - off, uio->uio_resid); -+ cnt = opr_min(bsize - off, uio->uio_resid); - bsize = ctob(btoc(off + cnt)); - len = BTOBBT(bsize); - bmv[0].bn = bn; -@@ -637,7 +638,7 @@ OSI_VC_DECL(avc); - if (rem <= 0) - cnt = 0; /* EOF */ - else -- cnt = MIN(bsize - off, rem); -+ cnt = opr_min(bsize - off, rem); - - /* - * It is benign to ignore *nbmv > 1, since it is only for requesting -@@ -650,7 +651,7 @@ OSI_VC_DECL(avc); - */ - osi_Assert((off + cnt) <= bsize); - bsize = ctob(btoc(off + cnt)); -- bmv->pbsize = MIN(cnt, count); -+ bmv->pbsize = opr_min(cnt, count); - bmv->eof = 0; - bmv->pmp = NULL; - bmv->pbdev = avc->v.v_rdev; -diff --git a/src/afs/NBSD/osi_groups.c b/src/afs/NBSD/osi_groups.c -index 78b80e70b..9ee543932 100644 ---- a/src/afs/NBSD/osi_groups.c -+++ b/src/afs/NBSD/osi_groups.c -@@ -21,6 +21,7 @@ - - #include "afs/sysincludes.h" - #include "afs/afsincludes.h" -+#include "afs/opr.h" - #include "afs/afs_stats.h" /* statistics */ - #include "sys/syscallargs.h" - -@@ -106,7 +107,7 @@ osi_getgroups(afs_ucred_t *cred, int ngroups, gid_t *gidset) - { - AFS_STATCNT(afs_getgroups); - -- ngroups = MIN(kauth_cred_ngroups(cred), ngroups); -+ ngroups = opr_min(kauth_cred_ngroups(cred), ngroups); - - kauth_cred_getgroups(cred, gidset, ngroups, UIO_SYSSPACE); - return ngroups; -diff --git a/src/afs/NBSD/osi_vnodeops.c b/src/afs/NBSD/osi_vnodeops.c -index 2dc0a9b0c..f6c604919 100644 ---- a/src/afs/NBSD/osi_vnodeops.c -+++ b/src/afs/NBSD/osi_vnodeops.c -@@ -100,6 +100,7 @@ NONINFRINGEMENT. - - #include "afs/sysincludes.h" /* Standard vendor system headers */ - #include "afs/afsincludes.h" /* Afs-based standard headers */ -+#include "afs/opr.h" - #include "afs/afs_stats.h" /* statistics */ - - #include -@@ -206,7 +207,7 @@ static void - afs_nbsd_gop_size(struct vnode *vp, off_t size, off_t *eobp, int flags) - { - -- *eobp = MAX(size, vp->v_size); -+ *eobp = opr_max(size, vp->v_size); - } - - static int -diff --git a/src/afs/OBSD/osi_groups.c b/src/afs/OBSD/osi_groups.c -index e26088f19..208e5a744 100644 ---- a/src/afs/OBSD/osi_groups.c -+++ b/src/afs/OBSD/osi_groups.c -@@ -21,6 +21,7 @@ - - #include "afs/sysincludes.h" - #include "afs/afsincludes.h" -+#include "afs/opr.h" - #include "afs/afs_stats.h" /* statistics */ - #include "sys/syscallargs.h" - -@@ -115,7 +116,7 @@ afs_getgroups(struct ucred *cred, int ngroups, gid_t * gidset) - gid_t *gp; - - AFS_STATCNT(afs_getgroups); -- savengrps = ngrps = MIN(ngroups, cred->cr_ngroups); -+ savengrps = ngrps = opr_min(ngroups, cred->cr_ngroups); - gp = cred->cr_groups; - while (ngrps--) - *gidset++ = *gp++; -diff --git a/src/afs/UKERNEL/afs_usrops.c b/src/afs/UKERNEL/afs_usrops.c -index 2d11b445a..a6ca52a79 100644 ---- a/src/afs/UKERNEL/afs_usrops.c -+++ b/src/afs/UKERNEL/afs_usrops.c -@@ -30,6 +30,7 @@ - #include "afs/afs_bypasscache.h" - #include "rx/rx_globals.h" - #include "afsd/afsd.h" -+#include "afs/opr.h" - - #define VFS 1 - #undef VIRTUE -@@ -276,7 +277,7 @@ usr_uiomove(char *kbuf, int n, int rw, struct usr_uio *uio) - */ - ptr = kbuf; - while (nio > 0 && n > 0) { -- len = MIN(n, iovp->iov_len); -+ len = opr_min(n, iovp->iov_len); - if (rw == UIO_READ) { - memcpy(iovp->iov_base, ptr, len); - } else { -diff --git a/src/afs/VNOPS/afs_vnop_strategy.c b/src/afs/VNOPS/afs_vnop_strategy.c -index c4296bb6f..4aeb87a4a 100644 ---- a/src/afs/VNOPS/afs_vnop_strategy.c -+++ b/src/afs/VNOPS/afs_vnop_strategy.c -@@ -24,6 +24,7 @@ - #include "afs/afs_cbqueue.h" - #include "afs/nfsclient.h" - #include "afs/afs_osidnlc.h" -+#include "afs/opr.h" - - - -@@ -177,7 +178,7 @@ int afs_ustrategy(struct buf *abp) - * XXX It this really right? Ideally we should always write block size multiple - * and not any arbitrary size, right? XXX - */ -- len = MIN(len, tvc->f.m.Length - dbtob(abp->b_blkno)); -+ len = opr_min(len, tvc->f.m.Length - dbtob(abp->b_blkno)); - #endif - tuio.afsio_resid = len; - #if defined(AFS_NBSD40_ENV) || defined(FBSD_STRUCT_BUF_NO_SAVEADDR) -diff --git a/src/afs/VNOPS/afs_vnop_write.c b/src/afs/VNOPS/afs_vnop_write.c -index 3479348e1..c206a0394 100644 ---- a/src/afs/VNOPS/afs_vnop_write.c -+++ b/src/afs/VNOPS/afs_vnop_write.c -@@ -26,6 +26,7 @@ - #include "afs/afs_cbqueue.h" - #include "afs/nfsclient.h" - #include "afs/afs_osidnlc.h" -+#include "afs/opr.h" - - - extern unsigned char *afs_indexFlags; -@@ -250,7 +251,7 @@ afs_write(struct vcache *avc, struct uio *auio, int aio, - */ - osi_Assert(filePos <= avc->f.m.Length); - diff = avc->f.m.Length - filePos; -- AFS_UIO_SETRESID(auio, MIN(totalLength, diff)); -+ AFS_UIO_SETRESID(auio, opr_min(totalLength, diff)); - totalLength = AFS_UIO_RESID(auio); - } - #else -diff --git a/src/afs/afs_call.c b/src/afs/afs_call.c -index 4ac63b187..45b3f55eb 100644 ---- a/src/afs/afs_call.c -+++ b/src/afs/afs_call.c -@@ -18,6 +18,7 @@ - #include "afsincludes.h" /* Afs-based standard headers */ - #include "afs/afs_stats.h" - #include "rx/rx_globals.h" -+#include "afs/opr.h" - #if !defined(UKERNEL) - # if defined(AFS_LINUX_ENV) - # include "osi_compat.h" -@@ -968,9 +969,9 @@ afs_syscall_call(long parm, long parm2, long parm3, - if (mvParam->reqtype == AFS_USPC_UMV) { - /* don't copy out random kernel memory */ - AFS_COPYOUT(param2, AFSKPTR(parm4), -- MIN(namebufsz, strlen((char *)param2)+1), code); -+ opr_min(namebufsz, strlen((char *)param2)+1), code); - AFS_COPYOUT(param1, AFSKPTR(parm3), -- MIN(namebufsz, strlen((char *)param1)+1), code); -+ opr_min(namebufsz, strlen((char *)param1)+1), code); - } - AFS_COPYOUT((caddr_t)mvParam, AFSKPTR(parm2), - sizeof(struct afs_uspc_param), code); -diff --git a/src/lwp/iomgr.c b/src/lwp/iomgr.c -index 1251d06ca..2c88b56a9 100644 ---- a/src/lwp/iomgr.c -+++ b/src/lwp/iomgr.c -@@ -601,7 +601,7 @@ static void SignalIO(int fds, fd_set *readfds, fd_set *writefds, - struct IoRequest *req; - PROCESS pid; - req = (struct IoRequest *) r -> BackPointer; -- nfds = MIN(fds, req->nfds); -+ nfds = opr_min(fds, req->nfds); - if (FDSetCmp(nfds, req->readfds, readfds) || - FDSetCmp(nfds, req->writefds, writefds) || - FDSetCmp(nfds, req->exceptfds, exceptfds)) { -diff --git a/src/opr/opr.h b/src/opr/opr.h -index aae17e3cb..6bb2dc8b7 100644 ---- a/src/opr/opr.h -+++ b/src/opr/opr.h -@@ -21,6 +21,9 @@ extern void opr_NTAbort(void); - # define opr_abort() abort() - #endif - -+#define opr_min(a, b) ((a) < (b) ? (a) : (b)) -+#define opr_max(a, b) ((a) > (b) ? (a) : (b)) -+ - extern void opr_AssertionFailed(const char *, int) AFS_NORETURN; - extern void opr_AssertFailU(const char *, const char *, int) AFS_NORETURN; - -diff --git a/src/rx/AIX/rx_knet.c b/src/rx/AIX/rx_knet.c -index 5f47ff631..740be552d 100644 ---- a/src/rx/AIX/rx_knet.c -+++ b/src/rx/AIX/rx_knet.c -@@ -9,6 +9,7 @@ - - #include - #include "afs/param.h" -+#include "afs/opr.h" - - - #ifdef AFS_AIX41_ENV -@@ -406,9 +407,9 @@ osi_NetSend(osi_socket asocket, struct sockaddr_in *addr, struct iovec *dvec, - } - /* now compute usable size */ - if (M_HASCL(m)) { -- len = MIN(m->m_ext.ext_size, asize); -+ len = opr_min(m->m_ext.ext_size, asize); - } else { -- len = MIN(mlen, asize); -+ len = opr_min(mlen, asize); - } - - tpa = mtod(m, caddr_t); -@@ -416,7 +417,7 @@ osi_NetSend(osi_socket asocket, struct sockaddr_in *addr, struct iovec *dvec, - mp = &m->m_next; - m->m_len = 0; - while (len) { -- rlen = MIN(len, tl); -+ rlen = opr_min(len, tl); - memcpy(tpa, tdata, rlen); - asize -= rlen; - len -= rlen; -diff --git a/src/rx/DARWIN/rx_knet.c b/src/rx/DARWIN/rx_knet.c -index 405e35312..99bba8dc9 100644 ---- a/src/rx/DARWIN/rx_knet.c -+++ b/src/rx/DARWIN/rx_knet.c -@@ -9,6 +9,7 @@ - - #include - #include "afs/param.h" -+#include "afs/opr.h" - - #ifdef AFS_SOCKPROXY_ENV - # include -@@ -716,7 +717,7 @@ rx_upcall_common(socket_t so, struct afs_pkt_hdr *pkt) - noffset = 0; - - for (i = 0; i < p->niovecs && resid > 0; i++) { -- sz = MIN(resid, p->wirevec[i].iov_len); -+ sz = opr_min(resid, p->wirevec[i].iov_len); - memcpy(p->wirevec[i].iov_base, payload, sz); - resid -= sz; - noffset += sz; -@@ -732,7 +733,7 @@ rx_upcall_common(socket_t so, struct afs_pkt_hdr *pkt) - noffset = 0; - resid = nbytes; - for (i=0;iniovecs && resid;i++) { -- sz=MIN(resid, p->wirevec[i].iov_len); -+ sz=opr_min(resid, p->wirevec[i].iov_len); - error = mbuf_copydata(m, offset, sz, p->wirevec[i].iov_base); - if (error) - break; -@@ -853,7 +854,7 @@ osi_NetReceive(osi_socket so, struct sockaddr_in *addr, struct iovec *dvec, - size_t offset=0,sz; - resid = *alength; - for (i=0;i - #include "afs/param.h" -+#include "afs/opr.h" - - - #include -@@ -446,18 +447,18 @@ osi_NetSend(osi_socket asocket, struct sockaddr_in *addr, struct iovec *dvec, - mlen = MCLBYTES; - - /* now compute usable size */ -- len = MIN(mlen, asize); -+ len = opr_min(mlen, asize); - /* Should I look at MAPPED_MBUFS??? */ - } else { - nopages: -- len = MIN(mlen, asize); -+ len = opr_min(mlen, asize); - } - m->m_len = 0; - *mp = m; /* XXXX */ - top->m_pkthdr.len += len; - tpa = mtod(m, caddr_t); - while (len) { -- rlen = MIN(len, tl); -+ rlen = opr_min(len, tl); - memcpy(tpa, tdata, rlen); - asize -= rlen; - len -= rlen; -diff --git a/src/rx/IRIX/rx_knet.c b/src/rx/IRIX/rx_knet.c -index 788c5e268..4fc1cbd17 100644 ---- a/src/rx/IRIX/rx_knet.c -+++ b/src/rx/IRIX/rx_knet.c -@@ -9,7 +9,7 @@ - - #include - #include "afs/param.h" -- -+#include "afs/opr.h" - - #include "rx/rx_kcommon.h" - #include "rx/rx_packet.h" -@@ -366,8 +366,8 @@ rxi_EnumGetIfInfo(struct hashbucket *h, caddr_t key, caddr_t arg1, - } - rxmtu = rxmtu * rxi_nRecvFrags + ((rxi_nRecvFrags - 1) * UDP_HDR_SIZE); - if (!rx_IsLoopbackAddr(ifinaddr) && (rxmtu > rx_maxReceiveSize)) { -- rx_maxReceiveSize = MIN(RX_MAX_PACKET_SIZE, rxmtu); -- rx_maxReceiveSize = MIN(rx_maxReceiveSize, rx_maxReceiveSizeUser); -+ rx_maxReceiveSize = opr_min(RX_MAX_PACKET_SIZE, rxmtu); -+ rx_maxReceiveSize = opr_min(rx_maxReceiveSize, rx_maxReceiveSizeUser); - } - - *(int *)arg2 = i + 1; -@@ -390,7 +390,7 @@ rxi_GetIFInfo() - rx_maxJumboRecvSize = - RX_HEADER_SIZE + rxi_nDgramPackets * RX_JUMBOBUFFERSIZE + - (rxi_nDgramPackets - 1) * RX_JUMBOHEADERSIZE; -- rx_maxJumboRecvSize = MAX(rx_maxJumboRecvSize, rx_maxReceiveSize); -+ rx_maxJumboRecvSize = opr_max(rx_maxJumboRecvSize, rx_maxReceiveSize); - - return different; - } -diff --git a/src/rx/SOLARIS/rx_knet.c b/src/rx/SOLARIS/rx_knet.c -index fe85e63b8..74339375f 100644 ---- a/src/rx/SOLARIS/rx_knet.c -+++ b/src/rx/SOLARIS/rx_knet.c -@@ -9,6 +9,7 @@ - - #include - #include "afs/param.h" -+#include "afs/opr.h" - - - #ifdef AFS_SUN5_ENV -@@ -121,9 +122,9 @@ rxi_GetIFInfo() - addrs[i] = ifinaddr; - - if (!rx_IsLoopbackAddr(ifinaddr) && maxmtu > rx_maxReceiveSize) { -- rx_maxReceiveSize = MIN(RX_MAX_PACKET_SIZE, maxmtu); -+ rx_maxReceiveSize = opr_min(RX_MAX_PACKET_SIZE, maxmtu); - rx_maxReceiveSize = -- MIN(rx_maxReceiveSize, rx_maxReceiveSizeUser); -+ opr_min(rx_maxReceiveSize, rx_maxReceiveSizeUser); - } - - } -@@ -133,7 +134,7 @@ rxi_GetIFInfo() - rx_maxJumboRecvSize = - RX_HEADER_SIZE + rxi_nDgramPackets * RX_JUMBOBUFFERSIZE + - (rxi_nDgramPackets - 1) * RX_JUMBOHEADERSIZE; -- rx_maxJumboRecvSize = MAX(rx_maxJumboRecvSize, rx_maxReceiveSize); -+ rx_maxJumboRecvSize = opr_max(rx_maxJumboRecvSize, rx_maxReceiveSize); - - if (different) { - int j; -@@ -180,9 +181,9 @@ rxi_GetIFInfo() - i++; - - if (!rx_IsLoopbackAddr(ifinaddr) && maxmtu > rx_maxReceiveSize) { -- rx_maxReceiveSize = MIN(RX_MAX_PACKET_SIZE, maxmtu); -+ rx_maxReceiveSize = opr_min(RX_MAX_PACKET_SIZE, maxmtu); - rx_maxReceiveSize = -- MIN(rx_maxReceiveSize, rx_maxReceiveSizeUser); -+ opr_min(rx_maxReceiveSize, rx_maxReceiveSizeUser); - } - } - } -@@ -190,7 +191,7 @@ rxi_GetIFInfo() - rx_maxJumboRecvSize = - RX_HEADER_SIZE + rxi_nDgramPackets * RX_JUMBOBUFFERSIZE + - (rxi_nDgramPackets - 1) * RX_JUMBOHEADERSIZE; -- rx_maxJumboRecvSize = MAX(rx_maxJumboRecvSize, rx_maxReceiveSize); -+ rx_maxJumboRecvSize = opr_max(rx_maxJumboRecvSize, rx_maxReceiveSize); - - if (different) { - int j; -diff --git a/src/rx/rx.c b/src/rx/rx.c -index b3cc50c9b..162d2297e 100644 ---- a/src/rx/rx.c -+++ b/src/rx/rx.c -@@ -67,11 +67,10 @@ extern afs_int32 afs_termState; - # include - # endif - --# include -- - # include "rx_user.h" - #endif /* KERNEL */ - -+#include - #include - #include - -@@ -1123,15 +1122,15 @@ rxi_CheckConnTimeouts(struct rx_connection *conn) - /* this logic is slightly complicated by the fact that - * idleDeadTime/hardDeadTime may not be set at all, but it's not too bad. - */ -- conn->secondsUntilDead = MAX(conn->secondsUntilDead, RX_MINDEADTIME); -+ conn->secondsUntilDead = opr_max(conn->secondsUntilDead, RX_MINDEADTIME); - if (conn->idleDeadTime) { -- conn->idleDeadTime = MAX(conn->idleDeadTime, conn->secondsUntilDead); -+ conn->idleDeadTime = opr_max(conn->idleDeadTime, conn->secondsUntilDead); - } - if (conn->hardDeadTime) { - if (conn->idleDeadTime) { -- conn->hardDeadTime = MAX(conn->idleDeadTime, conn->hardDeadTime); -+ conn->hardDeadTime = opr_max(conn->idleDeadTime, conn->hardDeadTime); - } else { -- conn->hardDeadTime = MAX(conn->secondsUntilDead, conn->hardDeadTime); -+ conn->hardDeadTime = opr_max(conn->secondsUntilDead, conn->hardDeadTime); - } - } - } -@@ -2898,11 +2897,11 @@ rxi_SetPeerMtu(struct rx_peer *peer, afs_uint32 host, afs_uint32 port, int mtu) - - MUTEX_ENTER(&peer->peer_lock); - /* We don't handle dropping below min, so don't */ -- mtu = MAX(mtu, RX_MIN_PACKET_SIZE); -- peer->ifMTU=MIN(mtu, peer->ifMTU); -+ mtu = opr_max(mtu, RX_MIN_PACKET_SIZE); -+ peer->ifMTU=opr_min(mtu, peer->ifMTU); - peer->natMTU = rxi_AdjustIfMTU(peer->ifMTU); - /* if we tweaked this down, need to tune our peer MTU too */ -- peer->MTU = MIN(peer->MTU, peer->natMTU); -+ peer->MTU = opr_min(peer->MTU, peer->natMTU); - /* if we discovered a sub-1500 mtu, degrade */ - if (peer->ifMTU < OLD_MAX_PACKET_SIZE) - peer->maxDgramPackets = 1; -@@ -4336,7 +4335,7 @@ rxi_ReceiveAckPacket(struct rx_call *call, struct rx_packet *np, - return np; /* truncated ack packet */ - - /* depends on ack packet struct */ -- nAcks = MIN((unsigned)nbytes, (unsigned)ap->nAcks); -+ nAcks = opr_min((unsigned)nbytes, (unsigned)ap->nAcks); - first = ntohl(ap->firstPacket); - prev = ntohl(ap->previousPacket); - serial = ntohl(ap->serial); -@@ -4566,7 +4565,7 @@ rxi_ReceiveAckPacket(struct rx_call *call, struct rx_packet *np, - tSize = RX_MAX_PACKET_SIZE; - if (tSize < RX_MIN_PACKET_SIZE) - tSize = RX_MIN_PACKET_SIZE; -- peer->natMTU = rxi_AdjustIfMTU(MIN(tSize, peer->ifMTU)); -+ peer->natMTU = rxi_AdjustIfMTU(opr_min(tSize, peer->ifMTU)); - - /* Get the maximum packet size to send to this peer */ - rx_packetread(np, rx_AckDataSize(ap->nAcks), (int)sizeof(afs_int32), -@@ -4576,7 +4575,7 @@ rxi_ReceiveAckPacket(struct rx_call *call, struct rx_packet *np, - tSize = RX_MAX_PACKET_SIZE; - if (tSize < RX_MIN_PACKET_SIZE) - tSize = RX_MIN_PACKET_SIZE; -- tSize = (afs_uint32) MIN(tSize, rx_MyMaxSendSize); -+ tSize = (afs_uint32) opr_min(tSize, rx_MyMaxSendSize); - tSize = rxi_AdjustMaxMTU(peer->natMTU, tSize); - - /* sanity check - peer might have restarted with different params. -@@ -4587,8 +4586,8 @@ rxi_ReceiveAckPacket(struct rx_call *call, struct rx_packet *np, - if (peer->maxMTU > tSize) /* possible cong., maxMTU decreased */ - peer->congestSeq++; - peer->maxMTU = tSize; -- peer->MTU = MIN(tSize, peer->MTU); -- call->MTU = MIN(call->MTU, tSize); -+ peer->MTU = opr_min(tSize, peer->MTU); -+ call->MTU = opr_min(call->MTU, tSize); - } - - if (np->length == rx_AckDataSize(ap->nAcks) + 3 * sizeof(afs_int32)) { -@@ -4603,7 +4602,7 @@ rxi_ReceiveAckPacket(struct rx_call *call, struct rx_packet *np, - tSize = rx_maxSendWindow; - if (tSize < call->twind) { /* smaller than our send */ - call->twind = tSize; /* window, we must send less... */ -- call->ssthresh = MIN(call->twind, call->ssthresh); -+ call->ssthresh = opr_min(call->twind, call->ssthresh); - call->conn->twind[call->channel] = call->twind; - } - -@@ -4632,7 +4631,7 @@ rxi_ReceiveAckPacket(struct rx_call *call, struct rx_packet *np, - if (tSize < call->twind) { - call->twind = tSize; - call->conn->twind[call->channel] = call->twind; -- call->ssthresh = MIN(call->twind, call->ssthresh); -+ call->ssthresh = opr_min(call->twind, call->ssthresh); - } else if (tSize > call->twind) { - call->twind = tSize; - call->conn->twind[call->channel] = call->twind; -@@ -4648,9 +4647,9 @@ rxi_ReceiveAckPacket(struct rx_call *call, struct rx_packet *np, - rx_AckDataSize(ap->nAcks) + 3 * (int)sizeof(afs_int32), - (int)sizeof(afs_int32), &tSize); - maxDgramPackets = (afs_uint32) ntohl(tSize); -- maxDgramPackets = MIN(maxDgramPackets, rxi_nDgramPackets); -+ maxDgramPackets = opr_min(maxDgramPackets, rxi_nDgramPackets); - maxDgramPackets = -- MIN(maxDgramPackets, (int)(peer->ifDgramPackets)); -+ opr_min(maxDgramPackets, (int)(peer->ifDgramPackets)); - if (maxDgramPackets > 1) { - peer->maxDgramPackets = maxDgramPackets; - call->MTU = RX_JUMBOBUFFERSIZE + RX_HEADER_SIZE; -@@ -4718,7 +4717,7 @@ rxi_ReceiveAckPacket(struct rx_call *call, struct rx_packet *np, - - if (call->flags & RX_CALL_FAST_RECOVER) { - if (newAckCount == 0) { -- call->cwind = MIN((int)(call->cwind + 1), rx_maxSendWindow); -+ call->cwind = opr_min((int)(call->cwind + 1), rx_maxSendWindow); - } else { - call->flags &= ~RX_CALL_FAST_RECOVER; - call->cwind = call->nextCwind; -@@ -4729,10 +4728,10 @@ rxi_ReceiveAckPacket(struct rx_call *call, struct rx_packet *np, - } else if (nNacked && call->nNacks >= (u_short) rx_nackThreshold) { - /* Three negative acks in a row trigger congestion recovery */ - call->flags |= RX_CALL_FAST_RECOVER; -- call->ssthresh = MAX(4, MIN((int)call->cwind, (int)call->twind)) >> 1; -+ call->ssthresh = opr_max(4, opr_min((int)call->cwind, (int)call->twind)) >> 1; - call->cwind = -- MIN((int)(call->ssthresh + rx_nackThreshold), rx_maxSendWindow); -- call->nDgramPackets = MAX(2, (int)call->nDgramPackets) >> 1; -+ opr_min((int)(call->ssthresh + rx_nackThreshold), rx_maxSendWindow); -+ call->nDgramPackets = opr_max(2, (int)call->nDgramPackets) >> 1; - call->nextCwind = call->ssthresh; - call->nAcks = 0; - call->nNacks = 0; -@@ -4767,13 +4766,13 @@ rxi_ReceiveAckPacket(struct rx_call *call, struct rx_packet *np, - * receive (linear growth). */ - if (call->cwind < call->ssthresh) { - call->cwind = -- MIN((int)call->ssthresh, (int)(call->cwind + newAckCount)); -+ opr_min((int)call->ssthresh, (int)(call->cwind + newAckCount)); - call->nCwindAcks = 0; - } else { - call->nCwindAcks += newAckCount; - if (call->nCwindAcks >= call->cwind) { - call->nCwindAcks = 0; -- call->cwind = MIN((int)(call->cwind + 1), rx_maxSendWindow); -+ call->cwind = opr_min((int)(call->cwind + 1), rx_maxSendWindow); - } - } - /* -@@ -4792,7 +4791,7 @@ rxi_ReceiveAckPacket(struct rx_call *call, struct rx_packet *np, - call->MTU = peer->ifMTU; - else { - call->MTU += peer->natMTU; -- call->MTU = MIN(call->MTU, peer->maxMTU); -+ call->MTU = opr_min(call->MTU, peer->maxMTU); - } - } - call->nAcks = 0; -@@ -5419,10 +5418,10 @@ rxi_ResetCall(struct rx_call *call, int newcall) - MUTEX_ENTER(&peer->peer_lock); - if (!newcall) { - if (call->congestSeq == peer->congestSeq) { -- peer->cwind = MAX(peer->cwind, call->cwind); -- peer->MTU = MAX(peer->MTU, call->MTU); -+ peer->cwind = opr_max(peer->cwind, call->cwind); -+ peer->MTU = opr_max(peer->MTU, call->MTU); - peer->nDgramPackets = -- MAX(peer->nDgramPackets, call->nDgramPackets); -+ opr_max(peer->nDgramPackets, call->nDgramPackets); - } - } else { - call->abortCode = 0; -@@ -5433,7 +5432,7 @@ rxi_ResetCall(struct rx_call *call, int newcall) - } else { - call->MTU = peer->MTU; - } -- call->cwind = MIN((int)peer->cwind, (int)peer->nDgramPackets); -+ call->cwind = opr_min((int)peer->cwind, (int)peer->nDgramPackets); - call->ssthresh = rx_maxSendWindow; - call->nDgramPackets = peer->nDgramPackets; - call->congestSeq = peer->congestSeq; -@@ -5441,7 +5440,7 @@ rxi_ResetCall(struct rx_call *call, int newcall) - call->rtt_dev = peer->rtt_dev; - clock_Zero(&call->rto); - clock_Addmsec(&call->rto, -- MAX(((call->rtt >> 3) + call->rtt_dev), rx_minPeerTimeout) + 200); -+ opr_max(((call->rtt >> 3) + call->rtt_dev), rx_minPeerTimeout) + 200); - MUTEX_EXIT(&peer->peer_lock); - - flags = call->flags; -@@ -5587,7 +5586,7 @@ rxi_SendAck(struct rx_call *call, - padbytes = call->conn->peer->maxMTU + 128; - - /* do always try a minimum size ping */ -- padbytes = MAX(padbytes, RX_MIN_PACKET_SIZE+RX_IPUDP_SIZE+4); -+ padbytes = opr_max(padbytes, RX_MIN_PACKET_SIZE+RX_IPUDP_SIZE+4); - - /* subtract the ack payload */ - padbytes -= (rx_AckDataSize(call->rwind) + 4 * sizeof(afs_int32)); -@@ -6133,9 +6132,9 @@ rxi_Resend(struct rxevent *event, void *arg0, void *arg1, int istack) - * and start again from the beginning */ - if (peer->maxDgramPackets >1) { - call->MTU = RX_JUMBOBUFFERSIZE + RX_HEADER_SIZE; -- call->MTU = MIN(peer->natMTU, peer->maxMTU); -+ call->MTU = opr_min(peer->natMTU, peer->maxMTU); - } -- call->ssthresh = MAX(4, MIN((int)call->cwind, (int)call->twind)) >> 1; -+ call->ssthresh = opr_max(4, opr_min((int)call->cwind, (int)call->twind)) >> 1; - call->nDgramPackets = 1; - call->cwind = 1; - call->nextCwind = 1; -@@ -6205,7 +6204,7 @@ rxi_Start(struct rx_call *call, int istack) - call->flags &= ~RX_CALL_NEED_START; - #endif /* RX_ENABLE_LOCKS */ - nXmitPackets = 0; -- maxXmitPackets = MIN(call->twind, call->cwind); -+ maxXmitPackets = opr_min(call->twind, call->cwind); - for (opr_queue_Scan(&call->tq, cursor)) { - struct rx_packet *p - = opr_queue_Entry(cursor, struct rx_packet, entry); -@@ -6222,7 +6221,7 @@ rxi_Start(struct rx_call *call, int istack) - p->header.flags &= RX_PRESET_FLAGS; - - if (p->header.seq >= -- call->tfirst + MIN((int)call->twind, -+ call->tfirst + opr_min((int)call->twind, - (int)(call->nSoftAcked + - call->cwind))) { - call->flags |= RX_CALL_WAIT_WINDOW_SEND; /* Wait for transmit window */ -@@ -6398,9 +6397,9 @@ rxi_CheckCall(struct rx_call *call, int haveCTLock) - if (now < call->lastSendTime) - clock_diff = call->lastSendTime - now; - if (now < call->startWait) -- clock_diff = MAX(clock_diff, call->startWait - now); -+ clock_diff = opr_max(clock_diff, call->startWait - now); - if (now < call->lastReceiveTime) -- clock_diff = MAX(clock_diff, call->lastReceiveTime - now); -+ clock_diff = opr_max(clock_diff, call->lastReceiveTime - now); - if (clock_diff > 5 * 60) - { - if (call->state == RX_STATE_ACTIVE) -@@ -6490,7 +6489,7 @@ mtuout: - * Shrink by 128 bytes and try again. */ - if (conn->peer->maxPacketSize < conn->lastPacketSize) - /* maxPacketSize will be cleared in rxi_SetPeerMtu */ -- newmtu = MAX(conn->peer->maxPacketSize + RX_HEADER_SIZE, -+ newmtu = opr_max(conn->peer->maxPacketSize + RX_HEADER_SIZE, - conn->lastPacketSize - 128 + RX_HEADER_SIZE); - else - newmtu = conn->lastPacketSize - 128 + RX_HEADER_SIZE; -@@ -6726,7 +6725,7 @@ rxi_ScheduleGrowMTUEvent(struct rx_call *call, int secs) - secs = (RX_PINGS_LOST_BEFORE_DEAD * call->conn->secondsUntilPing)-1; - - if (call->conn->secondsUntilDead) -- secs = MIN(secs, (call->conn->secondsUntilDead-1)); -+ secs = opr_min(secs, (call->conn->secondsUntilDead-1)); - } - - when.sec += secs; -@@ -7101,7 +7100,7 @@ rxi_ComputeRoundTripTime(struct rx_packet *p, - * add on a fixed 200ms to account for that timer expiring. - */ - -- rtt_timeout = MAX(((call->rtt >> 3) + call->rtt_dev), -+ rtt_timeout = opr_max(((call->rtt >> 3) + call->rtt_dev), - rx_minPeerTimeout) + 200; - clock_Zero(&call->rto); - clock_Addmsec(&call->rto, rtt_timeout); -diff --git a/src/rx/rx_getaddr.c b/src/rx/rx_getaddr.c -index 5bf7ed9c9..c340aaf15 100644 ---- a/src/rx/rx_getaddr.c -+++ b/src/rx/rx_getaddr.c -@@ -10,6 +10,8 @@ - #include - #include - -+#include "afs/opr.h" -+ - #ifndef KERNEL - - # include -@@ -409,7 +411,7 @@ rx_getAllAddr_internal(afs_uint32 buffer[], int maxSize, int loopbacks) - #ifdef AFS_AIX51_ENV - cp = cpnext - #else -- cp += sizeof(ifr->ifr_name) + MAX(a->sin_len, sizeof(*a)) -+ cp += sizeof(ifr->ifr_name) + opr_max(a->sin_len, sizeof(*a)) - #endif - #endif - ) -@@ -424,7 +426,7 @@ rx_getAllAddr_internal(afs_uint32 buffer[], int maxSize, int loopbacks) - #endif - a = (struct sockaddr_in *)&ifr->ifr_addr; - #ifdef AFS_AIX51_ENV -- cpnext = cp + sizeof(ifr->ifr_name) + MAX(a->sin_len, sizeof(*a)); -+ cpnext = cp + sizeof(ifr->ifr_name) + opr_max(a->sin_len, sizeof(*a)); - #endif - if (a->sin_family != AF_INET) - continue; -@@ -507,7 +509,7 @@ rx_getAllAddrMaskMtu(afs_uint32 addrBuffer[], afs_uint32 maskBuffer[], - ifc.ifc_len = sizeof(ifs); - for (cp = (char *)ifc.ifc_buf, cplim = ifc.ifc_buf + ifc.ifc_len; - cp < cplim; -- cp += sizeof(ifr->ifr_name) + MAX(a->sin_len, sizeof(*a))) { -+ cp += sizeof(ifr->ifr_name) + opr_max(a->sin_len, sizeof(*a))) { - ifr = (struct ifreq *)cp; - #else - for (i = 0; i < len; ++i) { -diff --git a/src/rx/rx_globals.h b/src/rx/rx_globals.h -index 558dc553b..5326af074 100644 ---- a/src/rx/rx_globals.h -+++ b/src/rx/rx_globals.h -@@ -295,7 +295,7 @@ EXT int rx_TSFPQMaxProcs GLOBALSINIT(0); /* max number of threads expected */ - do { \ - int i; \ - struct rx_packet * p; \ -- int tsize = MIN((rx_ts_info_p)->_FPQ.len, (rx_ts_info_p)->_FPQ.len - rx_TSFPQLocalMax + 3 * rx_TSFPQGlobSize); \ -+ int tsize = opr_min((rx_ts_info_p)->_FPQ.len, (rx_ts_info_p)->_FPQ.len - rx_TSFPQLocalMax + 3 * rx_TSFPQGlobSize); \ - if (tsize <= 0) break; \ - for (i=0,p=opr_queue_Last(&((rx_ts_info_p)->_FPQ.queue), \ - struct rx_packet, entry); \ -diff --git a/src/rx/rx_kcommon.c b/src/rx/rx_kcommon.c -index c90df3d36..f29bd56f0 100644 ---- a/src/rx/rx_kcommon.c -+++ b/src/rx/rx_kcommon.c -@@ -21,6 +21,7 @@ - #include "rx_internal.h" - #include "rx_stats.h" - #include "rx_peer.h" -+#include "afs/opr.h" - - #ifdef AFS_HPUX110_ENV - # include "h/tihdr.h" -@@ -372,10 +373,10 @@ rxi_InitPeerParams(struct rx_peer *pp) - i = rxi_Findcbi(pp->host); - if (i == -1) { - rx_rto_setPeerTimeoutSecs(pp, 3); -- pp->ifMTU = MIN(RX_REMOTE_PACKET_SIZE, rx_MyMaxSendSize); -+ pp->ifMTU = opr_min(RX_REMOTE_PACKET_SIZE, rx_MyMaxSendSize); - } else { - rx_rto_setPeerTimeoutSecs(pp, 2); -- pp->ifMTU = MIN(RX_MAX_PACKET_SIZE, rx_MyMaxSendSize); -+ pp->ifMTU = opr_min(RX_MAX_PACKET_SIZE, rx_MyMaxSendSize); - mtu = ntohl(afs_cb_interface.mtu[i]); - /* Diminish the packet size to one based on the MTU given by - * the interface. */ -@@ -398,7 +399,7 @@ rxi_InitPeerParams(struct rx_peer *pp) - ifn = rxi_FindIfnet(pp->host, NULL); - if (ifn) { - rx_rto_setPeerTimeoutSecs(pp, 2); -- pp->ifMTU = MIN(RX_MAX_PACKET_SIZE, rx_MyMaxSendSize); -+ pp->ifMTU = opr_min(RX_MAX_PACKET_SIZE, rx_MyMaxSendSize); - # ifdef IFF_POINTOPOINT - if (rx_ifnet_flags(ifn) & IFF_POINTOPOINT) { - /* wish we knew the bit rate and the chunk size, sigh. */ -@@ -415,7 +416,7 @@ rxi_InitPeerParams(struct rx_peer *pp) - } - } else { /* couldn't find the interface, so assume the worst */ - rx_rto_setPeerTimeoutSecs(pp, 3); -- pp->ifMTU = MIN(RX_REMOTE_PACKET_SIZE, rx_MyMaxSendSize); -+ pp->ifMTU = opr_min(RX_REMOTE_PACKET_SIZE, rx_MyMaxSendSize); - } - - RX_NET_EPOCH_EXIT(); -@@ -428,10 +429,10 @@ rxi_InitPeerParams(struct rx_peer *pp) - - if (mtu <= 0) { - rx_rto_setPeerTimeoutSecs(pp, 3); -- pp->ifMTU = MIN(RX_REMOTE_PACKET_SIZE, rx_MyMaxSendSize); -+ pp->ifMTU = opr_min(RX_REMOTE_PACKET_SIZE, rx_MyMaxSendSize); - } else { - rx_rto_setPeerTimeoutSecs(pp, 2); -- pp->ifMTU = MIN(RX_MAX_PACKET_SIZE, rx_MyMaxSendSize); -+ pp->ifMTU = opr_min(RX_MAX_PACKET_SIZE, rx_MyMaxSendSize); - - /* Diminish the packet size to one based on the MTU given by - * the interface. */ -@@ -444,14 +445,14 @@ rxi_InitPeerParams(struct rx_peer *pp) - #endif /* AFS_SUN5_ENV */ - pp->ifMTU = rxi_AdjustIfMTU(pp->ifMTU); - pp->maxMTU = OLD_MAX_PACKET_SIZE; /* for compatibility with old guys */ -- pp->natMTU = MIN(pp->ifMTU, OLD_MAX_PACKET_SIZE); -+ pp->natMTU = opr_min(pp->ifMTU, OLD_MAX_PACKET_SIZE); - pp->ifDgramPackets = -- MIN(rxi_nDgramPackets, -+ opr_min(rxi_nDgramPackets, - rxi_AdjustDgramPackets(rxi_nSendFrags, pp->ifMTU)); - pp->maxDgramPackets = 1; - - /* Initialize slow start parameters */ -- pp->MTU = MIN(pp->natMTU, pp->maxMTU); -+ pp->MTU = opr_min(pp->natMTU, pp->maxMTU); - pp->cwind = 1; - pp->nDgramPackets = 1; - pp->congestSeq = 0; -@@ -520,15 +521,15 @@ rxi_GetcbiInfo(void) - maxmtu = rxi_AdjustMaxMTU(rxmtu, maxmtu); - addrs[i++] = ifinaddr; - if (!rx_IsLoopbackAddr(ifinaddr) && (maxmtu > rx_maxReceiveSize)) { -- rx_maxReceiveSize = MIN(RX_MAX_PACKET_SIZE, maxmtu); -- rx_maxReceiveSize = MIN(rx_maxReceiveSize, rx_maxReceiveSizeUser); -+ rx_maxReceiveSize = opr_min(RX_MAX_PACKET_SIZE, maxmtu); -+ rx_maxReceiveSize = opr_min(rx_maxReceiveSize, rx_maxReceiveSizeUser); - } - } - - rx_maxJumboRecvSize = - RX_HEADER_SIZE + (rxi_nDgramPackets * RX_JUMBOBUFFERSIZE) + - ((rxi_nDgramPackets - 1) * RX_JUMBOHEADERSIZE); -- rx_maxJumboRecvSize = MAX(rx_maxJumboRecvSize, rx_maxReceiveSize); -+ rx_maxJumboRecvSize = opr_max(rx_maxJumboRecvSize, rx_maxReceiveSize); - - if (different) { - for (j = 0; j < i; j++) { -@@ -648,9 +649,9 @@ rxi_GetIFInfo(void) - if (!rx_IsLoopbackAddr(ifinaddr) && - (maxmtu > rx_maxReceiveSize)) { - rx_maxReceiveSize = -- MIN(RX_MAX_PACKET_SIZE, maxmtu); -+ opr_min(RX_MAX_PACKET_SIZE, maxmtu); - rx_maxReceiveSize = -- MIN(rx_maxReceiveSize, rx_maxReceiveSizeUser); -+ opr_min(rx_maxReceiveSize, rx_maxReceiveSizeUser); - } - cnt++; - } -@@ -710,9 +711,9 @@ rxi_GetIFInfo(void) - maxmtu = rxi_AdjustMaxMTU(rxmtu, maxmtu); - addrs[i++] = ifinaddr; - if (!rx_IsLoopbackAddr(ifinaddr) && (maxmtu > rx_maxReceiveSize)) { -- rx_maxReceiveSize = MIN(RX_MAX_PACKET_SIZE, maxmtu); -+ rx_maxReceiveSize = opr_min(RX_MAX_PACKET_SIZE, maxmtu); - rx_maxReceiveSize = -- MIN(rx_maxReceiveSize, rx_maxReceiveSizeUser); -+ opr_min(rx_maxReceiveSize, rx_maxReceiveSizeUser); - } - } - } -@@ -725,7 +726,7 @@ rxi_GetIFInfo(void) - rx_maxJumboRecvSize = - RX_HEADER_SIZE + rxi_nDgramPackets * RX_JUMBOBUFFERSIZE + - (rxi_nDgramPackets - 1) * RX_JUMBOHEADERSIZE; -- rx_maxJumboRecvSize = MAX(rx_maxJumboRecvSize, rx_maxReceiveSize); -+ rx_maxJumboRecvSize = opr_max(rx_maxJumboRecvSize, rx_maxReceiveSize); - - if (different) { - int l; -@@ -1084,7 +1085,7 @@ afs_rxevent_daemon(void) - "before afs_osi_Wait()"); - # endif - # ifdef RXK_TIMEDSLEEP_ENV -- afs_osi_TimedSleep(&afs_termState, MAX(500, ((temp.sec * 1000) + -+ afs_osi_TimedSleep(&afs_termState, opr_max(500, ((temp.sec * 1000) + - (temp.usec / 1000))), 0); - # else - afs_osi_Wait(500, NULL, 0); -diff --git a/src/rx/rx_packet.c b/src/rx/rx_packet.c -index 2898da189..693d7c0d9 100644 ---- a/src/rx/rx_packet.c -+++ b/src/rx/rx_packet.c -@@ -43,7 +43,6 @@ - #else /* KERNEL */ - # include - # include --# include - # if defined(AFS_NT40_ENV) - # ifndef EWOULDBLOCK - # define EWOULDBLOCK WSAEWOULDBLOCK -@@ -58,6 +57,8 @@ - # include - #endif - -+ -+#include - #include - - #include "rx.h" -@@ -194,7 +195,7 @@ rx_SlowReadPacket(struct rx_packet * packet, unsigned int offset, int resid, - */ - r = resid; - while ((r > 0) && (i < packet->niovecs)) { -- j = MIN(r, packet->wirevec[i].iov_len - (offset - l)); -+ j = opr_min(r, packet->wirevec[i].iov_len - (offset - l)); - memcpy(out, (char *)(packet->wirevec[i].iov_base) + (offset - l), j); - r -= j; - out += j; -@@ -237,7 +238,7 @@ rx_SlowWritePacket(struct rx_packet * packet, int offset, int resid, char *in) - break; - - b = (char *)(packet->wirevec[i].iov_base) + (offset - l); -- j = MIN(r, packet->wirevec[i].iov_len - (offset - l)); -+ j = opr_min(r, packet->wirevec[i].iov_len - (offset - l)); - memcpy(b, in, j); - r -= j; - in += j; -@@ -277,7 +278,7 @@ AllocPacketBufs(int class, int num_pkts, struct opr_queue * q) - if (transfer > 0) { - NETPRI; - MUTEX_ENTER(&rx_freePktQ_lock); -- transfer = MAX(transfer, rx_TSFPQGlobSize); -+ transfer = opr_max(transfer, rx_TSFPQGlobSize); - if (transfer > rx_nFreePackets) { - /* alloc enough for us, plus a few globs for other threads */ - rxi_MorePacketsNoLock(transfer + 4 * rx_initSendWindow); -@@ -344,7 +345,7 @@ AllocPacketBufs(int class, int num_pkts, struct opr_queue * q) - } - #else /* KERNEL */ - if (rx_nFreePackets < num_pkts) { -- rxi_MorePacketsNoLock(MAX((num_pkts-rx_nFreePackets), 4 * rx_initSendWindow)); -+ rxi_MorePacketsNoLock(opr_max((num_pkts-rx_nFreePackets), 4 * rx_initSendWindow)); - } - #endif /* KERNEL */ - -@@ -826,7 +827,7 @@ rxi_AdjustLocalPacketsTSFPQ(int num_keep_local, int allow_overcommit) - if ((num_keep_local > rx_TSFPQLocalMax) && !allow_overcommit) - xfer = rx_TSFPQLocalMax - rx_ts_info->_FPQ.len; - if (rx_nFreePackets < xfer) { -- rxi_MorePacketsNoLock(MAX(xfer - rx_nFreePackets, 4 * rx_initSendWindow)); -+ rxi_MorePacketsNoLock(opr_max(xfer - rx_nFreePackets, 4 * rx_initSendWindow)); - } - RX_TS_FPQ_GTOL2(rx_ts_info, xfer); - } -@@ -922,7 +923,7 @@ rxi_FreeDataBufsToQueue(struct rx_packet *p, afs_uint32 first, struct opr_queue - struct rx_packet * cb; - int count = 0; - -- for (first = MAX(2, first); first < p->niovecs; first++, count++) { -+ for (first = opr_max(2, first); first < p->niovecs; first++, count++) { - iov = &p->wirevec[first]; - if (!iov->iov_base) - osi_Panic("rxi_FreeDataBufsToQueue: unexpected NULL iov"); -@@ -950,7 +951,7 @@ rxi_FreeDataBufsNoLock(struct rx_packet *p, afs_uint32 first) - { - struct iovec *iov; - -- for (first = MAX(2, first); first < p->niovecs; first++) { -+ for (first = opr_max(2, first); first < p->niovecs; first++) { - iov = &p->wirevec[first]; - if (!iov->iov_base) - osi_Panic("rxi_FreeDataBufsNoLock: unexpected NULL iov"); -@@ -985,7 +986,7 @@ rxi_FreeDataBufsTSFPQ(struct rx_packet *p, afs_uint32 first, int flush_global) - - RX_TS_INFO_GET(rx_ts_info); - -- for (first = MAX(2, first); first < p->niovecs; first++) { -+ for (first = opr_max(2, first); first < p->niovecs; first++) { - iov = &p->wirevec[first]; - if (!iov->iov_base) - osi_Panic("rxi_FreeDataBufsTSFPQ: unexpected NULL iov"); -@@ -1333,7 +1334,7 @@ rxi_AllocSendPacket(struct rx_call *call, int want) - #ifdef RX_ENABLE_TSFPQ - if ((p = rxi_AllocPacketTSFPQ(RX_PACKET_CLASS_SEND, 0))) { - want += delta; -- want = MIN(want, mud); -+ want = opr_min(want, mud); - - if ((unsigned)want > p->length) - (void)rxi_AllocDataBuf(p, (want - p->length), -@@ -1359,7 +1360,7 @@ rxi_AllocSendPacket(struct rx_call *call, int want) - MUTEX_EXIT(&rx_freePktQ_lock); - - want += delta; -- want = MIN(want, mud); -+ want = opr_min(want, mud); - - if ((unsigned)want > p->length) - (void)rxi_AllocDataBuf(p, (want - p->length), -@@ -1646,7 +1647,7 @@ cpytoc(mblk_t * mp, int off, int len, char *cp) - if (mp->b_datap->db_type != M_DATA) { - return -1; - } -- n = MIN(len, (mp->b_wptr - mp->b_rptr)); -+ n = opr_min(len, (mp->b_wptr - mp->b_rptr)); - memcpy(cp, (char *)mp->b_rptr, n); - cp += n; - len -= n; -@@ -1669,7 +1670,7 @@ cpytoiovec(mblk_t * mp, int off, int len, struct iovec *iovs, - if (mp->b_datap->db_type != M_DATA) { - return -1; - } -- n = MIN(len, (mp->b_wptr - mp->b_rptr)); -+ n = opr_min(len, (mp->b_wptr - mp->b_rptr)); - len -= n; - while (n) { - if (!t) { -@@ -1677,7 +1678,7 @@ cpytoiovec(mblk_t * mp, int off, int len, struct iovec *iovs, - i++; - t = iovs[i].iov_len; - } -- m = MIN(n, t); -+ m = opr_min(n, t); - memcpy(iovs[i].iov_base + o, (char *)mp->b_rptr, m); - mp->b_rptr += m; - o += m; -@@ -1719,7 +1720,7 @@ m_cpytoiovec(struct mbuf *m, int off, int len, struct iovec iovs[], int niovs) - l2 = iovs[0].iov_len; - - while (len) { -- t = MIN(l1, MIN(l2, (unsigned int)len)); -+ t = opr_min(l1, opr_min(l2, (unsigned int)len)); - memcpy(p2, p1, t); - p1 += t; - p2 += t; -@@ -2860,7 +2861,7 @@ int - rxi_AdjustMaxMTU(int mtu, int peerMaxMTU) - { - int maxMTU = mtu * rxi_nSendFrags; -- maxMTU = MIN(maxMTU, peerMaxMTU); -+ maxMTU = opr_min(maxMTU, peerMaxMTU); - return rxi_AdjustIfMTU(maxMTU); - } - -@@ -2876,7 +2877,7 @@ rxi_AdjustDgramPackets(int frags, int mtu) - return 1; - } - maxMTU = (frags * (mtu + UDP_HDR_SIZE)) - UDP_HDR_SIZE; -- maxMTU = MIN(maxMTU, RX_MAX_PACKET_SIZE); -+ maxMTU = opr_min(maxMTU, RX_MAX_PACKET_SIZE); - /* subtract the size of the first and last packets */ - maxMTU -= RX_HEADER_SIZE + (2 * RX_JUMBOBUFFERSIZE) + RX_JUMBOHEADERSIZE; - if (maxMTU < 0) { -diff --git a/src/rx/rx_packet.h b/src/rx/rx_packet.h -index 46c07895d..11bf55000 100644 ---- a/src/rx/rx_packet.h -+++ b/src/rx/rx_packet.h -@@ -316,7 +316,7 @@ struct rx_packet { - /* return what the actual contiguous space is: should be min(length,size) */ - /* The things that call this really want something like ...pullup MTUXXX */ - #define rx_Contiguous(p) \ -- MIN((unsigned) (p)->length, (unsigned) ((p)->wirevec[1].iov_len)) -+ opr_min((unsigned) (p)->length, (unsigned) ((p)->wirevec[1].iov_len)) - - #ifndef TRUE - #define TRUE 1 -diff --git a/src/rx/rx_rdwr.c b/src/rx/rx_rdwr.c -index ee1c3e3d4..2bc75cb49 100644 ---- a/src/rx/rx_rdwr.c -+++ b/src/rx/rx_rdwr.c -@@ -50,9 +50,9 @@ - # include "afs/lock.h" - #else /* KERNEL */ - # include --# include - #endif /* KERNEL */ - -+#include - #include "rx.h" - #include "rx_clock.h" - #include "rx_globals.h" -@@ -252,8 +252,8 @@ rxi_ReadProc(struct rx_call *call, char *buf, - * the final portion of a received packet, it's almost certain that - * call->app.nLeft will be smaller than the final buffer. */ - while (nbytes && call->app.currentPacket) { -- t = MIN((int)call->app.curlen, nbytes); -- t = MIN(t, (int)call->app.nLeft); -+ t = opr_min((int)call->app.curlen, nbytes); -+ t = opr_min(t, (int)call->app.nLeft); - memcpy(buf, call->app.curpos, t); - buf += t; - nbytes -= t; -@@ -428,8 +428,8 @@ rxi_FillReadVec(struct rx_call *call, afs_uint32 serial) - && call->iovNext < call->iovMax - && call->app.currentPacket) { - -- t = MIN((int)call->app.curlen, call->iovNBytes); -- t = MIN(t, (int)call->app.nLeft); -+ t = opr_min((int)call->app.curlen, call->iovNBytes); -+ t = opr_min(t, (int)call->app.nLeft); - call_iov->iov_base = call->app.curpos; - call_iov->iov_len = t; - call_iov++; -@@ -724,7 +724,7 @@ rxi_WriteProc(struct rx_call *call, char *buf, - mud = rx_MaxUserDataSize(call); - if (mud > len) { - int want; -- want = MIN(nbytes - (int)call->app.nFree, mud - len); -+ want = opr_min(nbytes - (int)call->app.nFree, mud - len); - rxi_AllocDataBuf(call->app.currentPacket, want, - RX_PACKET_CLASS_SEND_CBUF); - if (call->app.currentPacket->length > (unsigned)mud) -@@ -743,8 +743,8 @@ rxi_WriteProc(struct rx_call *call, char *buf, - - while (nbytes && call->app.nFree) { - -- t = MIN((int)call->app.curlen, nbytes); -- t = MIN((int)call->app.nFree, t); -+ t = opr_min((int)call->app.curlen, nbytes); -+ t = opr_min((int)call->app.nFree, t); - memcpy(call->app.curpos, buf, t); - buf += t; - nbytes -= t; -@@ -952,7 +952,7 @@ rxi_WritevAlloc(struct rx_call *call, struct iovec *iov, int *nio, int maxio, - mud = rx_MaxUserDataSize(call); - if (mud > len) { - int want; -- want = MIN(nbytes - tnFree, mud - len); -+ want = opr_min(nbytes - tnFree, mud - len); - rxi_AllocDataBuf(cp, want, RX_PACKET_CLASS_SEND_CBUF); - if (cp->length > (unsigned)mud) - cp->length = mud; -@@ -964,8 +964,8 @@ rxi_WritevAlloc(struct rx_call *call, struct iovec *iov, int *nio, int maxio, - } - - /* fill in the next entry in the iovec */ -- t = MIN(tcurlen, nbytes); -- t = MIN(tnFree, t); -+ t = opr_min(tcurlen, nbytes); -+ t = opr_min(tnFree, t); - iov[nextio].iov_base = tcurpos; - iov[nextio].iov_len = t; - nbytes -= t; -diff --git a/src/rx/rx_user.c b/src/rx/rx_user.c -index 15695265e..1effe0a19 100644 ---- a/src/rx/rx_user.c -+++ b/src/rx/rx_user.c -@@ -404,12 +404,12 @@ rx_GetIFInfo(void) - rxi_nRecvFrags * rxsize + (rxi_nRecvFrags - 1) * UDP_HDR_SIZE; - maxsize = rxi_AdjustMaxMTU(rxsize, maxsize); - if (rx_maxReceiveSize > maxsize) { -- rx_maxReceiveSize = MIN(RX_MAX_PACKET_SIZE, maxsize); -+ rx_maxReceiveSize = opr_min(RX_MAX_PACKET_SIZE, maxsize); - rx_maxReceiveSize = -- MIN(rx_maxReceiveSize, rx_maxReceiveSizeUser); -+ opr_min(rx_maxReceiveSize, rx_maxReceiveSizeUser); - } - if (rx_MyMaxSendSize > maxsize) { -- rx_MyMaxSendSize = MIN(RX_MAX_PACKET_SIZE, maxsize); -+ rx_MyMaxSendSize = opr_min(RX_MAX_PACKET_SIZE, maxsize); - } - } - UNLOCK_IF; -@@ -517,10 +517,10 @@ rx_GetIFInfo(void) - - LOCK_IF; - #ifdef AFS_AIX41_ENV --#define size(p) MAX((p).sa_len, sizeof(p)) -+#define size(p) opr_max((p).sa_len, sizeof(p)) - cplim = buf + ifc.ifc_len; /*skip over if's with big ifr_addr's */ - for (cp = buf; cp < cplim; -- cp += sizeof(ifr->ifr_name) + MAX(a->sin_len, sizeof(*a))) { -+ cp += sizeof(ifr->ifr_name) + opr_max(a->sin_len, sizeof(*a))) { - if (rxi_numNetAddrs >= ADDRSPERSITE) - break; - -@@ -642,7 +642,7 @@ rx_GetIFInfo(void) - rxi_nRecvFrags * (myNetMTUs[rxi_numNetAddrs] - RX_IP_SIZE); - maxsize -= UDP_HDR_SIZE; /* only the first frag has a UDP hdr */ - if (rx_maxReceiveSize < maxsize) -- rx_maxReceiveSize = MIN(RX_MAX_PACKET_SIZE, maxsize); -+ rx_maxReceiveSize = opr_min(RX_MAX_PACKET_SIZE, maxsize); - ++rxi_numNetAddrs; - } - } -@@ -658,7 +658,7 @@ rx_GetIFInfo(void) - rx_maxJumboRecvSize = - RX_HEADER_SIZE + rxi_nDgramPackets * RX_JUMBOBUFFERSIZE + - (rxi_nDgramPackets - 1) * RX_JUMBOHEADERSIZE; -- rx_maxJumboRecvSize = MAX(rx_maxJumboRecvSize, rx_maxReceiveSize); -+ rx_maxJumboRecvSize = opr_max(rx_maxJumboRecvSize, rx_maxReceiveSize); - ncbufs = (rx_maxJumboRecvSize - RX_FIRSTBUFFERSIZE); - if (ncbufs > 0) { - ncbufs = ncbufs / RX_CBUFFERSIZE; -@@ -721,13 +721,13 @@ rxi_InitPeerParams(struct rx_peer *pp) - if (rxmtu < RX_MIN_PACKET_SIZE) - rxmtu = RX_MIN_PACKET_SIZE; - if (pp->ifMTU < rxmtu) -- pp->ifMTU = MIN(rx_MyMaxSendSize, rxmtu); -+ pp->ifMTU = opr_min(rx_MyMaxSendSize, rxmtu); - } - } - UNLOCK_IF; - if (!pp->ifMTU) { /* not local */ - rx_rto_setPeerTimeoutSecs(pp, 3); -- pp->ifMTU = MIN(rx_MyMaxSendSize, RX_REMOTE_PACKET_SIZE); -+ pp->ifMTU = opr_min(rx_MyMaxSendSize, RX_REMOTE_PACKET_SIZE); - } - #ifdef AFS_ADAPT_PMTU - sock=socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP); -@@ -740,7 +740,7 @@ rxi_InitPeerParams(struct rx_peer *pp) - int mtu=0; - socklen_t s = sizeof(mtu); - if (getsockopt(sock, SOL_IP, IP_MTU, &mtu, &s)== 0) { -- pp->ifMTU = MIN(mtu - RX_IPUDP_SIZE, pp->ifMTU); -+ pp->ifMTU = opr_min(mtu - RX_IPUDP_SIZE, pp->ifMTU); - } - } - # ifdef AFS_NT40_ENV -@@ -752,16 +752,16 @@ rxi_InitPeerParams(struct rx_peer *pp) - #endif - pp->ifMTU = rxi_AdjustIfMTU(pp->ifMTU); - pp->maxMTU = OLD_MAX_PACKET_SIZE; /* for compatibility with old guys */ -- pp->natMTU = MIN((int)pp->ifMTU, OLD_MAX_PACKET_SIZE); -+ pp->natMTU = opr_min((int)pp->ifMTU, OLD_MAX_PACKET_SIZE); - pp->maxDgramPackets = -- MIN(rxi_nDgramPackets, -+ opr_min(rxi_nDgramPackets, - rxi_AdjustDgramPackets(rxi_nSendFrags, pp->ifMTU)); - pp->ifDgramPackets = -- MIN(rxi_nDgramPackets, -+ opr_min(rxi_nDgramPackets, - rxi_AdjustDgramPackets(rxi_nSendFrags, pp->ifMTU)); - pp->maxDgramPackets = 1; - /* Initialize slow start parameters */ -- pp->MTU = MIN(pp->natMTU, pp->maxMTU); -+ pp->MTU = opr_min(pp->natMTU, pp->maxMTU); - pp->cwind = 1; - pp->nDgramPackets = 1; - pp->congestSeq = 0; -diff --git a/src/rxkad/crypt_conn.c b/src/rxkad/crypt_conn.c -index da708bcd7..10ba5d84c 100644 ---- a/src/rxkad/crypt_conn.c -+++ b/src/rxkad/crypt_conn.c -@@ -27,9 +27,9 @@ - #endif /* !UKERNEL */ - #else /* !KERNEL */ - #include --#include - #endif /* KERNEL */ - -+#include - #include - #include - #include -@@ -58,7 +58,7 @@ rxkad_DecryptPacket(const struct rx_connection *conn, - data = rx_data(packet, i, tlen); - if (!data || !tlen) - break; -- tlen = MIN(len, tlen); -+ tlen = opr_min(len, tlen); - fc_cbc_encrypt(data, data, tlen, *schedule, xor, DECRYPT); - len -= tlen; - } -@@ -99,7 +99,7 @@ rxkad_EncryptPacket(const struct rx_connection * conn, - data = rx_data(packet, i, tlen); - if (!data || !tlen) - break; -- tlen = MIN(len, tlen); -+ tlen = opr_min(len, tlen); - fc_cbc_encrypt(data, data, tlen, *schedule, xor, ENCRYPT); - len -= tlen; - } -diff --git a/src/rxkad/rxkad_client.c b/src/rxkad/rxkad_client.c -index 630488374..1f760b8c0 100644 ---- a/src/rxkad/rxkad_client.c -+++ b/src/rxkad/rxkad_client.c -@@ -33,10 +33,9 @@ - #endif /* !UKERNEL */ - #else /* ! KERNEL */ - #include --#include - #endif /* KERNEL */ - -- -+#include - #include - #include - #include --- -2.46.1 - diff --git a/openafs-modules/0003-Remove-MIN-and-MAX-macro-definitions.patch b/openafs-modules/0003-Remove-MIN-and-MAX-macro-definitions.patch deleted file mode 100644 index 2c9b37f..0000000 --- a/openafs-modules/0003-Remove-MIN-and-MAX-macro-definitions.patch +++ /dev/null @@ -1,885 +0,0 @@ -From 083e4c44085309665b66e9330aa0c4d30237e750 Mon Sep 17 00:00:00 2001 -From: Cheyenne Wills -Date: Tue, 13 Aug 2024 14:29:10 -0600 -Subject: [PATCH 3/4] Remove MIN and MAX macro definitions - -A prior commit: - "opr: replace MIN/MAX macros with opr_min/opr_max" - (Change I2d7b54193ec91f7ead9c5c5f714d9a8bc7533bf7) -replaced all uses of the MIN and MAX macros with opr_min and opr_max. - -As a cleanup and to resolve a failure when building the Linux kernel -module with Linux 6.11, remove all the defines for MIN and MAX. - -The Linux 6.11 commit: - 'minmax: make generic MIN() and MAX() macros available everywhere' - (1a251f52cf) -standardized and consolidated the definitions of the MIN and MAX macros -within the Linux kernel by defining them in an include file that is -widely used already (linux/minmax.h). - -With the above Linux commit, the kernel module fails with a redefined -error from the compiler: - "./include/linux/minmax.h:329: error: "MIN" redefined [-Werror]" - -Reviewed-on: https://gerrit.openafs.org/15814 -Reviewed-by: Andrew Deason -Reviewed-by: Michael Meffie -Tested-by: BuildBot -(cherry picked from commit 8e8ee623d1a21dc8476cde4b6b9d9e292b36691d) - -Change-Id: I096c386682afbf7de07f7bb882ab9442cbdeb13a ---- - src/afs/NBSD/osi_machdep.h | 8 -------- - src/afs/UKERNEL/afs_usrops.c | 7 ------- - src/config/afsconfig-windows.h | 3 --- - src/config/param.generic_fbsd.h | 10 ---------- - src/config/param.i386_dfbsd_23.h | 10 ---------- - src/config/param.linux26.h | 10 ---------- - src/config/param.nbsd15.h | 10 ---------- - src/config/param.nbsd16.h | 10 ---------- - src/config/param.nbsd20.h | 10 ---------- - src/config/param.nbsd21.h | 10 ---------- - src/config/param.nbsd30.h | 10 ---------- - src/config/param.nbsd40.h | 10 ---------- - src/config/param.nbsd50.h | 10 ---------- - src/config/param.nbsd60.h | 10 ---------- - src/config/param.nbsd70.h | 10 ---------- - src/config/param.obsd31.h | 8 -------- - src/config/param.obsd32.h | 8 -------- - src/config/param.obsd33.h | 8 -------- - src/config/param.obsd34.h | 8 -------- - src/config/param.obsd35.h | 8 -------- - src/config/param.obsd36.h | 8 -------- - src/config/param.obsd37.h | 8 -------- - src/config/param.obsd38.h | 8 -------- - src/config/param.obsd39.h | 8 -------- - src/config/param.obsd40.h | 8 -------- - src/config/param.obsd41.h | 8 -------- - src/config/param.obsd42.h | 8 -------- - src/config/param.obsd43.h | 8 -------- - src/config/param.obsd44.h | 8 -------- - src/config/param.obsd45.h | 8 -------- - src/config/param.obsd46.h | 8 -------- - src/config/param.obsd47.h | 8 -------- - src/config/param.obsd48.h | 8 -------- - src/config/param.obsd49.h | 8 -------- - src/config/param.obsd50.h | 8 -------- - src/config/param.obsd51.h | 8 -------- - src/config/param.obsd52.h | 8 -------- - src/config/param.obsd53.h | 8 -------- - src/config/param.obsd54.h | 8 -------- - src/lwp/iomgr.c | 4 ---- - src/rx/rx_getaddr.c | 4 ---- - src/rx/rx_packet.h | 9 +-------- - 42 files changed, 1 insertion(+), 346 deletions(-) - -diff --git a/src/afs/NBSD/osi_machdep.h b/src/afs/NBSD/osi_machdep.h -index 43aa62101..c8fc4d1f8 100644 ---- a/src/afs/NBSD/osi_machdep.h -+++ b/src/afs/NBSD/osi_machdep.h -@@ -184,14 +184,6 @@ extern struct lock afs_global_lock; - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) && !defined(IGNORE_STDS_H) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ASSEMBLER */ - - /* vnodes */ -diff --git a/src/afs/UKERNEL/afs_usrops.c b/src/afs/UKERNEL/afs_usrops.c -index a6ca52a79..c29dca709 100644 ---- a/src/afs/UKERNEL/afs_usrops.c -+++ b/src/afs/UKERNEL/afs_usrops.c -@@ -47,13 +47,6 @@ - #define CELLINFOFILE "CellItems" - #define MAXIPADDRS 64 - --#ifndef MIN --#define MIN(A,B) ((A)<(B)?(A):(B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A)>(B)?(A):(B)) --#endif -- - extern int cacheDiskType; - - char afs_LclCellName[64]; -diff --git a/src/config/afsconfig-windows.h b/src/config/afsconfig-windows.h -index 9c2baa0d2..2b36a568c 100644 ---- a/src/config/afsconfig-windows.h -+++ b/src/config/afsconfig-windows.h -@@ -271,6 +271,3 @@ typedef int errno_t; - - /* Build afsroken.dll as a dynamic library */ - #define ROKEN_LIB_DYNAMIC 1 -- --#define MAX(a,b) (((a) > (b)) ? (a) : (b)) --#define MIN(a,b) (((a) < (b)) ? (a) : (b)) -diff --git a/src/config/param.generic_fbsd.h b/src/config/param.generic_fbsd.h -index e09158b95..e74e84ffb 100644 ---- a/src/config/param.generic_fbsd.h -+++ b/src/config/param.generic_fbsd.h -@@ -88,16 +88,6 @@ - - # if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --# ifdef KERNEL --# ifndef MIN --# define MIN(A,B) ((A) < (B) ? (A) : (B)) --# endif --# ifndef MAX --# define MAX(A,B) ((A) > (B) ? (A) : (B)) --# endif --# endif /* KERNEL */ -- - # endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.i386_dfbsd_23.h b/src/config/param.i386_dfbsd_23.h -index 46b5aaf4b..aad44f55d 100644 ---- a/src/config/param.i386_dfbsd_23.h -+++ b/src/config/param.i386_dfbsd_23.h -@@ -100,16 +100,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifdef KERNEL --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif --#endif /* KERNEL */ -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.linux26.h b/src/config/param.linux26.h -index 8fa1e3cb9..2e9ee6fbe 100644 ---- a/src/config/param.linux26.h -+++ b/src/config/param.linux26.h -@@ -40,16 +40,6 @@ - #define AFS_GLOBAL_SUNLOCK - #endif /* __KERNEL__ */ - --#ifdef KERNEL --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- --#endif /* KERNEL */ -- - #ifndef KERNEL - #define __USE_LARGEFILE64 1 - #if !defined off64_t -diff --git a/src/config/param.nbsd15.h b/src/config/param.nbsd15.h -index 771ace046..5c5a17d74 100644 ---- a/src/config/param.nbsd15.h -+++ b/src/config/param.nbsd15.h -@@ -88,16 +88,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifdef KERNEL --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif --#endif /* KERNEL */ -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.nbsd16.h b/src/config/param.nbsd16.h -index 1630fdf20..355a5a240 100644 ---- a/src/config/param.nbsd16.h -+++ b/src/config/param.nbsd16.h -@@ -89,16 +89,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifdef KERNEL --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif --#endif /* KERNEL */ -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.nbsd20.h b/src/config/param.nbsd20.h -index 140e97164..bc5ee09ac 100644 ---- a/src/config/param.nbsd20.h -+++ b/src/config/param.nbsd20.h -@@ -95,16 +95,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) && !defined(IGNORE_STDS_H) - enum vcexcl { NONEXCL, EXCL }; -- --#ifdef KERNEL --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif --#endif /* KERNEL */ -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ && !defined(IGNORE_STDS_H) */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.nbsd21.h b/src/config/param.nbsd21.h -index 9402be5bb..35155da11 100644 ---- a/src/config/param.nbsd21.h -+++ b/src/config/param.nbsd21.h -@@ -95,16 +95,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) && !defined(IGNORE_STDS_H) - enum vcexcl { NONEXCL, EXCL }; -- --#ifdef KERNEL --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif --#endif /* KERNEL */ -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ && !defined(IGNORE_STDS_H) */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.nbsd30.h b/src/config/param.nbsd30.h -index 96e4a7395..d8129d248 100644 ---- a/src/config/param.nbsd30.h -+++ b/src/config/param.nbsd30.h -@@ -91,16 +91,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) && !defined(IGNORE_STDS_H) - enum vcexcl { NONEXCL, EXCL }; -- --#ifdef KERNEL --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif --#endif /* KERNEL */ -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ && !defined(IGNORE_STDS_H) */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.nbsd40.h b/src/config/param.nbsd40.h -index 7e3a92101..6c22e252a 100644 ---- a/src/config/param.nbsd40.h -+++ b/src/config/param.nbsd40.h -@@ -97,16 +97,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) && !defined(IGNORE_STDS_H) - enum vcexcl { NONEXCL, EXCL }; -- --#ifdef KERNEL --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif --#endif /* KERNEL */ -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ && !defined(IGNORE_STDS_H) */ - #endif /* _KERNEL_DEPRECATED */ - -diff --git a/src/config/param.nbsd50.h b/src/config/param.nbsd50.h -index fcb2077ca..268d0f304 100644 ---- a/src/config/param.nbsd50.h -+++ b/src/config/param.nbsd50.h -@@ -94,16 +94,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) && !defined(IGNORE_STDS_H) - enum vcexcl { NONEXCL, EXCL }; -- --#ifdef KERNEL --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif --#endif /* KERNEL */ -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ && !defined(IGNORE_STDS_H) */ - #endif /* _KERNEL_DEPRECATED */ - -diff --git a/src/config/param.nbsd60.h b/src/config/param.nbsd60.h -index dda79311e..6e08c4cae 100644 ---- a/src/config/param.nbsd60.h -+++ b/src/config/param.nbsd60.h -@@ -95,16 +95,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) && !defined(IGNORE_STDS_H) - enum vcexcl { NONEXCL, EXCL }; -- --#ifdef KERNEL --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif --#endif /* KERNEL */ -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ && !defined(IGNORE_STDS_H) */ - #endif /* _KERNEL_DEPRECATED */ - -diff --git a/src/config/param.nbsd70.h b/src/config/param.nbsd70.h -index bb7534fb3..4356226a6 100644 ---- a/src/config/param.nbsd70.h -+++ b/src/config/param.nbsd70.h -@@ -96,16 +96,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) && !defined(IGNORE_STDS_H) - enum vcexcl { NONEXCL, EXCL }; -- --#ifdef KERNEL --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif --#endif /* KERNEL */ -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ && !defined(IGNORE_STDS_H) */ - #endif /* _KERNEL_DEPRECATED */ - -diff --git a/src/config/param.obsd31.h b/src/config/param.obsd31.h -index edf9a73a4..f77cbcef7 100644 ---- a/src/config/param.obsd31.h -+++ b/src/config/param.obsd31.h -@@ -44,14 +44,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd32.h b/src/config/param.obsd32.h -index 3472178ef..26f19511d 100644 ---- a/src/config/param.obsd32.h -+++ b/src/config/param.obsd32.h -@@ -43,14 +43,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd33.h b/src/config/param.obsd33.h -index a82cb4302..0822cc3ea 100644 ---- a/src/config/param.obsd33.h -+++ b/src/config/param.obsd33.h -@@ -47,14 +47,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd34.h b/src/config/param.obsd34.h -index 62e606214..661a6f94d 100644 ---- a/src/config/param.obsd34.h -+++ b/src/config/param.obsd34.h -@@ -47,14 +47,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd35.h b/src/config/param.obsd35.h -index f03dce86d..43c9fe28d 100644 ---- a/src/config/param.obsd35.h -+++ b/src/config/param.obsd35.h -@@ -47,14 +47,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd36.h b/src/config/param.obsd36.h -index 0ee70960f..cc981888d 100644 ---- a/src/config/param.obsd36.h -+++ b/src/config/param.obsd36.h -@@ -49,14 +49,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd37.h b/src/config/param.obsd37.h -index fc26d85f1..032b054ed 100644 ---- a/src/config/param.obsd37.h -+++ b/src/config/param.obsd37.h -@@ -50,14 +50,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd38.h b/src/config/param.obsd38.h -index 6fa98fed6..5c33062c2 100644 ---- a/src/config/param.obsd38.h -+++ b/src/config/param.obsd38.h -@@ -51,14 +51,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd39.h b/src/config/param.obsd39.h -index 61626f94e..f4955de9d 100644 ---- a/src/config/param.obsd39.h -+++ b/src/config/param.obsd39.h -@@ -55,14 +55,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd40.h b/src/config/param.obsd40.h -index 23df49de3..f00a6b182 100644 ---- a/src/config/param.obsd40.h -+++ b/src/config/param.obsd40.h -@@ -51,14 +51,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd41.h b/src/config/param.obsd41.h -index e102260d6..d4a41e1f3 100644 ---- a/src/config/param.obsd41.h -+++ b/src/config/param.obsd41.h -@@ -54,14 +54,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd42.h b/src/config/param.obsd42.h -index b3f821bb9..c2c8ea678 100644 ---- a/src/config/param.obsd42.h -+++ b/src/config/param.obsd42.h -@@ -59,14 +59,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd43.h b/src/config/param.obsd43.h -index 6dd7baa7a..833458f7b 100644 ---- a/src/config/param.obsd43.h -+++ b/src/config/param.obsd43.h -@@ -60,14 +60,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd44.h b/src/config/param.obsd44.h -index 624795d38..89f396ccd 100644 ---- a/src/config/param.obsd44.h -+++ b/src/config/param.obsd44.h -@@ -61,14 +61,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd45.h b/src/config/param.obsd45.h -index aab537e7c..cbe786603 100644 ---- a/src/config/param.obsd45.h -+++ b/src/config/param.obsd45.h -@@ -61,14 +61,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd46.h b/src/config/param.obsd46.h -index ef123d7f7..d515f8576 100644 ---- a/src/config/param.obsd46.h -+++ b/src/config/param.obsd46.h -@@ -66,14 +66,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd47.h b/src/config/param.obsd47.h -index beabaa293..ffd56ca6b 100644 ---- a/src/config/param.obsd47.h -+++ b/src/config/param.obsd47.h -@@ -67,14 +67,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd48.h b/src/config/param.obsd48.h -index d87d53d28..7b6a8e7dd 100644 ---- a/src/config/param.obsd48.h -+++ b/src/config/param.obsd48.h -@@ -64,14 +64,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd49.h b/src/config/param.obsd49.h -index 28e383890..0cba5fbf9 100644 ---- a/src/config/param.obsd49.h -+++ b/src/config/param.obsd49.h -@@ -65,14 +65,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd50.h b/src/config/param.obsd50.h -index effaccdd1..5df568d97 100644 ---- a/src/config/param.obsd50.h -+++ b/src/config/param.obsd50.h -@@ -66,14 +66,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd51.h b/src/config/param.obsd51.h -index 49b5c3304..52fb2fa98 100644 ---- a/src/config/param.obsd51.h -+++ b/src/config/param.obsd51.h -@@ -67,14 +67,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd52.h b/src/config/param.obsd52.h -index 9cfa12c5a..0b2f43072 100644 ---- a/src/config/param.obsd52.h -+++ b/src/config/param.obsd52.h -@@ -68,14 +68,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd53.h b/src/config/param.obsd53.h -index d140dc066..a6c168863 100644 ---- a/src/config/param.obsd53.h -+++ b/src/config/param.obsd53.h -@@ -69,14 +69,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd54.h b/src/config/param.obsd54.h -index 797ca45a3..88277bbf8 100644 ---- a/src/config/param.obsd54.h -+++ b/src/config/param.obsd54.h -@@ -70,14 +70,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/lwp/iomgr.c b/src/lwp/iomgr.c -index 2c88b56a9..82b576fe2 100644 ---- a/src/lwp/iomgr.c -+++ b/src/lwp/iomgr.c -@@ -51,10 +51,6 @@ typedef unsigned char bool; - #define FALSE 0 - #define TRUE 1 - --#ifndef MIN --#define MIN(a,b) (((a)>(b)) ? (b) : (a)) --#endif -- - #ifndef NSIG - #define NSIG 8*sizeof(sigset_t) - #endif -diff --git a/src/rx/rx_getaddr.c b/src/rx/rx_getaddr.c -index c340aaf15..2420b0468 100644 ---- a/src/rx/rx_getaddr.c -+++ b/src/rx/rx_getaddr.c -@@ -106,10 +106,6 @@ rxi_getaddr(void) - - #if !defined(KERNEL) || defined(UKERNEL) - --#ifndef MAX --#define MAX(A,B) (((A)<(B)) ? (B) : (A)) --#endif -- - #ifdef UKERNEL - #undef ioctl - #endif /* UKERNEL */ -diff --git a/src/rx/rx_packet.h b/src/rx/rx_packet.h -index 11bf55000..48736d3f8 100644 ---- a/src/rx/rx_packet.h -+++ b/src/rx/rx_packet.h -@@ -32,14 +32,7 @@ - */ - - --#if defined(AFS_NT40_ENV) --# ifndef MIN --# define MIN(a,b) ((a)<(b)?(a):(b)) --# endif --# ifndef MAX --# define MAX(a,b) ((a)>(b)?(a):(b)) --# endif --#else /* AFS_NT40_ENV */ -+#if !defined(AFS_NT40_ENV) - # if !defined(AFS_DARWIN_ENV) && !defined(AFS_USR_DARWIN_ENV) \ - && !defined(AFS_XBSD_ENV) && !defined(AFS_USR_FBSD_ENV) \ - && !defined(AFS_USR_DFBSD_ENV) && !defined(AFS_LINUX_ENV) --- -2.46.1 - diff --git a/openafs-modules/0004-rx-Remove-includes-for-MIN-MAX-in-rx_packet.h.patch b/openafs-modules/0004-rx-Remove-includes-for-MIN-MAX-in-rx_packet.h.patch deleted file mode 100644 index 2512bc0..0000000 --- a/openafs-modules/0004-rx-Remove-includes-for-MIN-MAX-in-rx_packet.h.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 88151d1e26b68580c0c1ea23469b069334678b36 Mon Sep 17 00:00:00 2001 -From: Cheyenne Wills -Date: Thu, 15 Aug 2024 16:08:18 -0600 -Subject: [PATCH 4/4] rx: Remove includes for MIN/MAX in rx_packet.h - -The commit: - "opr: replace MIN/MAX macros with opr_min/opr_max" - (Change I2d7b54193ec91f7ead9c5c5f714d9a8bc7533bf7) -replaced all uses of the MIN and MAX macros with opr_min and opr_max. - -The include for sys/param.h and sys/sysmacros.h in rx_packet.h are no -longer needed for MIN/MAX. - -Remove the preprocessor conditionals and the includes for param.h and -sysmacros.h. - -Reviewed-on: https://gerrit.openafs.org/15823 -Reviewed-by: Andrew Deason -Reviewed-by: Michael Meffie -Tested-by: BuildBot -(cherry picked from commit d299dfbfe90482b26b5f5551eb5be1b8e76d6ac4) - -Change-Id: Ic1dec6f69bb8f9fd6eaffd0d893f0b2113193ae7 ---- - src/rx/rx_packet.h | 14 -------------- - 1 file changed, 14 deletions(-) - -diff --git a/src/rx/rx_packet.h b/src/rx/rx_packet.h -index 48736d3f8..173762af7 100644 ---- a/src/rx/rx_packet.h -+++ b/src/rx/rx_packet.h -@@ -31,20 +31,6 @@ - * and that the offsets are as well. - */ - -- --#if !defined(AFS_NT40_ENV) --# if !defined(AFS_DARWIN_ENV) && !defined(AFS_USR_DARWIN_ENV) \ -- && !defined(AFS_XBSD_ENV) && !defined(AFS_USR_FBSD_ENV) \ -- && !defined(AFS_USR_DFBSD_ENV) && !defined(AFS_LINUX_ENV) --# include /* MIN, MAX on most commercial UNIX */ --# endif --/* Linux 3.7 doesn't have sys/param.h in kernel space, and afs/param.h ensures -- * that MIN and MAX are available for kernel builds. */ --# if !(defined(AFS_LINUX_ENV) && defined(KERNEL)) --# include /* MIN, MAX elsewhere */ --# endif --#endif /* !AFS_NT40_ENV */ -- - #define IPv6_HDR_SIZE 40 /* IPv6 Header */ - #define IPv6_FRAG_HDR_SIZE 8 /* IPv6 Fragment Header */ - #define UDP_HDR_SIZE 8 /* UDP Header */ --- -2.46.1 - diff --git a/openafs-modules/PKGBUILD b/openafs-modules/PKGBUILD index f678a93..bdd3695 100644 --- a/openafs-modules/PKGBUILD +++ b/openafs-modules/PKGBUILD @@ -5,8 +5,8 @@ pkgname=openafs-modules _srcname=openafs -pkgver=1.8.12.1 -pkgrel=2 +pkgver=1.8.12.2 +pkgrel=1 pkgdesc="Kernel module for OpenAFS" arch=('i686' 'x86_64' 'armv7h') url="http://www.openafs.org" @@ -16,16 +16,8 @@ makedepends=('libelf' 'linux-headers' 'openafs>=1.8.12.1-2') conflicts=('openafs-features-libafs' 'openafs<1.6.6-2') options=(!emptydirs) install=openafs-modules.install -source=(http://openafs.org/dl/openafs/${pkgver}/${_srcname}-${pkgver}-src.tar.bz2 - 0001-rx-Define-symbolic-names-for-Rx-magic-numbers.patch - 0002-opr-replace-MIN-MAX-macros-with-opr_min-opr_max.patch - 0003-Remove-MIN-and-MAX-macro-definitions.patch - 0004-rx-Remove-includes-for-MIN-MAX-in-rx_packet.h.patch) -sha256sums=('dfe2f39bef9fb3d6791d602e725be7c34b885e4299018266ff9743cb401e594a' - '89858ec91fb7cef85f7996c2eeeeb087a7996ed5d902ae4e3ac668e086753b05' - '247fbe76610056123525b11511f4a426913c7ee61b59f88fdbc0871239af9a94' - '9b3cac93406f13b3c1ad41c424c43e4df2c997ba9af68e8b73caf3db7e4df42f' - 'a7c4eb9dec81628459783705ceee531b29a81c254298e84c89cdc99e6c77729e') +source=(http://openafs.org/dl/openafs/${pkgver}/${_srcname}-${pkgver}-src.tar.bz2) +sha256sums=('1164194cc6ffd75c063c420fb37344e844c1e2edc155529f815ba4c781f45cab') # Heuristic to determine version of installed kernel # You can modify this if the heuristic fails @@ -40,12 +32,6 @@ _extramodules="/usr/lib/modules/${_kernelver}/extramodules" prepare() { cd "${srcdir}/${_srcname}-${pkgver}" - # Patches for Linux 6.11 - patch -p1 < "$srcdir"/0001-rx-Define-symbolic-names-for-Rx-magic-numbers.patch - patch -p1 < "$srcdir"/0002-opr-replace-MIN-MAX-macros-with-opr_min-opr_max.patch - patch -p1 < "$srcdir"/0003-Remove-MIN-and-MAX-macro-definitions.patch - patch -p1 < "$srcdir"/0004-rx-Remove-includes-for-MIN-MAX-in-rx_packet.h.patch - # Only needed when changes to configure were made # ./regen.sh -q } diff --git a/openafs/.SRCINFO b/openafs/.SRCINFO index 5e120b1..b7bb209 100644 --- a/openafs/.SRCINFO +++ b/openafs/.SRCINFO @@ -1,7 +1,7 @@ pkgbase = openafs pkgdesc = Open source implementation of the AFS distributed file system - pkgver = 1.8.12.1 - pkgrel = 2 + pkgver = 1.8.12.2 + pkgrel = 1 url = http://www.openafs.org install = openafs.install arch = i686 @@ -18,21 +18,13 @@ pkgbase = openafs backup = etc/openafs/ThisCell backup = etc/openafs/cacheinfo backup = etc/openafs/CellServDB - source = http://openafs.org/dl/openafs/1.8.12.1/openafs-1.8.12.1-src.tar.bz2 - source = http://openafs.org/dl/openafs/1.8.12.1/openafs-1.8.12.1-doc.tar.bz2 + source = http://openafs.org/dl/openafs/1.8.12.2/openafs-1.8.12.2-src.tar.bz2 + source = http://openafs.org/dl/openafs/1.8.12.2/openafs-1.8.12.2-doc.tar.bz2 source = tmpfiles.d-openafs.conf source = 0001-Adjust-RedHat-config-and-service-files.patch - source = 0001-rx-Define-symbolic-names-for-Rx-magic-numbers.patch - source = 0002-opr-replace-MIN-MAX-macros-with-opr_min-opr_max.patch - source = 0003-Remove-MIN-and-MAX-macro-definitions.patch - source = 0004-rx-Remove-includes-for-MIN-MAX-in-rx_packet.h.patch - sha256sums = dfe2f39bef9fb3d6791d602e725be7c34b885e4299018266ff9743cb401e594a - sha256sums = 79808f059ab01d5f929bc75d057b129f8b2a375356fe5afd780a075f2b25c562 + sha256sums = 1164194cc6ffd75c063c420fb37344e844c1e2edc155529f815ba4c781f45cab + sha256sums = 4540194a1d67196966ecf6525653f56f23eaec739628b7971dd00da5faf28318 sha256sums = 18d7b0173bbffbdc212f4e58c5b3ce369adf868452aabc3485f2a6a2ddb35d68 sha256sums = c15539241045e96252d6af4901311f3c494eae42c64edaaa1dcd1c70ef118624 - sha256sums = 89858ec91fb7cef85f7996c2eeeeb087a7996ed5d902ae4e3ac668e086753b05 - sha256sums = 247fbe76610056123525b11511f4a426913c7ee61b59f88fdbc0871239af9a94 - sha256sums = 9b3cac93406f13b3c1ad41c424c43e4df2c997ba9af68e8b73caf3db7e4df42f - sha256sums = a7c4eb9dec81628459783705ceee531b29a81c254298e84c89cdc99e6c77729e pkgname = openafs diff --git a/openafs/0001-rx-Define-symbolic-names-for-Rx-magic-numbers.patch b/openafs/0001-rx-Define-symbolic-names-for-Rx-magic-numbers.patch deleted file mode 100644 index 69c6ff5..0000000 --- a/openafs/0001-rx-Define-symbolic-names-for-Rx-magic-numbers.patch +++ /dev/null @@ -1,121 +0,0 @@ -From 4b7b53c8d081a0c12a16e91dbe40cc73eba41a26 Mon Sep 17 00:00:00 2001 -From: Mark Vitale -Date: Fri, 7 May 2021 18:20:11 -0400 -Subject: [PATCH 1/4] rx: Define symbolic names for Rx magic numbers - -Since the original IBM code import, the magic number '6' has been used -to specify the number of consecutive lost keepalives (ping acks) that -indicate a dead connection. By implication, this also defines the -minimum number of seconds (at the minimum keeplive periodicity of 1 -second) before a connection may be considered dead. - -Define and use symbolic names for both uses of '6', and document their -relationship. Both have the same assigned value '6', but -RX_PINGS_LOST_BEFORE_DEAD is use as an ordinal count, while -RX_MINDEADTIME is expressed in units of seconds. - -The magic number '12' is used in a couple of places for the default -value of rx_connDeadTime. Give this constant a name -(RX_DEFAULT_DEAD_TIME) and use it. - -No functional change is incurred by this commit. - -Reviewed-on: https://gerrit.openafs.org/14621 -Reviewed-by: Benjamin Kaduk -Tested-by: Benjamin Kaduk -(cherry picked from commit b4a4a2ae9c9546482dd94c7a89793b1bfa1714cd) - -Change-Id: I87c2de0c1a14a9414a86e6fc0744139a120fbab9 ---- - src/rx/rx.c | 12 ++++++------ - src/rx/rx.h | 12 ++++++++++++ - src/rx/rx_globals.h | 2 +- - 3 files changed, 19 insertions(+), 7 deletions(-) - -diff --git a/src/rx/rx.c b/src/rx/rx.c -index d6c52c369..b3cc50c9b 100644 ---- a/src/rx/rx.c -+++ b/src/rx/rx.c -@@ -550,7 +550,7 @@ rx_InitHost(u_int host, u_int port) - #endif /* RX_ENABLE_LOCKS && KERNEL */ - - rxi_nCalls = 0; -- rx_connDeadTime = 12; -+ rx_connDeadTime = RX_DEFAULT_DEAD_TIME; - rx_tranquil = 0; /* reset flag */ - rxi_ResetStatistics(); - htable = osi_Alloc(rx_hashTableSize * sizeof(struct rx_connection *)); -@@ -1118,12 +1118,12 @@ rxi_CheckConnTimeouts(struct rx_connection *conn) - /* a connection's timeouts must have the relationship - * deadTime <= idleDeadTime <= hardDeadTime. Otherwise, for example, a - * total loss of network to a peer may cause an idle timeout instead of a -- * dead timeout, simply because the idle timeout gets hit first. Also set -- * a minimum deadTime of 6, just to ensure it doesn't get set too low. */ -+ * dead timeout, simply because the idle timeout gets hit first. Also -+ * enforce a minimum deadTime, just to ensure it doesn't get set too low. */ - /* this logic is slightly complicated by the fact that - * idleDeadTime/hardDeadTime may not be set at all, but it's not too bad. - */ -- conn->secondsUntilDead = MAX(conn->secondsUntilDead, 6); -+ conn->secondsUntilDead = MAX(conn->secondsUntilDead, RX_MINDEADTIME); - if (conn->idleDeadTime) { - conn->idleDeadTime = MAX(conn->idleDeadTime, conn->secondsUntilDead); - } -@@ -1143,7 +1143,7 @@ rx_SetConnDeadTime(struct rx_connection *conn, int seconds) - * keepalives to be dropped without timing out the connection. */ - conn->secondsUntilDead = seconds; - rxi_CheckConnTimeouts(conn); -- conn->secondsUntilPing = conn->secondsUntilDead / 6; -+ conn->secondsUntilPing = conn->secondsUntilDead / RX_PINGS_LOST_BEFORE_DEAD; - } - - void -@@ -6723,7 +6723,7 @@ rxi_ScheduleGrowMTUEvent(struct rx_call *call, int secs) - when = now; - if (!secs) { - if (call->conn->secondsUntilPing) -- secs = (6*call->conn->secondsUntilPing)-1; -+ secs = (RX_PINGS_LOST_BEFORE_DEAD * call->conn->secondsUntilPing)-1; - - if (call->conn->secondsUntilDead) - secs = MIN(secs, (call->conn->secondsUntilDead-1)); -diff --git a/src/rx/rx.h b/src/rx/rx.h -index ee1331e85..f9a387db6 100644 ---- a/src/rx/rx.h -+++ b/src/rx/rx.h -@@ -163,7 +163,19 @@ extern u_short rx_PortOf(struct rx_peer *peer); - - /* Configurable parameters */ - #define RX_IDLE_DEAD_TIME 60 /* default idle dead time */ -+#define RX_DEFAULT_DEAD_TIME 12 /* Default timeout for an unresponsive connection */ - #define RX_MAX_SERVICES 20 /* Maximum number of services that may be installed */ -+/* -+ * The number of consecutive keepalives (ping acks) that must be lost/missing -+ * before declaring an rx_call dead timeout (RX_CALL_DEAD). This number was -+ * chosen to be relatively small while allowing for "several" pings to be lost -+ * without triggering a timeout. (We are running on UDP after all). Since the -+ * miniumum non-zero secondsUntilPing is 1 second, this also determines the -+ * minimum rx dead time. -+ */ -+#define RX_PINGS_LOST_BEFORE_DEAD 6 -+#define RX_MINDEADTIME (RX_PINGS_LOST_BEFORE_DEAD * 1) -+ - #if defined(KERNEL) && defined(AFS_AIX51_ENV) && defined(__64__) - # define RX_DEFAULT_STACK_SIZE 24000 - #else -diff --git a/src/rx/rx_globals.h b/src/rx/rx_globals.h -index caf0d3bc9..558dc553b 100644 ---- a/src/rx/rx_globals.h -+++ b/src/rx/rx_globals.h -@@ -65,7 +65,7 @@ EXT int rx_extraPackets GLOBALSINIT(256); - EXT int rx_stackSize GLOBALSINIT(RX_DEFAULT_STACK_SIZE); - - /* Time until an unresponsive connection is declared dead */ --EXT int rx_connDeadTime GLOBALSINIT(12); -+EXT int rx_connDeadTime GLOBALSINIT(RX_DEFAULT_DEAD_TIME); - - /* Set rx default connection dead time; set on both services and connections at creation time */ - #ifdef AFS_NT40_ENV --- -2.46.1 - diff --git a/openafs/0002-opr-replace-MIN-MAX-macros-with-opr_min-opr_max.patch b/openafs/0002-opr-replace-MIN-MAX-macros-with-opr_min-opr_max.patch deleted file mode 100644 index 75d0765..0000000 --- a/openafs/0002-opr-replace-MIN-MAX-macros-with-opr_min-opr_max.patch +++ /dev/null @@ -1,1545 +0,0 @@ -From fc95bb974bf35e7a43d76b0ac7883671b550e01f Mon Sep 17 00:00:00 2001 -From: Cheyenne Wills -Date: Mon, 9 Sep 2024 13:15:47 -0600 -Subject: [PATCH 2/4] opr: replace MIN/MAX macros with opr_min/opr_max - -Introduce new macros, opr_min() and opr_max(), to avoid collisions with -existing MIN()/MAX() macros defined elsewhere. - -Within OpenAFS, the MIN/MAX macros are defined in the platform specific -param.h include file. This same file is where AFS_{platform}_ENV is -defined, which is used throughout the OpenAFS source to determine which -platform specific headers are to be used. This can lead to collisions -if platform provided headers define MIN or MAX. - -Introduce opr_min and opr_max, using the same definitions that have been -used for MIN and MAX. Put the definitions in opr.h, which is already -included in most of the code that uses the MIN or MAX macros. - -Replace all uses of MIN and MAX with opr_min and opr_max. - -Add or move the include for afs/opr.h as needed. - -Note, this commit does not replace the min()/max() macros. - -A later commit will remove the defines for MIN and MAX (which will -correct a Linux 6.11 build failure due to a collision). - -Reviewed-on: https://gerrit.openafs.org/15813 -Tested-by: BuildBot -Reviewed-by: Michael Meffie -Reviewed-by: Andrew Deason -(cherry picked from commit 915c5cff168344797e011ee81913d4026c0cea80) - -[Backport: Move opr.h include in src/rx/rx.c. The MIN/MAX macros are -still present in the deprecated afsweb component.] - -Change-Id: I05fa833e00f31f07af55cebeb00a996a280bdcef ---- - src/afs/AIX/osi_groups.c | 3 +- - src/afs/DARWIN/osi_groups.c | 3 +- - src/afs/DARWIN/osi_vnodeops.c | 3 +- - src/afs/FBSD/osi_groups.c | 3 +- - src/afs/HPUX/osi_groups.c | 3 +- - src/afs/HPUX/osi_vnodeops.c | 9 ++-- - src/afs/IRIX/osi_groups.c | 3 +- - src/afs/IRIX/osi_vnodeops.c | 13 ++--- - src/afs/NBSD/osi_groups.c | 3 +- - src/afs/NBSD/osi_vnodeops.c | 3 +- - src/afs/OBSD/osi_groups.c | 3 +- - src/afs/UKERNEL/afs_usrops.c | 3 +- - src/afs/VNOPS/afs_vnop_strategy.c | 3 +- - src/afs/VNOPS/afs_vnop_write.c | 3 +- - src/afs/afs_call.c | 5 +- - src/lwp/iomgr.c | 2 +- - src/opr/opr.h | 3 ++ - src/rx/AIX/rx_knet.c | 7 +-- - src/rx/DARWIN/rx_knet.c | 7 +-- - src/rx/FBSD/rx_knet.c | 7 +-- - src/rx/IRIX/rx_knet.c | 8 ++-- - src/rx/SOLARIS/rx_knet.c | 13 ++--- - src/rx/rx.c | 79 +++++++++++++++---------------- - src/rx/rx_getaddr.c | 8 ++-- - src/rx/rx_globals.h | 2 +- - src/rx/rx_kcommon.c | 37 ++++++++------- - src/rx/rx_packet.c | 35 +++++++------- - src/rx/rx_packet.h | 2 +- - src/rx/rx_rdwr.c | 22 ++++----- - src/rx/rx_user.c | 28 +++++------ - src/rxkad/crypt_conn.c | 6 +-- - src/rxkad/rxkad_client.c | 3 +- - 32 files changed, 178 insertions(+), 154 deletions(-) - -diff --git a/src/afs/AIX/osi_groups.c b/src/afs/AIX/osi_groups.c -index 2ef317f42..219dd6db7 100644 ---- a/src/afs/AIX/osi_groups.c -+++ b/src/afs/AIX/osi_groups.c -@@ -19,6 +19,7 @@ - - #include "afs/sysincludes.h" - #include "afsincludes.h" -+#include "afs/opr.h" - #include "afs/afs_stats.h" /* statistics */ - - -@@ -130,7 +131,7 @@ afs_getgroups(struct ucred *cred, int ngroups, gid_t * gidset) - gidset[0] = gidset[1] = 0; - AFS_STATCNT(afs_getgroups); - -- savengrps = ngrps = MIN(ngroups, cred->cr_ngrps); -+ savengrps = ngrps = opr_min(ngroups, cred->cr_ngrps); - gp = cred->cr_groups; - while (ngrps--) - *gidset++ = *gp++; -diff --git a/src/afs/DARWIN/osi_groups.c b/src/afs/DARWIN/osi_groups.c -index 11e65e378..5899c7287 100644 ---- a/src/afs/DARWIN/osi_groups.c -+++ b/src/afs/DARWIN/osi_groups.c -@@ -18,6 +18,7 @@ - #include "afs/param.h" - #include "afs/sysincludes.h" - #include "afsincludes.h" -+#include "afs/opr.h" - #include "afs/afs_stats.h" /* statistics */ - - /* We should be doing something better anyway */ -@@ -122,7 +123,7 @@ afs_getgroups(struct ucred *cred, int ngroups, gid_t * gidset) - gid_t *gp; - - AFS_STATCNT(afs_getgroups); -- savengrps = ngrps = MIN(ngroups, cred->cr_ngroups); -+ savengrps = ngrps = opr_min(ngroups, cred->cr_ngroups); - gp = cred->cr_groups; - while (ngrps--) - *gidset++ = *gp++; -diff --git a/src/afs/DARWIN/osi_vnodeops.c b/src/afs/DARWIN/osi_vnodeops.c -index b903cc7c4..a92ed5358 100644 ---- a/src/afs/DARWIN/osi_vnodeops.c -+++ b/src/afs/DARWIN/osi_vnodeops.c -@@ -8,6 +8,7 @@ - #include /* Standard vendor system headers */ - #include /* Afs-based standard headers */ - #include /* statistics */ -+#include - #include - #include - #include -@@ -2103,7 +2104,7 @@ afs_vop_cmap(ap) - * } */ *ap; - { - *ap->a_bpn = (daddr_t) (ap->a_foffset / DEV_BSIZE); -- *ap->a_run = MAX(ap->a_size, AFS_CHUNKSIZE(ap->a_foffset)); -+ *ap->a_run = opr_max(ap->a_size, AFS_CHUNKSIZE(ap->a_foffset)); - return 0; - } - #endif -diff --git a/src/afs/FBSD/osi_groups.c b/src/afs/FBSD/osi_groups.c -index 6326f6c90..2267550bf 100644 ---- a/src/afs/FBSD/osi_groups.c -+++ b/src/afs/FBSD/osi_groups.c -@@ -22,6 +22,7 @@ - - #include "afs/sysincludes.h" - #include "afsincludes.h" -+#include "afs/opr.h" - #include "afs/afs_stats.h" /* statistics */ - - static int -@@ -106,7 +107,7 @@ afs_getgroups(struct ucred *cred, int ngroups, gid_t * gidset) - gid_t *gp; - - AFS_STATCNT(afs_getgroups); -- savengrps = ngrps = MIN(ngroups, cred->cr_ngroups); -+ savengrps = ngrps = opr_min(ngroups, cred->cr_ngroups); - gp = cred->cr_groups; - while (ngrps--) - *gidset++ = *gp++; -diff --git a/src/afs/HPUX/osi_groups.c b/src/afs/HPUX/osi_groups.c -index 8d6d9dbd7..c3b024c23 100644 ---- a/src/afs/HPUX/osi_groups.c -+++ b/src/afs/HPUX/osi_groups.c -@@ -19,6 +19,7 @@ - - #include "afs/sysincludes.h" - #include "afsincludes.h" -+#include "afs/opr.h" - #include "afs/afs_stats.h" /* statistics */ - - static int -@@ -104,7 +105,7 @@ afs_getgroups(struct ucred *cred, int ngroups, gid_t * gidset) - if (gp[-1] != NOGROUP) - break; - } -- savengrps = ngrps = MIN(ngroups, gp - cred->cr_groups); -+ savengrps = ngrps = opr_min(ngroups, gp - cred->cr_groups); - for (gp = cred->cr_groups; ngrps--;) - *gidset++ = *gp++; - return savengrps; -diff --git a/src/afs/HPUX/osi_vnodeops.c b/src/afs/HPUX/osi_vnodeops.c -index b54bf1a25..711cae8e0 100644 ---- a/src/afs/HPUX/osi_vnodeops.c -+++ b/src/afs/HPUX/osi_vnodeops.c -@@ -15,6 +15,7 @@ - - #include "afs/sysincludes.h" /* Standard vendor system headers */ - #include "afsincludes.h" /* Afs-based standard headers */ -+#include "afs/opr.h" - #include "afs/afs_stats.h" /* statistics stuff */ - - #include -@@ -87,7 +88,7 @@ m_cpytoc(m, off, len, cp) - if (m == NULL) - return (len); - -- ml = MIN(len, m->m_len - off); -+ ml = opr_min(len, m->m_len - off); - memcpy(cp, mtod(m, caddr_t) + off, (u_int) ml); - cp += ml; - len -= ml; -@@ -720,8 +721,8 @@ afspgin_setup_io_ranges(vfspage_t * vm_info, pgcnt_t bpages, k_off_t isize, - - maxpage = startindex + (bpages - (startindex + file_offset) % bpages); - maxpage = vm_reset_maxpage(vm_info, maxpage); -- maxpage = MIN(maxpage, (pgcnt_t) btorp(isize) - file_offset); -- maxpage = MIN(maxpage, startindex + maxpagein); -+ maxpage = opr_min(maxpage, (pgcnt_t) btorp(isize) - file_offset); -+ maxpage = opr_min(maxpage, startindex + maxpagein); - multio_maxpage = maxpage = vm_maxpage(vm_info, maxpage); - - if (!maxpage) -@@ -753,7 +754,7 @@ afspgin_setup_io_ranges(vfspage_t * vm_info, pgcnt_t bpages, k_off_t isize, - maxpage = startindex + count; - VASSERT(maxpage <= startindex + maxpagein); - minpage = startindex - (startindex + file_offset) % bpages; -- minpage = MAX(minpage, maxpage - maxpagein); -+ minpage = opr_max(minpage, maxpage - maxpagein); - VASSERT(startindex >= VM_BASE_OFFSET(vm_info)); - minpage = vm_minpage(vm_info, minpage); - VASSERT(minpage <= startindex); -diff --git a/src/afs/IRIX/osi_groups.c b/src/afs/IRIX/osi_groups.c -index 208ddcde5..d3f8b3347 100644 ---- a/src/afs/IRIX/osi_groups.c -+++ b/src/afs/IRIX/osi_groups.c -@@ -21,6 +21,7 @@ - - #include "afs/sysincludes.h" - #include "afsincludes.h" -+#include "afs/opr.h" - #include "afs/afs_stats.h" /* statistics */ - - -@@ -229,7 +230,7 @@ afs_getgroups(struct ucred *cred, int ngroups, gid_t * gidset) - - gidset[0] = gidset[1] = 0; - AFS_STATCNT(afs_getgroups); -- savengrps = ngrps = MIN(ngroups, cred->cr_ngroups); -+ savengrps = ngrps = opr_min(ngroups, cred->cr_ngroups); - gp = cred->cr_groups; - while (ngrps--) - *gidset++ = *gp++; -diff --git a/src/afs/IRIX/osi_vnodeops.c b/src/afs/IRIX/osi_vnodeops.c -index 1d4a26cff..da0df46c4 100644 ---- a/src/afs/IRIX/osi_vnodeops.c -+++ b/src/afs/IRIX/osi_vnodeops.c -@@ -16,6 +16,7 @@ - - #include "afs/sysincludes.h" /* Standard vendor system headers */ - #include "afsincludes.h" /* Afs-based standard headers */ -+#include "afs/opr.h" - #include "afs/afs_stats.h" /* statistics */ - #include "sys/flock.h" - #include "afs/nfsclient.h" -@@ -408,7 +409,7 @@ afsrwvp(struct vcache *avc, struct uio *uio, enum uio_rw rw, - /* - * compute minimum of rest of block and rest of file - */ -- cnt = MIN(bsize - off, rem); -+ cnt = opr_min(bsize - off, rem); - osi_Assert((off + cnt) <= bsize); - bsize = ctob(btoc(off + cnt)); - len = BTOBBT(bsize); -@@ -417,7 +418,7 @@ afsrwvp(struct vcache *avc, struct uio *uio, enum uio_rw rw, - bmv[0].length = len; - bmv[0].bsize = bsize; - bmv[0].pboff = off; -- bmv[0].pbsize = MIN(cnt, uio->uio_resid); -+ bmv[0].pbsize = opr_min(cnt, uio->uio_resid); - bmv[0].eof = 0; - bmv[0].pbdev = vp->v_rdev; - bmv[0].pmp = uio->uio_pmp; -@@ -439,7 +440,7 @@ afsrwvp(struct vcache *avc, struct uio *uio, enum uio_rw rw, - bsize = AFSBSIZE; - bmv[1].bn = bmv[1].offset = bn + len; - osi_Assert((BBTOB(bn + len) % bsize) == 0); -- acnt = MIN(bsize, rem); -+ acnt = opr_min(bsize, rem); - bsize = ctob(btoc(acnt)); - len = BTOBBT(bsize); - nmaps = 2; -@@ -500,7 +501,7 @@ afsrwvp(struct vcache *avc, struct uio *uio, enum uio_rw rw, - } - counter++; - -- cnt = MIN(bsize - off, uio->uio_resid); -+ cnt = opr_min(bsize - off, uio->uio_resid); - bsize = ctob(btoc(off + cnt)); - len = BTOBBT(bsize); - bmv[0].bn = bn; -@@ -637,7 +638,7 @@ OSI_VC_DECL(avc); - if (rem <= 0) - cnt = 0; /* EOF */ - else -- cnt = MIN(bsize - off, rem); -+ cnt = opr_min(bsize - off, rem); - - /* - * It is benign to ignore *nbmv > 1, since it is only for requesting -@@ -650,7 +651,7 @@ OSI_VC_DECL(avc); - */ - osi_Assert((off + cnt) <= bsize); - bsize = ctob(btoc(off + cnt)); -- bmv->pbsize = MIN(cnt, count); -+ bmv->pbsize = opr_min(cnt, count); - bmv->eof = 0; - bmv->pmp = NULL; - bmv->pbdev = avc->v.v_rdev; -diff --git a/src/afs/NBSD/osi_groups.c b/src/afs/NBSD/osi_groups.c -index 78b80e70b..9ee543932 100644 ---- a/src/afs/NBSD/osi_groups.c -+++ b/src/afs/NBSD/osi_groups.c -@@ -21,6 +21,7 @@ - - #include "afs/sysincludes.h" - #include "afs/afsincludes.h" -+#include "afs/opr.h" - #include "afs/afs_stats.h" /* statistics */ - #include "sys/syscallargs.h" - -@@ -106,7 +107,7 @@ osi_getgroups(afs_ucred_t *cred, int ngroups, gid_t *gidset) - { - AFS_STATCNT(afs_getgroups); - -- ngroups = MIN(kauth_cred_ngroups(cred), ngroups); -+ ngroups = opr_min(kauth_cred_ngroups(cred), ngroups); - - kauth_cred_getgroups(cred, gidset, ngroups, UIO_SYSSPACE); - return ngroups; -diff --git a/src/afs/NBSD/osi_vnodeops.c b/src/afs/NBSD/osi_vnodeops.c -index 2dc0a9b0c..f6c604919 100644 ---- a/src/afs/NBSD/osi_vnodeops.c -+++ b/src/afs/NBSD/osi_vnodeops.c -@@ -100,6 +100,7 @@ NONINFRINGEMENT. - - #include "afs/sysincludes.h" /* Standard vendor system headers */ - #include "afs/afsincludes.h" /* Afs-based standard headers */ -+#include "afs/opr.h" - #include "afs/afs_stats.h" /* statistics */ - - #include -@@ -206,7 +207,7 @@ static void - afs_nbsd_gop_size(struct vnode *vp, off_t size, off_t *eobp, int flags) - { - -- *eobp = MAX(size, vp->v_size); -+ *eobp = opr_max(size, vp->v_size); - } - - static int -diff --git a/src/afs/OBSD/osi_groups.c b/src/afs/OBSD/osi_groups.c -index e26088f19..208e5a744 100644 ---- a/src/afs/OBSD/osi_groups.c -+++ b/src/afs/OBSD/osi_groups.c -@@ -21,6 +21,7 @@ - - #include "afs/sysincludes.h" - #include "afs/afsincludes.h" -+#include "afs/opr.h" - #include "afs/afs_stats.h" /* statistics */ - #include "sys/syscallargs.h" - -@@ -115,7 +116,7 @@ afs_getgroups(struct ucred *cred, int ngroups, gid_t * gidset) - gid_t *gp; - - AFS_STATCNT(afs_getgroups); -- savengrps = ngrps = MIN(ngroups, cred->cr_ngroups); -+ savengrps = ngrps = opr_min(ngroups, cred->cr_ngroups); - gp = cred->cr_groups; - while (ngrps--) - *gidset++ = *gp++; -diff --git a/src/afs/UKERNEL/afs_usrops.c b/src/afs/UKERNEL/afs_usrops.c -index 2d11b445a..a6ca52a79 100644 ---- a/src/afs/UKERNEL/afs_usrops.c -+++ b/src/afs/UKERNEL/afs_usrops.c -@@ -30,6 +30,7 @@ - #include "afs/afs_bypasscache.h" - #include "rx/rx_globals.h" - #include "afsd/afsd.h" -+#include "afs/opr.h" - - #define VFS 1 - #undef VIRTUE -@@ -276,7 +277,7 @@ usr_uiomove(char *kbuf, int n, int rw, struct usr_uio *uio) - */ - ptr = kbuf; - while (nio > 0 && n > 0) { -- len = MIN(n, iovp->iov_len); -+ len = opr_min(n, iovp->iov_len); - if (rw == UIO_READ) { - memcpy(iovp->iov_base, ptr, len); - } else { -diff --git a/src/afs/VNOPS/afs_vnop_strategy.c b/src/afs/VNOPS/afs_vnop_strategy.c -index c4296bb6f..4aeb87a4a 100644 ---- a/src/afs/VNOPS/afs_vnop_strategy.c -+++ b/src/afs/VNOPS/afs_vnop_strategy.c -@@ -24,6 +24,7 @@ - #include "afs/afs_cbqueue.h" - #include "afs/nfsclient.h" - #include "afs/afs_osidnlc.h" -+#include "afs/opr.h" - - - -@@ -177,7 +178,7 @@ int afs_ustrategy(struct buf *abp) - * XXX It this really right? Ideally we should always write block size multiple - * and not any arbitrary size, right? XXX - */ -- len = MIN(len, tvc->f.m.Length - dbtob(abp->b_blkno)); -+ len = opr_min(len, tvc->f.m.Length - dbtob(abp->b_blkno)); - #endif - tuio.afsio_resid = len; - #if defined(AFS_NBSD40_ENV) || defined(FBSD_STRUCT_BUF_NO_SAVEADDR) -diff --git a/src/afs/VNOPS/afs_vnop_write.c b/src/afs/VNOPS/afs_vnop_write.c -index 3479348e1..c206a0394 100644 ---- a/src/afs/VNOPS/afs_vnop_write.c -+++ b/src/afs/VNOPS/afs_vnop_write.c -@@ -26,6 +26,7 @@ - #include "afs/afs_cbqueue.h" - #include "afs/nfsclient.h" - #include "afs/afs_osidnlc.h" -+#include "afs/opr.h" - - - extern unsigned char *afs_indexFlags; -@@ -250,7 +251,7 @@ afs_write(struct vcache *avc, struct uio *auio, int aio, - */ - osi_Assert(filePos <= avc->f.m.Length); - diff = avc->f.m.Length - filePos; -- AFS_UIO_SETRESID(auio, MIN(totalLength, diff)); -+ AFS_UIO_SETRESID(auio, opr_min(totalLength, diff)); - totalLength = AFS_UIO_RESID(auio); - } - #else -diff --git a/src/afs/afs_call.c b/src/afs/afs_call.c -index 4ac63b187..45b3f55eb 100644 ---- a/src/afs/afs_call.c -+++ b/src/afs/afs_call.c -@@ -18,6 +18,7 @@ - #include "afsincludes.h" /* Afs-based standard headers */ - #include "afs/afs_stats.h" - #include "rx/rx_globals.h" -+#include "afs/opr.h" - #if !defined(UKERNEL) - # if defined(AFS_LINUX_ENV) - # include "osi_compat.h" -@@ -968,9 +969,9 @@ afs_syscall_call(long parm, long parm2, long parm3, - if (mvParam->reqtype == AFS_USPC_UMV) { - /* don't copy out random kernel memory */ - AFS_COPYOUT(param2, AFSKPTR(parm4), -- MIN(namebufsz, strlen((char *)param2)+1), code); -+ opr_min(namebufsz, strlen((char *)param2)+1), code); - AFS_COPYOUT(param1, AFSKPTR(parm3), -- MIN(namebufsz, strlen((char *)param1)+1), code); -+ opr_min(namebufsz, strlen((char *)param1)+1), code); - } - AFS_COPYOUT((caddr_t)mvParam, AFSKPTR(parm2), - sizeof(struct afs_uspc_param), code); -diff --git a/src/lwp/iomgr.c b/src/lwp/iomgr.c -index 1251d06ca..2c88b56a9 100644 ---- a/src/lwp/iomgr.c -+++ b/src/lwp/iomgr.c -@@ -601,7 +601,7 @@ static void SignalIO(int fds, fd_set *readfds, fd_set *writefds, - struct IoRequest *req; - PROCESS pid; - req = (struct IoRequest *) r -> BackPointer; -- nfds = MIN(fds, req->nfds); -+ nfds = opr_min(fds, req->nfds); - if (FDSetCmp(nfds, req->readfds, readfds) || - FDSetCmp(nfds, req->writefds, writefds) || - FDSetCmp(nfds, req->exceptfds, exceptfds)) { -diff --git a/src/opr/opr.h b/src/opr/opr.h -index aae17e3cb..6bb2dc8b7 100644 ---- a/src/opr/opr.h -+++ b/src/opr/opr.h -@@ -21,6 +21,9 @@ extern void opr_NTAbort(void); - # define opr_abort() abort() - #endif - -+#define opr_min(a, b) ((a) < (b) ? (a) : (b)) -+#define opr_max(a, b) ((a) > (b) ? (a) : (b)) -+ - extern void opr_AssertionFailed(const char *, int) AFS_NORETURN; - extern void opr_AssertFailU(const char *, const char *, int) AFS_NORETURN; - -diff --git a/src/rx/AIX/rx_knet.c b/src/rx/AIX/rx_knet.c -index 5f47ff631..740be552d 100644 ---- a/src/rx/AIX/rx_knet.c -+++ b/src/rx/AIX/rx_knet.c -@@ -9,6 +9,7 @@ - - #include - #include "afs/param.h" -+#include "afs/opr.h" - - - #ifdef AFS_AIX41_ENV -@@ -406,9 +407,9 @@ osi_NetSend(osi_socket asocket, struct sockaddr_in *addr, struct iovec *dvec, - } - /* now compute usable size */ - if (M_HASCL(m)) { -- len = MIN(m->m_ext.ext_size, asize); -+ len = opr_min(m->m_ext.ext_size, asize); - } else { -- len = MIN(mlen, asize); -+ len = opr_min(mlen, asize); - } - - tpa = mtod(m, caddr_t); -@@ -416,7 +417,7 @@ osi_NetSend(osi_socket asocket, struct sockaddr_in *addr, struct iovec *dvec, - mp = &m->m_next; - m->m_len = 0; - while (len) { -- rlen = MIN(len, tl); -+ rlen = opr_min(len, tl); - memcpy(tpa, tdata, rlen); - asize -= rlen; - len -= rlen; -diff --git a/src/rx/DARWIN/rx_knet.c b/src/rx/DARWIN/rx_knet.c -index 405e35312..99bba8dc9 100644 ---- a/src/rx/DARWIN/rx_knet.c -+++ b/src/rx/DARWIN/rx_knet.c -@@ -9,6 +9,7 @@ - - #include - #include "afs/param.h" -+#include "afs/opr.h" - - #ifdef AFS_SOCKPROXY_ENV - # include -@@ -716,7 +717,7 @@ rx_upcall_common(socket_t so, struct afs_pkt_hdr *pkt) - noffset = 0; - - for (i = 0; i < p->niovecs && resid > 0; i++) { -- sz = MIN(resid, p->wirevec[i].iov_len); -+ sz = opr_min(resid, p->wirevec[i].iov_len); - memcpy(p->wirevec[i].iov_base, payload, sz); - resid -= sz; - noffset += sz; -@@ -732,7 +733,7 @@ rx_upcall_common(socket_t so, struct afs_pkt_hdr *pkt) - noffset = 0; - resid = nbytes; - for (i=0;iniovecs && resid;i++) { -- sz=MIN(resid, p->wirevec[i].iov_len); -+ sz=opr_min(resid, p->wirevec[i].iov_len); - error = mbuf_copydata(m, offset, sz, p->wirevec[i].iov_base); - if (error) - break; -@@ -853,7 +854,7 @@ osi_NetReceive(osi_socket so, struct sockaddr_in *addr, struct iovec *dvec, - size_t offset=0,sz; - resid = *alength; - for (i=0;i - #include "afs/param.h" -+#include "afs/opr.h" - - - #include -@@ -446,18 +447,18 @@ osi_NetSend(osi_socket asocket, struct sockaddr_in *addr, struct iovec *dvec, - mlen = MCLBYTES; - - /* now compute usable size */ -- len = MIN(mlen, asize); -+ len = opr_min(mlen, asize); - /* Should I look at MAPPED_MBUFS??? */ - } else { - nopages: -- len = MIN(mlen, asize); -+ len = opr_min(mlen, asize); - } - m->m_len = 0; - *mp = m; /* XXXX */ - top->m_pkthdr.len += len; - tpa = mtod(m, caddr_t); - while (len) { -- rlen = MIN(len, tl); -+ rlen = opr_min(len, tl); - memcpy(tpa, tdata, rlen); - asize -= rlen; - len -= rlen; -diff --git a/src/rx/IRIX/rx_knet.c b/src/rx/IRIX/rx_knet.c -index 788c5e268..4fc1cbd17 100644 ---- a/src/rx/IRIX/rx_knet.c -+++ b/src/rx/IRIX/rx_knet.c -@@ -9,7 +9,7 @@ - - #include - #include "afs/param.h" -- -+#include "afs/opr.h" - - #include "rx/rx_kcommon.h" - #include "rx/rx_packet.h" -@@ -366,8 +366,8 @@ rxi_EnumGetIfInfo(struct hashbucket *h, caddr_t key, caddr_t arg1, - } - rxmtu = rxmtu * rxi_nRecvFrags + ((rxi_nRecvFrags - 1) * UDP_HDR_SIZE); - if (!rx_IsLoopbackAddr(ifinaddr) && (rxmtu > rx_maxReceiveSize)) { -- rx_maxReceiveSize = MIN(RX_MAX_PACKET_SIZE, rxmtu); -- rx_maxReceiveSize = MIN(rx_maxReceiveSize, rx_maxReceiveSizeUser); -+ rx_maxReceiveSize = opr_min(RX_MAX_PACKET_SIZE, rxmtu); -+ rx_maxReceiveSize = opr_min(rx_maxReceiveSize, rx_maxReceiveSizeUser); - } - - *(int *)arg2 = i + 1; -@@ -390,7 +390,7 @@ rxi_GetIFInfo() - rx_maxJumboRecvSize = - RX_HEADER_SIZE + rxi_nDgramPackets * RX_JUMBOBUFFERSIZE + - (rxi_nDgramPackets - 1) * RX_JUMBOHEADERSIZE; -- rx_maxJumboRecvSize = MAX(rx_maxJumboRecvSize, rx_maxReceiveSize); -+ rx_maxJumboRecvSize = opr_max(rx_maxJumboRecvSize, rx_maxReceiveSize); - - return different; - } -diff --git a/src/rx/SOLARIS/rx_knet.c b/src/rx/SOLARIS/rx_knet.c -index fe85e63b8..74339375f 100644 ---- a/src/rx/SOLARIS/rx_knet.c -+++ b/src/rx/SOLARIS/rx_knet.c -@@ -9,6 +9,7 @@ - - #include - #include "afs/param.h" -+#include "afs/opr.h" - - - #ifdef AFS_SUN5_ENV -@@ -121,9 +122,9 @@ rxi_GetIFInfo() - addrs[i] = ifinaddr; - - if (!rx_IsLoopbackAddr(ifinaddr) && maxmtu > rx_maxReceiveSize) { -- rx_maxReceiveSize = MIN(RX_MAX_PACKET_SIZE, maxmtu); -+ rx_maxReceiveSize = opr_min(RX_MAX_PACKET_SIZE, maxmtu); - rx_maxReceiveSize = -- MIN(rx_maxReceiveSize, rx_maxReceiveSizeUser); -+ opr_min(rx_maxReceiveSize, rx_maxReceiveSizeUser); - } - - } -@@ -133,7 +134,7 @@ rxi_GetIFInfo() - rx_maxJumboRecvSize = - RX_HEADER_SIZE + rxi_nDgramPackets * RX_JUMBOBUFFERSIZE + - (rxi_nDgramPackets - 1) * RX_JUMBOHEADERSIZE; -- rx_maxJumboRecvSize = MAX(rx_maxJumboRecvSize, rx_maxReceiveSize); -+ rx_maxJumboRecvSize = opr_max(rx_maxJumboRecvSize, rx_maxReceiveSize); - - if (different) { - int j; -@@ -180,9 +181,9 @@ rxi_GetIFInfo() - i++; - - if (!rx_IsLoopbackAddr(ifinaddr) && maxmtu > rx_maxReceiveSize) { -- rx_maxReceiveSize = MIN(RX_MAX_PACKET_SIZE, maxmtu); -+ rx_maxReceiveSize = opr_min(RX_MAX_PACKET_SIZE, maxmtu); - rx_maxReceiveSize = -- MIN(rx_maxReceiveSize, rx_maxReceiveSizeUser); -+ opr_min(rx_maxReceiveSize, rx_maxReceiveSizeUser); - } - } - } -@@ -190,7 +191,7 @@ rxi_GetIFInfo() - rx_maxJumboRecvSize = - RX_HEADER_SIZE + rxi_nDgramPackets * RX_JUMBOBUFFERSIZE + - (rxi_nDgramPackets - 1) * RX_JUMBOHEADERSIZE; -- rx_maxJumboRecvSize = MAX(rx_maxJumboRecvSize, rx_maxReceiveSize); -+ rx_maxJumboRecvSize = opr_max(rx_maxJumboRecvSize, rx_maxReceiveSize); - - if (different) { - int j; -diff --git a/src/rx/rx.c b/src/rx/rx.c -index b3cc50c9b..162d2297e 100644 ---- a/src/rx/rx.c -+++ b/src/rx/rx.c -@@ -67,11 +67,10 @@ extern afs_int32 afs_termState; - # include - # endif - --# include -- - # include "rx_user.h" - #endif /* KERNEL */ - -+#include - #include - #include - -@@ -1123,15 +1122,15 @@ rxi_CheckConnTimeouts(struct rx_connection *conn) - /* this logic is slightly complicated by the fact that - * idleDeadTime/hardDeadTime may not be set at all, but it's not too bad. - */ -- conn->secondsUntilDead = MAX(conn->secondsUntilDead, RX_MINDEADTIME); -+ conn->secondsUntilDead = opr_max(conn->secondsUntilDead, RX_MINDEADTIME); - if (conn->idleDeadTime) { -- conn->idleDeadTime = MAX(conn->idleDeadTime, conn->secondsUntilDead); -+ conn->idleDeadTime = opr_max(conn->idleDeadTime, conn->secondsUntilDead); - } - if (conn->hardDeadTime) { - if (conn->idleDeadTime) { -- conn->hardDeadTime = MAX(conn->idleDeadTime, conn->hardDeadTime); -+ conn->hardDeadTime = opr_max(conn->idleDeadTime, conn->hardDeadTime); - } else { -- conn->hardDeadTime = MAX(conn->secondsUntilDead, conn->hardDeadTime); -+ conn->hardDeadTime = opr_max(conn->secondsUntilDead, conn->hardDeadTime); - } - } - } -@@ -2898,11 +2897,11 @@ rxi_SetPeerMtu(struct rx_peer *peer, afs_uint32 host, afs_uint32 port, int mtu) - - MUTEX_ENTER(&peer->peer_lock); - /* We don't handle dropping below min, so don't */ -- mtu = MAX(mtu, RX_MIN_PACKET_SIZE); -- peer->ifMTU=MIN(mtu, peer->ifMTU); -+ mtu = opr_max(mtu, RX_MIN_PACKET_SIZE); -+ peer->ifMTU=opr_min(mtu, peer->ifMTU); - peer->natMTU = rxi_AdjustIfMTU(peer->ifMTU); - /* if we tweaked this down, need to tune our peer MTU too */ -- peer->MTU = MIN(peer->MTU, peer->natMTU); -+ peer->MTU = opr_min(peer->MTU, peer->natMTU); - /* if we discovered a sub-1500 mtu, degrade */ - if (peer->ifMTU < OLD_MAX_PACKET_SIZE) - peer->maxDgramPackets = 1; -@@ -4336,7 +4335,7 @@ rxi_ReceiveAckPacket(struct rx_call *call, struct rx_packet *np, - return np; /* truncated ack packet */ - - /* depends on ack packet struct */ -- nAcks = MIN((unsigned)nbytes, (unsigned)ap->nAcks); -+ nAcks = opr_min((unsigned)nbytes, (unsigned)ap->nAcks); - first = ntohl(ap->firstPacket); - prev = ntohl(ap->previousPacket); - serial = ntohl(ap->serial); -@@ -4566,7 +4565,7 @@ rxi_ReceiveAckPacket(struct rx_call *call, struct rx_packet *np, - tSize = RX_MAX_PACKET_SIZE; - if (tSize < RX_MIN_PACKET_SIZE) - tSize = RX_MIN_PACKET_SIZE; -- peer->natMTU = rxi_AdjustIfMTU(MIN(tSize, peer->ifMTU)); -+ peer->natMTU = rxi_AdjustIfMTU(opr_min(tSize, peer->ifMTU)); - - /* Get the maximum packet size to send to this peer */ - rx_packetread(np, rx_AckDataSize(ap->nAcks), (int)sizeof(afs_int32), -@@ -4576,7 +4575,7 @@ rxi_ReceiveAckPacket(struct rx_call *call, struct rx_packet *np, - tSize = RX_MAX_PACKET_SIZE; - if (tSize < RX_MIN_PACKET_SIZE) - tSize = RX_MIN_PACKET_SIZE; -- tSize = (afs_uint32) MIN(tSize, rx_MyMaxSendSize); -+ tSize = (afs_uint32) opr_min(tSize, rx_MyMaxSendSize); - tSize = rxi_AdjustMaxMTU(peer->natMTU, tSize); - - /* sanity check - peer might have restarted with different params. -@@ -4587,8 +4586,8 @@ rxi_ReceiveAckPacket(struct rx_call *call, struct rx_packet *np, - if (peer->maxMTU > tSize) /* possible cong., maxMTU decreased */ - peer->congestSeq++; - peer->maxMTU = tSize; -- peer->MTU = MIN(tSize, peer->MTU); -- call->MTU = MIN(call->MTU, tSize); -+ peer->MTU = opr_min(tSize, peer->MTU); -+ call->MTU = opr_min(call->MTU, tSize); - } - - if (np->length == rx_AckDataSize(ap->nAcks) + 3 * sizeof(afs_int32)) { -@@ -4603,7 +4602,7 @@ rxi_ReceiveAckPacket(struct rx_call *call, struct rx_packet *np, - tSize = rx_maxSendWindow; - if (tSize < call->twind) { /* smaller than our send */ - call->twind = tSize; /* window, we must send less... */ -- call->ssthresh = MIN(call->twind, call->ssthresh); -+ call->ssthresh = opr_min(call->twind, call->ssthresh); - call->conn->twind[call->channel] = call->twind; - } - -@@ -4632,7 +4631,7 @@ rxi_ReceiveAckPacket(struct rx_call *call, struct rx_packet *np, - if (tSize < call->twind) { - call->twind = tSize; - call->conn->twind[call->channel] = call->twind; -- call->ssthresh = MIN(call->twind, call->ssthresh); -+ call->ssthresh = opr_min(call->twind, call->ssthresh); - } else if (tSize > call->twind) { - call->twind = tSize; - call->conn->twind[call->channel] = call->twind; -@@ -4648,9 +4647,9 @@ rxi_ReceiveAckPacket(struct rx_call *call, struct rx_packet *np, - rx_AckDataSize(ap->nAcks) + 3 * (int)sizeof(afs_int32), - (int)sizeof(afs_int32), &tSize); - maxDgramPackets = (afs_uint32) ntohl(tSize); -- maxDgramPackets = MIN(maxDgramPackets, rxi_nDgramPackets); -+ maxDgramPackets = opr_min(maxDgramPackets, rxi_nDgramPackets); - maxDgramPackets = -- MIN(maxDgramPackets, (int)(peer->ifDgramPackets)); -+ opr_min(maxDgramPackets, (int)(peer->ifDgramPackets)); - if (maxDgramPackets > 1) { - peer->maxDgramPackets = maxDgramPackets; - call->MTU = RX_JUMBOBUFFERSIZE + RX_HEADER_SIZE; -@@ -4718,7 +4717,7 @@ rxi_ReceiveAckPacket(struct rx_call *call, struct rx_packet *np, - - if (call->flags & RX_CALL_FAST_RECOVER) { - if (newAckCount == 0) { -- call->cwind = MIN((int)(call->cwind + 1), rx_maxSendWindow); -+ call->cwind = opr_min((int)(call->cwind + 1), rx_maxSendWindow); - } else { - call->flags &= ~RX_CALL_FAST_RECOVER; - call->cwind = call->nextCwind; -@@ -4729,10 +4728,10 @@ rxi_ReceiveAckPacket(struct rx_call *call, struct rx_packet *np, - } else if (nNacked && call->nNacks >= (u_short) rx_nackThreshold) { - /* Three negative acks in a row trigger congestion recovery */ - call->flags |= RX_CALL_FAST_RECOVER; -- call->ssthresh = MAX(4, MIN((int)call->cwind, (int)call->twind)) >> 1; -+ call->ssthresh = opr_max(4, opr_min((int)call->cwind, (int)call->twind)) >> 1; - call->cwind = -- MIN((int)(call->ssthresh + rx_nackThreshold), rx_maxSendWindow); -- call->nDgramPackets = MAX(2, (int)call->nDgramPackets) >> 1; -+ opr_min((int)(call->ssthresh + rx_nackThreshold), rx_maxSendWindow); -+ call->nDgramPackets = opr_max(2, (int)call->nDgramPackets) >> 1; - call->nextCwind = call->ssthresh; - call->nAcks = 0; - call->nNacks = 0; -@@ -4767,13 +4766,13 @@ rxi_ReceiveAckPacket(struct rx_call *call, struct rx_packet *np, - * receive (linear growth). */ - if (call->cwind < call->ssthresh) { - call->cwind = -- MIN((int)call->ssthresh, (int)(call->cwind + newAckCount)); -+ opr_min((int)call->ssthresh, (int)(call->cwind + newAckCount)); - call->nCwindAcks = 0; - } else { - call->nCwindAcks += newAckCount; - if (call->nCwindAcks >= call->cwind) { - call->nCwindAcks = 0; -- call->cwind = MIN((int)(call->cwind + 1), rx_maxSendWindow); -+ call->cwind = opr_min((int)(call->cwind + 1), rx_maxSendWindow); - } - } - /* -@@ -4792,7 +4791,7 @@ rxi_ReceiveAckPacket(struct rx_call *call, struct rx_packet *np, - call->MTU = peer->ifMTU; - else { - call->MTU += peer->natMTU; -- call->MTU = MIN(call->MTU, peer->maxMTU); -+ call->MTU = opr_min(call->MTU, peer->maxMTU); - } - } - call->nAcks = 0; -@@ -5419,10 +5418,10 @@ rxi_ResetCall(struct rx_call *call, int newcall) - MUTEX_ENTER(&peer->peer_lock); - if (!newcall) { - if (call->congestSeq == peer->congestSeq) { -- peer->cwind = MAX(peer->cwind, call->cwind); -- peer->MTU = MAX(peer->MTU, call->MTU); -+ peer->cwind = opr_max(peer->cwind, call->cwind); -+ peer->MTU = opr_max(peer->MTU, call->MTU); - peer->nDgramPackets = -- MAX(peer->nDgramPackets, call->nDgramPackets); -+ opr_max(peer->nDgramPackets, call->nDgramPackets); - } - } else { - call->abortCode = 0; -@@ -5433,7 +5432,7 @@ rxi_ResetCall(struct rx_call *call, int newcall) - } else { - call->MTU = peer->MTU; - } -- call->cwind = MIN((int)peer->cwind, (int)peer->nDgramPackets); -+ call->cwind = opr_min((int)peer->cwind, (int)peer->nDgramPackets); - call->ssthresh = rx_maxSendWindow; - call->nDgramPackets = peer->nDgramPackets; - call->congestSeq = peer->congestSeq; -@@ -5441,7 +5440,7 @@ rxi_ResetCall(struct rx_call *call, int newcall) - call->rtt_dev = peer->rtt_dev; - clock_Zero(&call->rto); - clock_Addmsec(&call->rto, -- MAX(((call->rtt >> 3) + call->rtt_dev), rx_minPeerTimeout) + 200); -+ opr_max(((call->rtt >> 3) + call->rtt_dev), rx_minPeerTimeout) + 200); - MUTEX_EXIT(&peer->peer_lock); - - flags = call->flags; -@@ -5587,7 +5586,7 @@ rxi_SendAck(struct rx_call *call, - padbytes = call->conn->peer->maxMTU + 128; - - /* do always try a minimum size ping */ -- padbytes = MAX(padbytes, RX_MIN_PACKET_SIZE+RX_IPUDP_SIZE+4); -+ padbytes = opr_max(padbytes, RX_MIN_PACKET_SIZE+RX_IPUDP_SIZE+4); - - /* subtract the ack payload */ - padbytes -= (rx_AckDataSize(call->rwind) + 4 * sizeof(afs_int32)); -@@ -6133,9 +6132,9 @@ rxi_Resend(struct rxevent *event, void *arg0, void *arg1, int istack) - * and start again from the beginning */ - if (peer->maxDgramPackets >1) { - call->MTU = RX_JUMBOBUFFERSIZE + RX_HEADER_SIZE; -- call->MTU = MIN(peer->natMTU, peer->maxMTU); -+ call->MTU = opr_min(peer->natMTU, peer->maxMTU); - } -- call->ssthresh = MAX(4, MIN((int)call->cwind, (int)call->twind)) >> 1; -+ call->ssthresh = opr_max(4, opr_min((int)call->cwind, (int)call->twind)) >> 1; - call->nDgramPackets = 1; - call->cwind = 1; - call->nextCwind = 1; -@@ -6205,7 +6204,7 @@ rxi_Start(struct rx_call *call, int istack) - call->flags &= ~RX_CALL_NEED_START; - #endif /* RX_ENABLE_LOCKS */ - nXmitPackets = 0; -- maxXmitPackets = MIN(call->twind, call->cwind); -+ maxXmitPackets = opr_min(call->twind, call->cwind); - for (opr_queue_Scan(&call->tq, cursor)) { - struct rx_packet *p - = opr_queue_Entry(cursor, struct rx_packet, entry); -@@ -6222,7 +6221,7 @@ rxi_Start(struct rx_call *call, int istack) - p->header.flags &= RX_PRESET_FLAGS; - - if (p->header.seq >= -- call->tfirst + MIN((int)call->twind, -+ call->tfirst + opr_min((int)call->twind, - (int)(call->nSoftAcked + - call->cwind))) { - call->flags |= RX_CALL_WAIT_WINDOW_SEND; /* Wait for transmit window */ -@@ -6398,9 +6397,9 @@ rxi_CheckCall(struct rx_call *call, int haveCTLock) - if (now < call->lastSendTime) - clock_diff = call->lastSendTime - now; - if (now < call->startWait) -- clock_diff = MAX(clock_diff, call->startWait - now); -+ clock_diff = opr_max(clock_diff, call->startWait - now); - if (now < call->lastReceiveTime) -- clock_diff = MAX(clock_diff, call->lastReceiveTime - now); -+ clock_diff = opr_max(clock_diff, call->lastReceiveTime - now); - if (clock_diff > 5 * 60) - { - if (call->state == RX_STATE_ACTIVE) -@@ -6490,7 +6489,7 @@ mtuout: - * Shrink by 128 bytes and try again. */ - if (conn->peer->maxPacketSize < conn->lastPacketSize) - /* maxPacketSize will be cleared in rxi_SetPeerMtu */ -- newmtu = MAX(conn->peer->maxPacketSize + RX_HEADER_SIZE, -+ newmtu = opr_max(conn->peer->maxPacketSize + RX_HEADER_SIZE, - conn->lastPacketSize - 128 + RX_HEADER_SIZE); - else - newmtu = conn->lastPacketSize - 128 + RX_HEADER_SIZE; -@@ -6726,7 +6725,7 @@ rxi_ScheduleGrowMTUEvent(struct rx_call *call, int secs) - secs = (RX_PINGS_LOST_BEFORE_DEAD * call->conn->secondsUntilPing)-1; - - if (call->conn->secondsUntilDead) -- secs = MIN(secs, (call->conn->secondsUntilDead-1)); -+ secs = opr_min(secs, (call->conn->secondsUntilDead-1)); - } - - when.sec += secs; -@@ -7101,7 +7100,7 @@ rxi_ComputeRoundTripTime(struct rx_packet *p, - * add on a fixed 200ms to account for that timer expiring. - */ - -- rtt_timeout = MAX(((call->rtt >> 3) + call->rtt_dev), -+ rtt_timeout = opr_max(((call->rtt >> 3) + call->rtt_dev), - rx_minPeerTimeout) + 200; - clock_Zero(&call->rto); - clock_Addmsec(&call->rto, rtt_timeout); -diff --git a/src/rx/rx_getaddr.c b/src/rx/rx_getaddr.c -index 5bf7ed9c9..c340aaf15 100644 ---- a/src/rx/rx_getaddr.c -+++ b/src/rx/rx_getaddr.c -@@ -10,6 +10,8 @@ - #include - #include - -+#include "afs/opr.h" -+ - #ifndef KERNEL - - # include -@@ -409,7 +411,7 @@ rx_getAllAddr_internal(afs_uint32 buffer[], int maxSize, int loopbacks) - #ifdef AFS_AIX51_ENV - cp = cpnext - #else -- cp += sizeof(ifr->ifr_name) + MAX(a->sin_len, sizeof(*a)) -+ cp += sizeof(ifr->ifr_name) + opr_max(a->sin_len, sizeof(*a)) - #endif - #endif - ) -@@ -424,7 +426,7 @@ rx_getAllAddr_internal(afs_uint32 buffer[], int maxSize, int loopbacks) - #endif - a = (struct sockaddr_in *)&ifr->ifr_addr; - #ifdef AFS_AIX51_ENV -- cpnext = cp + sizeof(ifr->ifr_name) + MAX(a->sin_len, sizeof(*a)); -+ cpnext = cp + sizeof(ifr->ifr_name) + opr_max(a->sin_len, sizeof(*a)); - #endif - if (a->sin_family != AF_INET) - continue; -@@ -507,7 +509,7 @@ rx_getAllAddrMaskMtu(afs_uint32 addrBuffer[], afs_uint32 maskBuffer[], - ifc.ifc_len = sizeof(ifs); - for (cp = (char *)ifc.ifc_buf, cplim = ifc.ifc_buf + ifc.ifc_len; - cp < cplim; -- cp += sizeof(ifr->ifr_name) + MAX(a->sin_len, sizeof(*a))) { -+ cp += sizeof(ifr->ifr_name) + opr_max(a->sin_len, sizeof(*a))) { - ifr = (struct ifreq *)cp; - #else - for (i = 0; i < len; ++i) { -diff --git a/src/rx/rx_globals.h b/src/rx/rx_globals.h -index 558dc553b..5326af074 100644 ---- a/src/rx/rx_globals.h -+++ b/src/rx/rx_globals.h -@@ -295,7 +295,7 @@ EXT int rx_TSFPQMaxProcs GLOBALSINIT(0); /* max number of threads expected */ - do { \ - int i; \ - struct rx_packet * p; \ -- int tsize = MIN((rx_ts_info_p)->_FPQ.len, (rx_ts_info_p)->_FPQ.len - rx_TSFPQLocalMax + 3 * rx_TSFPQGlobSize); \ -+ int tsize = opr_min((rx_ts_info_p)->_FPQ.len, (rx_ts_info_p)->_FPQ.len - rx_TSFPQLocalMax + 3 * rx_TSFPQGlobSize); \ - if (tsize <= 0) break; \ - for (i=0,p=opr_queue_Last(&((rx_ts_info_p)->_FPQ.queue), \ - struct rx_packet, entry); \ -diff --git a/src/rx/rx_kcommon.c b/src/rx/rx_kcommon.c -index c90df3d36..f29bd56f0 100644 ---- a/src/rx/rx_kcommon.c -+++ b/src/rx/rx_kcommon.c -@@ -21,6 +21,7 @@ - #include "rx_internal.h" - #include "rx_stats.h" - #include "rx_peer.h" -+#include "afs/opr.h" - - #ifdef AFS_HPUX110_ENV - # include "h/tihdr.h" -@@ -372,10 +373,10 @@ rxi_InitPeerParams(struct rx_peer *pp) - i = rxi_Findcbi(pp->host); - if (i == -1) { - rx_rto_setPeerTimeoutSecs(pp, 3); -- pp->ifMTU = MIN(RX_REMOTE_PACKET_SIZE, rx_MyMaxSendSize); -+ pp->ifMTU = opr_min(RX_REMOTE_PACKET_SIZE, rx_MyMaxSendSize); - } else { - rx_rto_setPeerTimeoutSecs(pp, 2); -- pp->ifMTU = MIN(RX_MAX_PACKET_SIZE, rx_MyMaxSendSize); -+ pp->ifMTU = opr_min(RX_MAX_PACKET_SIZE, rx_MyMaxSendSize); - mtu = ntohl(afs_cb_interface.mtu[i]); - /* Diminish the packet size to one based on the MTU given by - * the interface. */ -@@ -398,7 +399,7 @@ rxi_InitPeerParams(struct rx_peer *pp) - ifn = rxi_FindIfnet(pp->host, NULL); - if (ifn) { - rx_rto_setPeerTimeoutSecs(pp, 2); -- pp->ifMTU = MIN(RX_MAX_PACKET_SIZE, rx_MyMaxSendSize); -+ pp->ifMTU = opr_min(RX_MAX_PACKET_SIZE, rx_MyMaxSendSize); - # ifdef IFF_POINTOPOINT - if (rx_ifnet_flags(ifn) & IFF_POINTOPOINT) { - /* wish we knew the bit rate and the chunk size, sigh. */ -@@ -415,7 +416,7 @@ rxi_InitPeerParams(struct rx_peer *pp) - } - } else { /* couldn't find the interface, so assume the worst */ - rx_rto_setPeerTimeoutSecs(pp, 3); -- pp->ifMTU = MIN(RX_REMOTE_PACKET_SIZE, rx_MyMaxSendSize); -+ pp->ifMTU = opr_min(RX_REMOTE_PACKET_SIZE, rx_MyMaxSendSize); - } - - RX_NET_EPOCH_EXIT(); -@@ -428,10 +429,10 @@ rxi_InitPeerParams(struct rx_peer *pp) - - if (mtu <= 0) { - rx_rto_setPeerTimeoutSecs(pp, 3); -- pp->ifMTU = MIN(RX_REMOTE_PACKET_SIZE, rx_MyMaxSendSize); -+ pp->ifMTU = opr_min(RX_REMOTE_PACKET_SIZE, rx_MyMaxSendSize); - } else { - rx_rto_setPeerTimeoutSecs(pp, 2); -- pp->ifMTU = MIN(RX_MAX_PACKET_SIZE, rx_MyMaxSendSize); -+ pp->ifMTU = opr_min(RX_MAX_PACKET_SIZE, rx_MyMaxSendSize); - - /* Diminish the packet size to one based on the MTU given by - * the interface. */ -@@ -444,14 +445,14 @@ rxi_InitPeerParams(struct rx_peer *pp) - #endif /* AFS_SUN5_ENV */ - pp->ifMTU = rxi_AdjustIfMTU(pp->ifMTU); - pp->maxMTU = OLD_MAX_PACKET_SIZE; /* for compatibility with old guys */ -- pp->natMTU = MIN(pp->ifMTU, OLD_MAX_PACKET_SIZE); -+ pp->natMTU = opr_min(pp->ifMTU, OLD_MAX_PACKET_SIZE); - pp->ifDgramPackets = -- MIN(rxi_nDgramPackets, -+ opr_min(rxi_nDgramPackets, - rxi_AdjustDgramPackets(rxi_nSendFrags, pp->ifMTU)); - pp->maxDgramPackets = 1; - - /* Initialize slow start parameters */ -- pp->MTU = MIN(pp->natMTU, pp->maxMTU); -+ pp->MTU = opr_min(pp->natMTU, pp->maxMTU); - pp->cwind = 1; - pp->nDgramPackets = 1; - pp->congestSeq = 0; -@@ -520,15 +521,15 @@ rxi_GetcbiInfo(void) - maxmtu = rxi_AdjustMaxMTU(rxmtu, maxmtu); - addrs[i++] = ifinaddr; - if (!rx_IsLoopbackAddr(ifinaddr) && (maxmtu > rx_maxReceiveSize)) { -- rx_maxReceiveSize = MIN(RX_MAX_PACKET_SIZE, maxmtu); -- rx_maxReceiveSize = MIN(rx_maxReceiveSize, rx_maxReceiveSizeUser); -+ rx_maxReceiveSize = opr_min(RX_MAX_PACKET_SIZE, maxmtu); -+ rx_maxReceiveSize = opr_min(rx_maxReceiveSize, rx_maxReceiveSizeUser); - } - } - - rx_maxJumboRecvSize = - RX_HEADER_SIZE + (rxi_nDgramPackets * RX_JUMBOBUFFERSIZE) + - ((rxi_nDgramPackets - 1) * RX_JUMBOHEADERSIZE); -- rx_maxJumboRecvSize = MAX(rx_maxJumboRecvSize, rx_maxReceiveSize); -+ rx_maxJumboRecvSize = opr_max(rx_maxJumboRecvSize, rx_maxReceiveSize); - - if (different) { - for (j = 0; j < i; j++) { -@@ -648,9 +649,9 @@ rxi_GetIFInfo(void) - if (!rx_IsLoopbackAddr(ifinaddr) && - (maxmtu > rx_maxReceiveSize)) { - rx_maxReceiveSize = -- MIN(RX_MAX_PACKET_SIZE, maxmtu); -+ opr_min(RX_MAX_PACKET_SIZE, maxmtu); - rx_maxReceiveSize = -- MIN(rx_maxReceiveSize, rx_maxReceiveSizeUser); -+ opr_min(rx_maxReceiveSize, rx_maxReceiveSizeUser); - } - cnt++; - } -@@ -710,9 +711,9 @@ rxi_GetIFInfo(void) - maxmtu = rxi_AdjustMaxMTU(rxmtu, maxmtu); - addrs[i++] = ifinaddr; - if (!rx_IsLoopbackAddr(ifinaddr) && (maxmtu > rx_maxReceiveSize)) { -- rx_maxReceiveSize = MIN(RX_MAX_PACKET_SIZE, maxmtu); -+ rx_maxReceiveSize = opr_min(RX_MAX_PACKET_SIZE, maxmtu); - rx_maxReceiveSize = -- MIN(rx_maxReceiveSize, rx_maxReceiveSizeUser); -+ opr_min(rx_maxReceiveSize, rx_maxReceiveSizeUser); - } - } - } -@@ -725,7 +726,7 @@ rxi_GetIFInfo(void) - rx_maxJumboRecvSize = - RX_HEADER_SIZE + rxi_nDgramPackets * RX_JUMBOBUFFERSIZE + - (rxi_nDgramPackets - 1) * RX_JUMBOHEADERSIZE; -- rx_maxJumboRecvSize = MAX(rx_maxJumboRecvSize, rx_maxReceiveSize); -+ rx_maxJumboRecvSize = opr_max(rx_maxJumboRecvSize, rx_maxReceiveSize); - - if (different) { - int l; -@@ -1084,7 +1085,7 @@ afs_rxevent_daemon(void) - "before afs_osi_Wait()"); - # endif - # ifdef RXK_TIMEDSLEEP_ENV -- afs_osi_TimedSleep(&afs_termState, MAX(500, ((temp.sec * 1000) + -+ afs_osi_TimedSleep(&afs_termState, opr_max(500, ((temp.sec * 1000) + - (temp.usec / 1000))), 0); - # else - afs_osi_Wait(500, NULL, 0); -diff --git a/src/rx/rx_packet.c b/src/rx/rx_packet.c -index 2898da189..693d7c0d9 100644 ---- a/src/rx/rx_packet.c -+++ b/src/rx/rx_packet.c -@@ -43,7 +43,6 @@ - #else /* KERNEL */ - # include - # include --# include - # if defined(AFS_NT40_ENV) - # ifndef EWOULDBLOCK - # define EWOULDBLOCK WSAEWOULDBLOCK -@@ -58,6 +57,8 @@ - # include - #endif - -+ -+#include - #include - - #include "rx.h" -@@ -194,7 +195,7 @@ rx_SlowReadPacket(struct rx_packet * packet, unsigned int offset, int resid, - */ - r = resid; - while ((r > 0) && (i < packet->niovecs)) { -- j = MIN(r, packet->wirevec[i].iov_len - (offset - l)); -+ j = opr_min(r, packet->wirevec[i].iov_len - (offset - l)); - memcpy(out, (char *)(packet->wirevec[i].iov_base) + (offset - l), j); - r -= j; - out += j; -@@ -237,7 +238,7 @@ rx_SlowWritePacket(struct rx_packet * packet, int offset, int resid, char *in) - break; - - b = (char *)(packet->wirevec[i].iov_base) + (offset - l); -- j = MIN(r, packet->wirevec[i].iov_len - (offset - l)); -+ j = opr_min(r, packet->wirevec[i].iov_len - (offset - l)); - memcpy(b, in, j); - r -= j; - in += j; -@@ -277,7 +278,7 @@ AllocPacketBufs(int class, int num_pkts, struct opr_queue * q) - if (transfer > 0) { - NETPRI; - MUTEX_ENTER(&rx_freePktQ_lock); -- transfer = MAX(transfer, rx_TSFPQGlobSize); -+ transfer = opr_max(transfer, rx_TSFPQGlobSize); - if (transfer > rx_nFreePackets) { - /* alloc enough for us, plus a few globs for other threads */ - rxi_MorePacketsNoLock(transfer + 4 * rx_initSendWindow); -@@ -344,7 +345,7 @@ AllocPacketBufs(int class, int num_pkts, struct opr_queue * q) - } - #else /* KERNEL */ - if (rx_nFreePackets < num_pkts) { -- rxi_MorePacketsNoLock(MAX((num_pkts-rx_nFreePackets), 4 * rx_initSendWindow)); -+ rxi_MorePacketsNoLock(opr_max((num_pkts-rx_nFreePackets), 4 * rx_initSendWindow)); - } - #endif /* KERNEL */ - -@@ -826,7 +827,7 @@ rxi_AdjustLocalPacketsTSFPQ(int num_keep_local, int allow_overcommit) - if ((num_keep_local > rx_TSFPQLocalMax) && !allow_overcommit) - xfer = rx_TSFPQLocalMax - rx_ts_info->_FPQ.len; - if (rx_nFreePackets < xfer) { -- rxi_MorePacketsNoLock(MAX(xfer - rx_nFreePackets, 4 * rx_initSendWindow)); -+ rxi_MorePacketsNoLock(opr_max(xfer - rx_nFreePackets, 4 * rx_initSendWindow)); - } - RX_TS_FPQ_GTOL2(rx_ts_info, xfer); - } -@@ -922,7 +923,7 @@ rxi_FreeDataBufsToQueue(struct rx_packet *p, afs_uint32 first, struct opr_queue - struct rx_packet * cb; - int count = 0; - -- for (first = MAX(2, first); first < p->niovecs; first++, count++) { -+ for (first = opr_max(2, first); first < p->niovecs; first++, count++) { - iov = &p->wirevec[first]; - if (!iov->iov_base) - osi_Panic("rxi_FreeDataBufsToQueue: unexpected NULL iov"); -@@ -950,7 +951,7 @@ rxi_FreeDataBufsNoLock(struct rx_packet *p, afs_uint32 first) - { - struct iovec *iov; - -- for (first = MAX(2, first); first < p->niovecs; first++) { -+ for (first = opr_max(2, first); first < p->niovecs; first++) { - iov = &p->wirevec[first]; - if (!iov->iov_base) - osi_Panic("rxi_FreeDataBufsNoLock: unexpected NULL iov"); -@@ -985,7 +986,7 @@ rxi_FreeDataBufsTSFPQ(struct rx_packet *p, afs_uint32 first, int flush_global) - - RX_TS_INFO_GET(rx_ts_info); - -- for (first = MAX(2, first); first < p->niovecs; first++) { -+ for (first = opr_max(2, first); first < p->niovecs; first++) { - iov = &p->wirevec[first]; - if (!iov->iov_base) - osi_Panic("rxi_FreeDataBufsTSFPQ: unexpected NULL iov"); -@@ -1333,7 +1334,7 @@ rxi_AllocSendPacket(struct rx_call *call, int want) - #ifdef RX_ENABLE_TSFPQ - if ((p = rxi_AllocPacketTSFPQ(RX_PACKET_CLASS_SEND, 0))) { - want += delta; -- want = MIN(want, mud); -+ want = opr_min(want, mud); - - if ((unsigned)want > p->length) - (void)rxi_AllocDataBuf(p, (want - p->length), -@@ -1359,7 +1360,7 @@ rxi_AllocSendPacket(struct rx_call *call, int want) - MUTEX_EXIT(&rx_freePktQ_lock); - - want += delta; -- want = MIN(want, mud); -+ want = opr_min(want, mud); - - if ((unsigned)want > p->length) - (void)rxi_AllocDataBuf(p, (want - p->length), -@@ -1646,7 +1647,7 @@ cpytoc(mblk_t * mp, int off, int len, char *cp) - if (mp->b_datap->db_type != M_DATA) { - return -1; - } -- n = MIN(len, (mp->b_wptr - mp->b_rptr)); -+ n = opr_min(len, (mp->b_wptr - mp->b_rptr)); - memcpy(cp, (char *)mp->b_rptr, n); - cp += n; - len -= n; -@@ -1669,7 +1670,7 @@ cpytoiovec(mblk_t * mp, int off, int len, struct iovec *iovs, - if (mp->b_datap->db_type != M_DATA) { - return -1; - } -- n = MIN(len, (mp->b_wptr - mp->b_rptr)); -+ n = opr_min(len, (mp->b_wptr - mp->b_rptr)); - len -= n; - while (n) { - if (!t) { -@@ -1677,7 +1678,7 @@ cpytoiovec(mblk_t * mp, int off, int len, struct iovec *iovs, - i++; - t = iovs[i].iov_len; - } -- m = MIN(n, t); -+ m = opr_min(n, t); - memcpy(iovs[i].iov_base + o, (char *)mp->b_rptr, m); - mp->b_rptr += m; - o += m; -@@ -1719,7 +1720,7 @@ m_cpytoiovec(struct mbuf *m, int off, int len, struct iovec iovs[], int niovs) - l2 = iovs[0].iov_len; - - while (len) { -- t = MIN(l1, MIN(l2, (unsigned int)len)); -+ t = opr_min(l1, opr_min(l2, (unsigned int)len)); - memcpy(p2, p1, t); - p1 += t; - p2 += t; -@@ -2860,7 +2861,7 @@ int - rxi_AdjustMaxMTU(int mtu, int peerMaxMTU) - { - int maxMTU = mtu * rxi_nSendFrags; -- maxMTU = MIN(maxMTU, peerMaxMTU); -+ maxMTU = opr_min(maxMTU, peerMaxMTU); - return rxi_AdjustIfMTU(maxMTU); - } - -@@ -2876,7 +2877,7 @@ rxi_AdjustDgramPackets(int frags, int mtu) - return 1; - } - maxMTU = (frags * (mtu + UDP_HDR_SIZE)) - UDP_HDR_SIZE; -- maxMTU = MIN(maxMTU, RX_MAX_PACKET_SIZE); -+ maxMTU = opr_min(maxMTU, RX_MAX_PACKET_SIZE); - /* subtract the size of the first and last packets */ - maxMTU -= RX_HEADER_SIZE + (2 * RX_JUMBOBUFFERSIZE) + RX_JUMBOHEADERSIZE; - if (maxMTU < 0) { -diff --git a/src/rx/rx_packet.h b/src/rx/rx_packet.h -index 46c07895d..11bf55000 100644 ---- a/src/rx/rx_packet.h -+++ b/src/rx/rx_packet.h -@@ -316,7 +316,7 @@ struct rx_packet { - /* return what the actual contiguous space is: should be min(length,size) */ - /* The things that call this really want something like ...pullup MTUXXX */ - #define rx_Contiguous(p) \ -- MIN((unsigned) (p)->length, (unsigned) ((p)->wirevec[1].iov_len)) -+ opr_min((unsigned) (p)->length, (unsigned) ((p)->wirevec[1].iov_len)) - - #ifndef TRUE - #define TRUE 1 -diff --git a/src/rx/rx_rdwr.c b/src/rx/rx_rdwr.c -index ee1c3e3d4..2bc75cb49 100644 ---- a/src/rx/rx_rdwr.c -+++ b/src/rx/rx_rdwr.c -@@ -50,9 +50,9 @@ - # include "afs/lock.h" - #else /* KERNEL */ - # include --# include - #endif /* KERNEL */ - -+#include - #include "rx.h" - #include "rx_clock.h" - #include "rx_globals.h" -@@ -252,8 +252,8 @@ rxi_ReadProc(struct rx_call *call, char *buf, - * the final portion of a received packet, it's almost certain that - * call->app.nLeft will be smaller than the final buffer. */ - while (nbytes && call->app.currentPacket) { -- t = MIN((int)call->app.curlen, nbytes); -- t = MIN(t, (int)call->app.nLeft); -+ t = opr_min((int)call->app.curlen, nbytes); -+ t = opr_min(t, (int)call->app.nLeft); - memcpy(buf, call->app.curpos, t); - buf += t; - nbytes -= t; -@@ -428,8 +428,8 @@ rxi_FillReadVec(struct rx_call *call, afs_uint32 serial) - && call->iovNext < call->iovMax - && call->app.currentPacket) { - -- t = MIN((int)call->app.curlen, call->iovNBytes); -- t = MIN(t, (int)call->app.nLeft); -+ t = opr_min((int)call->app.curlen, call->iovNBytes); -+ t = opr_min(t, (int)call->app.nLeft); - call_iov->iov_base = call->app.curpos; - call_iov->iov_len = t; - call_iov++; -@@ -724,7 +724,7 @@ rxi_WriteProc(struct rx_call *call, char *buf, - mud = rx_MaxUserDataSize(call); - if (mud > len) { - int want; -- want = MIN(nbytes - (int)call->app.nFree, mud - len); -+ want = opr_min(nbytes - (int)call->app.nFree, mud - len); - rxi_AllocDataBuf(call->app.currentPacket, want, - RX_PACKET_CLASS_SEND_CBUF); - if (call->app.currentPacket->length > (unsigned)mud) -@@ -743,8 +743,8 @@ rxi_WriteProc(struct rx_call *call, char *buf, - - while (nbytes && call->app.nFree) { - -- t = MIN((int)call->app.curlen, nbytes); -- t = MIN((int)call->app.nFree, t); -+ t = opr_min((int)call->app.curlen, nbytes); -+ t = opr_min((int)call->app.nFree, t); - memcpy(call->app.curpos, buf, t); - buf += t; - nbytes -= t; -@@ -952,7 +952,7 @@ rxi_WritevAlloc(struct rx_call *call, struct iovec *iov, int *nio, int maxio, - mud = rx_MaxUserDataSize(call); - if (mud > len) { - int want; -- want = MIN(nbytes - tnFree, mud - len); -+ want = opr_min(nbytes - tnFree, mud - len); - rxi_AllocDataBuf(cp, want, RX_PACKET_CLASS_SEND_CBUF); - if (cp->length > (unsigned)mud) - cp->length = mud; -@@ -964,8 +964,8 @@ rxi_WritevAlloc(struct rx_call *call, struct iovec *iov, int *nio, int maxio, - } - - /* fill in the next entry in the iovec */ -- t = MIN(tcurlen, nbytes); -- t = MIN(tnFree, t); -+ t = opr_min(tcurlen, nbytes); -+ t = opr_min(tnFree, t); - iov[nextio].iov_base = tcurpos; - iov[nextio].iov_len = t; - nbytes -= t; -diff --git a/src/rx/rx_user.c b/src/rx/rx_user.c -index 15695265e..1effe0a19 100644 ---- a/src/rx/rx_user.c -+++ b/src/rx/rx_user.c -@@ -404,12 +404,12 @@ rx_GetIFInfo(void) - rxi_nRecvFrags * rxsize + (rxi_nRecvFrags - 1) * UDP_HDR_SIZE; - maxsize = rxi_AdjustMaxMTU(rxsize, maxsize); - if (rx_maxReceiveSize > maxsize) { -- rx_maxReceiveSize = MIN(RX_MAX_PACKET_SIZE, maxsize); -+ rx_maxReceiveSize = opr_min(RX_MAX_PACKET_SIZE, maxsize); - rx_maxReceiveSize = -- MIN(rx_maxReceiveSize, rx_maxReceiveSizeUser); -+ opr_min(rx_maxReceiveSize, rx_maxReceiveSizeUser); - } - if (rx_MyMaxSendSize > maxsize) { -- rx_MyMaxSendSize = MIN(RX_MAX_PACKET_SIZE, maxsize); -+ rx_MyMaxSendSize = opr_min(RX_MAX_PACKET_SIZE, maxsize); - } - } - UNLOCK_IF; -@@ -517,10 +517,10 @@ rx_GetIFInfo(void) - - LOCK_IF; - #ifdef AFS_AIX41_ENV --#define size(p) MAX((p).sa_len, sizeof(p)) -+#define size(p) opr_max((p).sa_len, sizeof(p)) - cplim = buf + ifc.ifc_len; /*skip over if's with big ifr_addr's */ - for (cp = buf; cp < cplim; -- cp += sizeof(ifr->ifr_name) + MAX(a->sin_len, sizeof(*a))) { -+ cp += sizeof(ifr->ifr_name) + opr_max(a->sin_len, sizeof(*a))) { - if (rxi_numNetAddrs >= ADDRSPERSITE) - break; - -@@ -642,7 +642,7 @@ rx_GetIFInfo(void) - rxi_nRecvFrags * (myNetMTUs[rxi_numNetAddrs] - RX_IP_SIZE); - maxsize -= UDP_HDR_SIZE; /* only the first frag has a UDP hdr */ - if (rx_maxReceiveSize < maxsize) -- rx_maxReceiveSize = MIN(RX_MAX_PACKET_SIZE, maxsize); -+ rx_maxReceiveSize = opr_min(RX_MAX_PACKET_SIZE, maxsize); - ++rxi_numNetAddrs; - } - } -@@ -658,7 +658,7 @@ rx_GetIFInfo(void) - rx_maxJumboRecvSize = - RX_HEADER_SIZE + rxi_nDgramPackets * RX_JUMBOBUFFERSIZE + - (rxi_nDgramPackets - 1) * RX_JUMBOHEADERSIZE; -- rx_maxJumboRecvSize = MAX(rx_maxJumboRecvSize, rx_maxReceiveSize); -+ rx_maxJumboRecvSize = opr_max(rx_maxJumboRecvSize, rx_maxReceiveSize); - ncbufs = (rx_maxJumboRecvSize - RX_FIRSTBUFFERSIZE); - if (ncbufs > 0) { - ncbufs = ncbufs / RX_CBUFFERSIZE; -@@ -721,13 +721,13 @@ rxi_InitPeerParams(struct rx_peer *pp) - if (rxmtu < RX_MIN_PACKET_SIZE) - rxmtu = RX_MIN_PACKET_SIZE; - if (pp->ifMTU < rxmtu) -- pp->ifMTU = MIN(rx_MyMaxSendSize, rxmtu); -+ pp->ifMTU = opr_min(rx_MyMaxSendSize, rxmtu); - } - } - UNLOCK_IF; - if (!pp->ifMTU) { /* not local */ - rx_rto_setPeerTimeoutSecs(pp, 3); -- pp->ifMTU = MIN(rx_MyMaxSendSize, RX_REMOTE_PACKET_SIZE); -+ pp->ifMTU = opr_min(rx_MyMaxSendSize, RX_REMOTE_PACKET_SIZE); - } - #ifdef AFS_ADAPT_PMTU - sock=socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP); -@@ -740,7 +740,7 @@ rxi_InitPeerParams(struct rx_peer *pp) - int mtu=0; - socklen_t s = sizeof(mtu); - if (getsockopt(sock, SOL_IP, IP_MTU, &mtu, &s)== 0) { -- pp->ifMTU = MIN(mtu - RX_IPUDP_SIZE, pp->ifMTU); -+ pp->ifMTU = opr_min(mtu - RX_IPUDP_SIZE, pp->ifMTU); - } - } - # ifdef AFS_NT40_ENV -@@ -752,16 +752,16 @@ rxi_InitPeerParams(struct rx_peer *pp) - #endif - pp->ifMTU = rxi_AdjustIfMTU(pp->ifMTU); - pp->maxMTU = OLD_MAX_PACKET_SIZE; /* for compatibility with old guys */ -- pp->natMTU = MIN((int)pp->ifMTU, OLD_MAX_PACKET_SIZE); -+ pp->natMTU = opr_min((int)pp->ifMTU, OLD_MAX_PACKET_SIZE); - pp->maxDgramPackets = -- MIN(rxi_nDgramPackets, -+ opr_min(rxi_nDgramPackets, - rxi_AdjustDgramPackets(rxi_nSendFrags, pp->ifMTU)); - pp->ifDgramPackets = -- MIN(rxi_nDgramPackets, -+ opr_min(rxi_nDgramPackets, - rxi_AdjustDgramPackets(rxi_nSendFrags, pp->ifMTU)); - pp->maxDgramPackets = 1; - /* Initialize slow start parameters */ -- pp->MTU = MIN(pp->natMTU, pp->maxMTU); -+ pp->MTU = opr_min(pp->natMTU, pp->maxMTU); - pp->cwind = 1; - pp->nDgramPackets = 1; - pp->congestSeq = 0; -diff --git a/src/rxkad/crypt_conn.c b/src/rxkad/crypt_conn.c -index da708bcd7..10ba5d84c 100644 ---- a/src/rxkad/crypt_conn.c -+++ b/src/rxkad/crypt_conn.c -@@ -27,9 +27,9 @@ - #endif /* !UKERNEL */ - #else /* !KERNEL */ - #include --#include - #endif /* KERNEL */ - -+#include - #include - #include - #include -@@ -58,7 +58,7 @@ rxkad_DecryptPacket(const struct rx_connection *conn, - data = rx_data(packet, i, tlen); - if (!data || !tlen) - break; -- tlen = MIN(len, tlen); -+ tlen = opr_min(len, tlen); - fc_cbc_encrypt(data, data, tlen, *schedule, xor, DECRYPT); - len -= tlen; - } -@@ -99,7 +99,7 @@ rxkad_EncryptPacket(const struct rx_connection * conn, - data = rx_data(packet, i, tlen); - if (!data || !tlen) - break; -- tlen = MIN(len, tlen); -+ tlen = opr_min(len, tlen); - fc_cbc_encrypt(data, data, tlen, *schedule, xor, ENCRYPT); - len -= tlen; - } -diff --git a/src/rxkad/rxkad_client.c b/src/rxkad/rxkad_client.c -index 630488374..1f760b8c0 100644 ---- a/src/rxkad/rxkad_client.c -+++ b/src/rxkad/rxkad_client.c -@@ -33,10 +33,9 @@ - #endif /* !UKERNEL */ - #else /* ! KERNEL */ - #include --#include - #endif /* KERNEL */ - -- -+#include - #include - #include - #include --- -2.46.1 - diff --git a/openafs/0003-Remove-MIN-and-MAX-macro-definitions.patch b/openafs/0003-Remove-MIN-and-MAX-macro-definitions.patch deleted file mode 100644 index 2c9b37f..0000000 --- a/openafs/0003-Remove-MIN-and-MAX-macro-definitions.patch +++ /dev/null @@ -1,885 +0,0 @@ -From 083e4c44085309665b66e9330aa0c4d30237e750 Mon Sep 17 00:00:00 2001 -From: Cheyenne Wills -Date: Tue, 13 Aug 2024 14:29:10 -0600 -Subject: [PATCH 3/4] Remove MIN and MAX macro definitions - -A prior commit: - "opr: replace MIN/MAX macros with opr_min/opr_max" - (Change I2d7b54193ec91f7ead9c5c5f714d9a8bc7533bf7) -replaced all uses of the MIN and MAX macros with opr_min and opr_max. - -As a cleanup and to resolve a failure when building the Linux kernel -module with Linux 6.11, remove all the defines for MIN and MAX. - -The Linux 6.11 commit: - 'minmax: make generic MIN() and MAX() macros available everywhere' - (1a251f52cf) -standardized and consolidated the definitions of the MIN and MAX macros -within the Linux kernel by defining them in an include file that is -widely used already (linux/minmax.h). - -With the above Linux commit, the kernel module fails with a redefined -error from the compiler: - "./include/linux/minmax.h:329: error: "MIN" redefined [-Werror]" - -Reviewed-on: https://gerrit.openafs.org/15814 -Reviewed-by: Andrew Deason -Reviewed-by: Michael Meffie -Tested-by: BuildBot -(cherry picked from commit 8e8ee623d1a21dc8476cde4b6b9d9e292b36691d) - -Change-Id: I096c386682afbf7de07f7bb882ab9442cbdeb13a ---- - src/afs/NBSD/osi_machdep.h | 8 -------- - src/afs/UKERNEL/afs_usrops.c | 7 ------- - src/config/afsconfig-windows.h | 3 --- - src/config/param.generic_fbsd.h | 10 ---------- - src/config/param.i386_dfbsd_23.h | 10 ---------- - src/config/param.linux26.h | 10 ---------- - src/config/param.nbsd15.h | 10 ---------- - src/config/param.nbsd16.h | 10 ---------- - src/config/param.nbsd20.h | 10 ---------- - src/config/param.nbsd21.h | 10 ---------- - src/config/param.nbsd30.h | 10 ---------- - src/config/param.nbsd40.h | 10 ---------- - src/config/param.nbsd50.h | 10 ---------- - src/config/param.nbsd60.h | 10 ---------- - src/config/param.nbsd70.h | 10 ---------- - src/config/param.obsd31.h | 8 -------- - src/config/param.obsd32.h | 8 -------- - src/config/param.obsd33.h | 8 -------- - src/config/param.obsd34.h | 8 -------- - src/config/param.obsd35.h | 8 -------- - src/config/param.obsd36.h | 8 -------- - src/config/param.obsd37.h | 8 -------- - src/config/param.obsd38.h | 8 -------- - src/config/param.obsd39.h | 8 -------- - src/config/param.obsd40.h | 8 -------- - src/config/param.obsd41.h | 8 -------- - src/config/param.obsd42.h | 8 -------- - src/config/param.obsd43.h | 8 -------- - src/config/param.obsd44.h | 8 -------- - src/config/param.obsd45.h | 8 -------- - src/config/param.obsd46.h | 8 -------- - src/config/param.obsd47.h | 8 -------- - src/config/param.obsd48.h | 8 -------- - src/config/param.obsd49.h | 8 -------- - src/config/param.obsd50.h | 8 -------- - src/config/param.obsd51.h | 8 -------- - src/config/param.obsd52.h | 8 -------- - src/config/param.obsd53.h | 8 -------- - src/config/param.obsd54.h | 8 -------- - src/lwp/iomgr.c | 4 ---- - src/rx/rx_getaddr.c | 4 ---- - src/rx/rx_packet.h | 9 +-------- - 42 files changed, 1 insertion(+), 346 deletions(-) - -diff --git a/src/afs/NBSD/osi_machdep.h b/src/afs/NBSD/osi_machdep.h -index 43aa62101..c8fc4d1f8 100644 ---- a/src/afs/NBSD/osi_machdep.h -+++ b/src/afs/NBSD/osi_machdep.h -@@ -184,14 +184,6 @@ extern struct lock afs_global_lock; - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) && !defined(IGNORE_STDS_H) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ASSEMBLER */ - - /* vnodes */ -diff --git a/src/afs/UKERNEL/afs_usrops.c b/src/afs/UKERNEL/afs_usrops.c -index a6ca52a79..c29dca709 100644 ---- a/src/afs/UKERNEL/afs_usrops.c -+++ b/src/afs/UKERNEL/afs_usrops.c -@@ -47,13 +47,6 @@ - #define CELLINFOFILE "CellItems" - #define MAXIPADDRS 64 - --#ifndef MIN --#define MIN(A,B) ((A)<(B)?(A):(B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A)>(B)?(A):(B)) --#endif -- - extern int cacheDiskType; - - char afs_LclCellName[64]; -diff --git a/src/config/afsconfig-windows.h b/src/config/afsconfig-windows.h -index 9c2baa0d2..2b36a568c 100644 ---- a/src/config/afsconfig-windows.h -+++ b/src/config/afsconfig-windows.h -@@ -271,6 +271,3 @@ typedef int errno_t; - - /* Build afsroken.dll as a dynamic library */ - #define ROKEN_LIB_DYNAMIC 1 -- --#define MAX(a,b) (((a) > (b)) ? (a) : (b)) --#define MIN(a,b) (((a) < (b)) ? (a) : (b)) -diff --git a/src/config/param.generic_fbsd.h b/src/config/param.generic_fbsd.h -index e09158b95..e74e84ffb 100644 ---- a/src/config/param.generic_fbsd.h -+++ b/src/config/param.generic_fbsd.h -@@ -88,16 +88,6 @@ - - # if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --# ifdef KERNEL --# ifndef MIN --# define MIN(A,B) ((A) < (B) ? (A) : (B)) --# endif --# ifndef MAX --# define MAX(A,B) ((A) > (B) ? (A) : (B)) --# endif --# endif /* KERNEL */ -- - # endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.i386_dfbsd_23.h b/src/config/param.i386_dfbsd_23.h -index 46b5aaf4b..aad44f55d 100644 ---- a/src/config/param.i386_dfbsd_23.h -+++ b/src/config/param.i386_dfbsd_23.h -@@ -100,16 +100,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifdef KERNEL --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif --#endif /* KERNEL */ -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.linux26.h b/src/config/param.linux26.h -index 8fa1e3cb9..2e9ee6fbe 100644 ---- a/src/config/param.linux26.h -+++ b/src/config/param.linux26.h -@@ -40,16 +40,6 @@ - #define AFS_GLOBAL_SUNLOCK - #endif /* __KERNEL__ */ - --#ifdef KERNEL --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- --#endif /* KERNEL */ -- - #ifndef KERNEL - #define __USE_LARGEFILE64 1 - #if !defined off64_t -diff --git a/src/config/param.nbsd15.h b/src/config/param.nbsd15.h -index 771ace046..5c5a17d74 100644 ---- a/src/config/param.nbsd15.h -+++ b/src/config/param.nbsd15.h -@@ -88,16 +88,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifdef KERNEL --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif --#endif /* KERNEL */ -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.nbsd16.h b/src/config/param.nbsd16.h -index 1630fdf20..355a5a240 100644 ---- a/src/config/param.nbsd16.h -+++ b/src/config/param.nbsd16.h -@@ -89,16 +89,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifdef KERNEL --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif --#endif /* KERNEL */ -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.nbsd20.h b/src/config/param.nbsd20.h -index 140e97164..bc5ee09ac 100644 ---- a/src/config/param.nbsd20.h -+++ b/src/config/param.nbsd20.h -@@ -95,16 +95,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) && !defined(IGNORE_STDS_H) - enum vcexcl { NONEXCL, EXCL }; -- --#ifdef KERNEL --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif --#endif /* KERNEL */ -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ && !defined(IGNORE_STDS_H) */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.nbsd21.h b/src/config/param.nbsd21.h -index 9402be5bb..35155da11 100644 ---- a/src/config/param.nbsd21.h -+++ b/src/config/param.nbsd21.h -@@ -95,16 +95,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) && !defined(IGNORE_STDS_H) - enum vcexcl { NONEXCL, EXCL }; -- --#ifdef KERNEL --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif --#endif /* KERNEL */ -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ && !defined(IGNORE_STDS_H) */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.nbsd30.h b/src/config/param.nbsd30.h -index 96e4a7395..d8129d248 100644 ---- a/src/config/param.nbsd30.h -+++ b/src/config/param.nbsd30.h -@@ -91,16 +91,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) && !defined(IGNORE_STDS_H) - enum vcexcl { NONEXCL, EXCL }; -- --#ifdef KERNEL --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif --#endif /* KERNEL */ -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ && !defined(IGNORE_STDS_H) */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.nbsd40.h b/src/config/param.nbsd40.h -index 7e3a92101..6c22e252a 100644 ---- a/src/config/param.nbsd40.h -+++ b/src/config/param.nbsd40.h -@@ -97,16 +97,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) && !defined(IGNORE_STDS_H) - enum vcexcl { NONEXCL, EXCL }; -- --#ifdef KERNEL --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif --#endif /* KERNEL */ -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ && !defined(IGNORE_STDS_H) */ - #endif /* _KERNEL_DEPRECATED */ - -diff --git a/src/config/param.nbsd50.h b/src/config/param.nbsd50.h -index fcb2077ca..268d0f304 100644 ---- a/src/config/param.nbsd50.h -+++ b/src/config/param.nbsd50.h -@@ -94,16 +94,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) && !defined(IGNORE_STDS_H) - enum vcexcl { NONEXCL, EXCL }; -- --#ifdef KERNEL --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif --#endif /* KERNEL */ -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ && !defined(IGNORE_STDS_H) */ - #endif /* _KERNEL_DEPRECATED */ - -diff --git a/src/config/param.nbsd60.h b/src/config/param.nbsd60.h -index dda79311e..6e08c4cae 100644 ---- a/src/config/param.nbsd60.h -+++ b/src/config/param.nbsd60.h -@@ -95,16 +95,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) && !defined(IGNORE_STDS_H) - enum vcexcl { NONEXCL, EXCL }; -- --#ifdef KERNEL --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif --#endif /* KERNEL */ -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ && !defined(IGNORE_STDS_H) */ - #endif /* _KERNEL_DEPRECATED */ - -diff --git a/src/config/param.nbsd70.h b/src/config/param.nbsd70.h -index bb7534fb3..4356226a6 100644 ---- a/src/config/param.nbsd70.h -+++ b/src/config/param.nbsd70.h -@@ -96,16 +96,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) && !defined(IGNORE_STDS_H) - enum vcexcl { NONEXCL, EXCL }; -- --#ifdef KERNEL --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif --#endif /* KERNEL */ -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ && !defined(IGNORE_STDS_H) */ - #endif /* _KERNEL_DEPRECATED */ - -diff --git a/src/config/param.obsd31.h b/src/config/param.obsd31.h -index edf9a73a4..f77cbcef7 100644 ---- a/src/config/param.obsd31.h -+++ b/src/config/param.obsd31.h -@@ -44,14 +44,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd32.h b/src/config/param.obsd32.h -index 3472178ef..26f19511d 100644 ---- a/src/config/param.obsd32.h -+++ b/src/config/param.obsd32.h -@@ -43,14 +43,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd33.h b/src/config/param.obsd33.h -index a82cb4302..0822cc3ea 100644 ---- a/src/config/param.obsd33.h -+++ b/src/config/param.obsd33.h -@@ -47,14 +47,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd34.h b/src/config/param.obsd34.h -index 62e606214..661a6f94d 100644 ---- a/src/config/param.obsd34.h -+++ b/src/config/param.obsd34.h -@@ -47,14 +47,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd35.h b/src/config/param.obsd35.h -index f03dce86d..43c9fe28d 100644 ---- a/src/config/param.obsd35.h -+++ b/src/config/param.obsd35.h -@@ -47,14 +47,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd36.h b/src/config/param.obsd36.h -index 0ee70960f..cc981888d 100644 ---- a/src/config/param.obsd36.h -+++ b/src/config/param.obsd36.h -@@ -49,14 +49,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd37.h b/src/config/param.obsd37.h -index fc26d85f1..032b054ed 100644 ---- a/src/config/param.obsd37.h -+++ b/src/config/param.obsd37.h -@@ -50,14 +50,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd38.h b/src/config/param.obsd38.h -index 6fa98fed6..5c33062c2 100644 ---- a/src/config/param.obsd38.h -+++ b/src/config/param.obsd38.h -@@ -51,14 +51,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd39.h b/src/config/param.obsd39.h -index 61626f94e..f4955de9d 100644 ---- a/src/config/param.obsd39.h -+++ b/src/config/param.obsd39.h -@@ -55,14 +55,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd40.h b/src/config/param.obsd40.h -index 23df49de3..f00a6b182 100644 ---- a/src/config/param.obsd40.h -+++ b/src/config/param.obsd40.h -@@ -51,14 +51,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd41.h b/src/config/param.obsd41.h -index e102260d6..d4a41e1f3 100644 ---- a/src/config/param.obsd41.h -+++ b/src/config/param.obsd41.h -@@ -54,14 +54,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd42.h b/src/config/param.obsd42.h -index b3f821bb9..c2c8ea678 100644 ---- a/src/config/param.obsd42.h -+++ b/src/config/param.obsd42.h -@@ -59,14 +59,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd43.h b/src/config/param.obsd43.h -index 6dd7baa7a..833458f7b 100644 ---- a/src/config/param.obsd43.h -+++ b/src/config/param.obsd43.h -@@ -60,14 +60,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd44.h b/src/config/param.obsd44.h -index 624795d38..89f396ccd 100644 ---- a/src/config/param.obsd44.h -+++ b/src/config/param.obsd44.h -@@ -61,14 +61,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd45.h b/src/config/param.obsd45.h -index aab537e7c..cbe786603 100644 ---- a/src/config/param.obsd45.h -+++ b/src/config/param.obsd45.h -@@ -61,14 +61,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd46.h b/src/config/param.obsd46.h -index ef123d7f7..d515f8576 100644 ---- a/src/config/param.obsd46.h -+++ b/src/config/param.obsd46.h -@@ -66,14 +66,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd47.h b/src/config/param.obsd47.h -index beabaa293..ffd56ca6b 100644 ---- a/src/config/param.obsd47.h -+++ b/src/config/param.obsd47.h -@@ -67,14 +67,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd48.h b/src/config/param.obsd48.h -index d87d53d28..7b6a8e7dd 100644 ---- a/src/config/param.obsd48.h -+++ b/src/config/param.obsd48.h -@@ -64,14 +64,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd49.h b/src/config/param.obsd49.h -index 28e383890..0cba5fbf9 100644 ---- a/src/config/param.obsd49.h -+++ b/src/config/param.obsd49.h -@@ -65,14 +65,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd50.h b/src/config/param.obsd50.h -index effaccdd1..5df568d97 100644 ---- a/src/config/param.obsd50.h -+++ b/src/config/param.obsd50.h -@@ -66,14 +66,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd51.h b/src/config/param.obsd51.h -index 49b5c3304..52fb2fa98 100644 ---- a/src/config/param.obsd51.h -+++ b/src/config/param.obsd51.h -@@ -67,14 +67,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd52.h b/src/config/param.obsd52.h -index 9cfa12c5a..0b2f43072 100644 ---- a/src/config/param.obsd52.h -+++ b/src/config/param.obsd52.h -@@ -68,14 +68,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd53.h b/src/config/param.obsd53.h -index d140dc066..a6c168863 100644 ---- a/src/config/param.obsd53.h -+++ b/src/config/param.obsd53.h -@@ -69,14 +69,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/config/param.obsd54.h b/src/config/param.obsd54.h -index 797ca45a3..88277bbf8 100644 ---- a/src/config/param.obsd54.h -+++ b/src/config/param.obsd54.h -@@ -70,14 +70,6 @@ - - #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) - enum vcexcl { NONEXCL, EXCL }; -- --#ifndef MIN --#define MIN(A,B) ((A) < (B) ? (A) : (B)) --#endif --#ifndef MAX --#define MAX(A,B) ((A) > (B) ? (A) : (B)) --#endif -- - #endif /* ! ASSEMBLER & ! __LANGUAGE_ASSEMBLY__ */ - #endif /* _KERNEL */ - -diff --git a/src/lwp/iomgr.c b/src/lwp/iomgr.c -index 2c88b56a9..82b576fe2 100644 ---- a/src/lwp/iomgr.c -+++ b/src/lwp/iomgr.c -@@ -51,10 +51,6 @@ typedef unsigned char bool; - #define FALSE 0 - #define TRUE 1 - --#ifndef MIN --#define MIN(a,b) (((a)>(b)) ? (b) : (a)) --#endif -- - #ifndef NSIG - #define NSIG 8*sizeof(sigset_t) - #endif -diff --git a/src/rx/rx_getaddr.c b/src/rx/rx_getaddr.c -index c340aaf15..2420b0468 100644 ---- a/src/rx/rx_getaddr.c -+++ b/src/rx/rx_getaddr.c -@@ -106,10 +106,6 @@ rxi_getaddr(void) - - #if !defined(KERNEL) || defined(UKERNEL) - --#ifndef MAX --#define MAX(A,B) (((A)<(B)) ? (B) : (A)) --#endif -- - #ifdef UKERNEL - #undef ioctl - #endif /* UKERNEL */ -diff --git a/src/rx/rx_packet.h b/src/rx/rx_packet.h -index 11bf55000..48736d3f8 100644 ---- a/src/rx/rx_packet.h -+++ b/src/rx/rx_packet.h -@@ -32,14 +32,7 @@ - */ - - --#if defined(AFS_NT40_ENV) --# ifndef MIN --# define MIN(a,b) ((a)<(b)?(a):(b)) --# endif --# ifndef MAX --# define MAX(a,b) ((a)>(b)?(a):(b)) --# endif --#else /* AFS_NT40_ENV */ -+#if !defined(AFS_NT40_ENV) - # if !defined(AFS_DARWIN_ENV) && !defined(AFS_USR_DARWIN_ENV) \ - && !defined(AFS_XBSD_ENV) && !defined(AFS_USR_FBSD_ENV) \ - && !defined(AFS_USR_DFBSD_ENV) && !defined(AFS_LINUX_ENV) --- -2.46.1 - diff --git a/openafs/0004-rx-Remove-includes-for-MIN-MAX-in-rx_packet.h.patch b/openafs/0004-rx-Remove-includes-for-MIN-MAX-in-rx_packet.h.patch deleted file mode 100644 index 2512bc0..0000000 --- a/openafs/0004-rx-Remove-includes-for-MIN-MAX-in-rx_packet.h.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 88151d1e26b68580c0c1ea23469b069334678b36 Mon Sep 17 00:00:00 2001 -From: Cheyenne Wills -Date: Thu, 15 Aug 2024 16:08:18 -0600 -Subject: [PATCH 4/4] rx: Remove includes for MIN/MAX in rx_packet.h - -The commit: - "opr: replace MIN/MAX macros with opr_min/opr_max" - (Change I2d7b54193ec91f7ead9c5c5f714d9a8bc7533bf7) -replaced all uses of the MIN and MAX macros with opr_min and opr_max. - -The include for sys/param.h and sys/sysmacros.h in rx_packet.h are no -longer needed for MIN/MAX. - -Remove the preprocessor conditionals and the includes for param.h and -sysmacros.h. - -Reviewed-on: https://gerrit.openafs.org/15823 -Reviewed-by: Andrew Deason -Reviewed-by: Michael Meffie -Tested-by: BuildBot -(cherry picked from commit d299dfbfe90482b26b5f5551eb5be1b8e76d6ac4) - -Change-Id: Ic1dec6f69bb8f9fd6eaffd0d893f0b2113193ae7 ---- - src/rx/rx_packet.h | 14 -------------- - 1 file changed, 14 deletions(-) - -diff --git a/src/rx/rx_packet.h b/src/rx/rx_packet.h -index 48736d3f8..173762af7 100644 ---- a/src/rx/rx_packet.h -+++ b/src/rx/rx_packet.h -@@ -31,20 +31,6 @@ - * and that the offsets are as well. - */ - -- --#if !defined(AFS_NT40_ENV) --# if !defined(AFS_DARWIN_ENV) && !defined(AFS_USR_DARWIN_ENV) \ -- && !defined(AFS_XBSD_ENV) && !defined(AFS_USR_FBSD_ENV) \ -- && !defined(AFS_USR_DFBSD_ENV) && !defined(AFS_LINUX_ENV) --# include /* MIN, MAX on most commercial UNIX */ --# endif --/* Linux 3.7 doesn't have sys/param.h in kernel space, and afs/param.h ensures -- * that MIN and MAX are available for kernel builds. */ --# if !(defined(AFS_LINUX_ENV) && defined(KERNEL)) --# include /* MIN, MAX elsewhere */ --# endif --#endif /* !AFS_NT40_ENV */ -- - #define IPv6_HDR_SIZE 40 /* IPv6 Header */ - #define IPv6_FRAG_HDR_SIZE 8 /* IPv6 Fragment Header */ - #define UDP_HDR_SIZE 8 /* UDP Header */ --- -2.46.1 - diff --git a/openafs/PKGBUILD b/openafs/PKGBUILD index 334baf4..3add21e 100644 --- a/openafs/PKGBUILD +++ b/openafs/PKGBUILD @@ -5,8 +5,8 @@ # https://github.com/michaellass/AUR pkgname=openafs -pkgver=1.8.12.1 -pkgrel=2 +pkgver=1.8.12.2 +pkgrel=1 pkgdesc="Open source implementation of the AFS distributed file system" arch=('i686' 'x86_64' 'armv7h') url="http://www.openafs.org" @@ -24,19 +24,11 @@ install=openafs.install source=(http://openafs.org/dl/openafs/${pkgver}/${pkgname}-${pkgver}-src.tar.bz2 http://openafs.org/dl/openafs/${pkgver}/${pkgname}-${pkgver}-doc.tar.bz2 tmpfiles.d-openafs.conf - 0001-Adjust-RedHat-config-and-service-files.patch - 0001-rx-Define-symbolic-names-for-Rx-magic-numbers.patch - 0002-opr-replace-MIN-MAX-macros-with-opr_min-opr_max.patch - 0003-Remove-MIN-and-MAX-macro-definitions.patch - 0004-rx-Remove-includes-for-MIN-MAX-in-rx_packet.h.patch) -sha256sums=('dfe2f39bef9fb3d6791d602e725be7c34b885e4299018266ff9743cb401e594a' - '79808f059ab01d5f929bc75d057b129f8b2a375356fe5afd780a075f2b25c562' + 0001-Adjust-RedHat-config-and-service-files.patch) +sha256sums=('1164194cc6ffd75c063c420fb37344e844c1e2edc155529f815ba4c781f45cab' + '4540194a1d67196966ecf6525653f56f23eaec739628b7971dd00da5faf28318' '18d7b0173bbffbdc212f4e58c5b3ce369adf868452aabc3485f2a6a2ddb35d68' - 'c15539241045e96252d6af4901311f3c494eae42c64edaaa1dcd1c70ef118624' - '89858ec91fb7cef85f7996c2eeeeb087a7996ed5d902ae4e3ac668e086753b05' - '247fbe76610056123525b11511f4a426913c7ee61b59f88fdbc0871239af9a94' - '9b3cac93406f13b3c1ad41c424c43e4df2c997ba9af68e8b73caf3db7e4df42f' - 'a7c4eb9dec81628459783705ceee531b29a81c254298e84c89cdc99e6c77729e') + 'c15539241045e96252d6af4901311f3c494eae42c64edaaa1dcd1c70ef118624') # If you need the kauth tools set this to 1. But be aware that these tools # are considered insecure since 2003! This also affects the PAM libs. @@ -48,12 +40,6 @@ prepare() { # Adjust RedHat config and service files to our needs patch -p1 < "${srcdir}"/0001-Adjust-RedHat-config-and-service-files.patch - # Patches for Linux 6.11 - patch -p1 < "$srcdir"/0001-rx-Define-symbolic-names-for-Rx-magic-numbers.patch - patch -p1 < "$srcdir"/0002-opr-replace-MIN-MAX-macros-with-opr_min-opr_max.patch - patch -p1 < "$srcdir"/0003-Remove-MIN-and-MAX-macro-definitions.patch - patch -p1 < "$srcdir"/0004-rx-Remove-includes-for-MIN-MAX-in-rx_packet.h.patch - # Only needed when changes to configure were made #./regen.sh -q }