From nobody Sun Oct 19 20:33:30 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cqVd7171Cz6CVQD; Sun, 19 Oct 2025 20:33:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cqVd70BvFz3J7Q; Sun, 19 Oct 2025 20:33:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1760906011; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oEtyviUugmmwTP8fL7jUpAwPQuyNNhm9aUgMwSJVo1o=; b=oWqjpVo5z5l4a5M/5GYq3n5DER748XOvdZB5fKIem6siGAsQ23cs6J4e5+9tiRVi+YVA/D rS6O3HOmZVaG1dPMl/jGZR4FE7VvNINypMXre/SVxXOEcDXIfQzdK083x3hS9qu8MJePuV C9uhRddmMEoTpX5hqNXWrMwWW8eWeem3ETDyN7QFCAM5aI/NkuIJ7B3bBLMrWRJeAcCx/J 1+qGH3vkYJK9q/rpfZuvWqwAJYYaNpC1/N721VC3fMDyqmxxtZzbafz4CHUKf3jgwmQz44 Ry3rimhLnjX8hafGva5pVd2D291g5XhUp3CybyapayYWqSDgQZ2jX9UEO/7Z3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1760906011; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oEtyviUugmmwTP8fL7jUpAwPQuyNNhm9aUgMwSJVo1o=; b=cq/ngJJVfnKHeodCk7f9KX0OcOPhljoHq48bVuVGnv+M9CUtF039ZQkrvZS1Bajc9aDsZz HFv4FNVJIB/NEXGJL/KXXxSb9GQxtpQX7RttO9Iqyl61dEwbB3kH3B5EDp+SrM/JM1gMKV oeizTUh/DNY5q9X+6TXzIksI2I6z8iHbcH6sWvTKfy9jmd/rRleATiwL6P04cgsz3zYqph MScbpCAWsdqHpW9Cy3aFfqVE34mmZOmLjgywYers+vHRwBKD6IILzINRjEyozm9GBvseAu MuBP1mz46u81cRDbwSX0erakMwqyZbEjlc+LDc0jV3dAjUWuoWqdPrpCQJx/SA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1760906011; a=rsa-sha256; cv=none; b=se7YWEMrIvDtmDZEhFKBSkqu1alOjg03UAxkyVVGED5R2jMIGdjznpbDK6Q2E5PChOL+mV JLxOTR7+WiJB3VSKwfMmPmJhnGz8DenvUVXjndpDRYCdZb1wto2P2TYx/xIUToJu6Z5xZ+ jGvaABCqI73MU6LJeH9NRITmU2YK61DRzNcf5Ex22Z5bSeNm+6JCKZVQ8h8fIIff3ktGyz LJNyqZE892VyKEf5vY1lHR6C5ZMKoMHE3HDDptqjbCJC3v1n5ruU2az7vrK/p+FHQeOJ+S KXL93TijABBNdbiPSCo+gkg/A5Z6CffP4cIY+5+7C+pJjI1ZUXrMvXppvT6apg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cqVd66c1Pzk09; Sun, 19 Oct 2025 20:33:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 59JKXU2c015746; Sun, 19 Oct 2025 20:33:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 59JKXULp015743; Sun, 19 Oct 2025 20:33:30 GMT (envelope-from git) Date: Sun, 19 Oct 2025 20:33:30 GMT Message-Id: <202510192033.59JKXULp015743@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: a6369fb9e4b4 - main - nfscommon: Update the nfs_bigreply array List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a6369fb9e4b40396ea6ef1987436019612c387cd Auto-Submitted: auto-generated The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=a6369fb9e4b40396ea6ef1987436019612c387cd commit a6369fb9e4b40396ea6ef1987436019612c387cd Author: Elliott Mitchell AuthorDate: 2025-10-19 20:29:08 +0000 Commit: Rick Macklem CommitDate: 2025-10-19 20:29:08 +0000 nfscommon: Update the nfs_bigreply array The variable is simply a long series of flags. Mark as boolean to allow the compiler to use smaller types. Convert to designated initializer to better indicate which operations it is set for. Without this the array is kind of long and sparse. nfsv4_setsequence() is no longer used outside nfs_commonsubs.c, so now mark it as static. The fourth argument is true/false, so convert to boolean. No semantics change is made by this commit. Discussed with: jrtc27 MFC after: 2 weeks --- sys/fs/nfs/nfs_commonsubs.c | 23 ++++++++++++++++------- sys/fs/nfs/nfs_var.h | 2 -- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c index 7f5b29ca2085..ec95716ea485 100644 --- a/sys/fs/nfs/nfs_commonsubs.c +++ b/sys/fs/nfs/nfs_commonsubs.c @@ -216,10 +216,17 @@ NFSD_VNET_DEFINE_STATIC(u_char *, nfsrv_dnsname) = NULL; * marked 0 in this array, the code will still work, just not quite as * efficiently.) */ -static int nfs_bigreply[NFSV42_NPROCS] = { 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0 }; +static bool nfs_bigreply[NFSV42_NPROCS] = { + [NFSPROC_GETACL] = true, + [NFSPROC_GETEXTATTR] = true, + [NFSPROC_LISTEXTATTR] = true, + [NFSPROC_LOOKUP] = true, + [NFSPROC_READ] = true, + [NFSPROC_READDIR] = true, + [NFSPROC_READDIRPLUS] = true, + [NFSPROC_READDS] = true, + [NFSPROC_READLINK] = true, +}; /* local functions */ static int nfsrv_skipace(struct nfsrv_descript *nd, int *acesizep); @@ -232,6 +239,8 @@ static int nfsrv_getrefstr(struct nfsrv_descript *, u_char **, u_char **, static void nfsrv_refstrbigenough(int, u_char **, u_char **, int *); static uint32_t vtonfsv4_type(struct vattr *); static __enum_uint8(vtype) nfsv4tov_type(uint32_t, uint16_t *); +static void nfsv4_setsequence(struct nfsmount *, struct nfsrv_descript *, + struct nfsclsession *, bool, struct ucred *); static struct { int op; @@ -5021,9 +5030,9 @@ nfsv4_seqsess_cacherep(uint32_t slotid, struct nfsslot *slots, int repstat, /* * Generate the xdr for an NFSv4.1 Sequence Operation. */ -void +static void nfsv4_setsequence(struct nfsmount *nmp, struct nfsrv_descript *nd, - struct nfsclsession *sep, int dont_replycache, struct ucred *cred) + struct nfsclsession *sep, bool dont_replycache, struct ucred *cred) { uint32_t *tl, slotseq = 0; int error, maxslot, slotpos; @@ -5054,7 +5063,7 @@ nfsv4_setsequence(struct nfsmount *nmp, struct nfsrv_descript *nd, *tl++ = txdr_unsigned(slotseq); *tl++ = txdr_unsigned(slotpos); *tl++ = txdr_unsigned(maxslot); - if (dont_replycache == 0) + if (!dont_replycache) *tl = newnfs_true; else *tl = newnfs_false; diff --git a/sys/fs/nfs/nfs_var.h b/sys/fs/nfs/nfs_var.h index 61083ecf2d66..16a76c060e78 100644 --- a/sys/fs/nfs/nfs_var.h +++ b/sys/fs/nfs/nfs_var.h @@ -361,8 +361,6 @@ int nfsv4_getipaddr(struct nfsrv_descript *, struct sockaddr_in *, int nfsv4_seqsession(uint32_t, uint32_t, uint32_t, struct nfsslot *, struct mbuf **, uint16_t); void nfsv4_seqsess_cacherep(uint32_t, struct nfsslot *, int, struct mbuf **); -void nfsv4_setsequence(struct nfsmount *, struct nfsrv_descript *, - struct nfsclsession *, int, struct ucred *); int nfsv4_sequencelookup(struct nfsmount *, struct nfsclsession *, int *, int *, uint32_t *, uint8_t *, bool); void nfsv4_freeslot(struct nfsclsession *, int, bool);