From nobody Sun Feb 12 21:53:03 2023 X-Original-To: dev-commits-src-all@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 4PFLnC5fQxz3pC9K; Sun, 12 Feb 2023 21:53:03 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PFLnC4lnbz4RHy; Sun, 12 Feb 2023 21:53:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676238783; 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=XmbiYB/2cJt87roCsGffSlNHKWs3yUyhPDEW0l9WUyI=; b=cqIQA5xlREwzeWsGUcDiIDYdxX+fsvvJ8njJgOOFQWV6XK67FIQizUFjnCLelkIjPDBkal PQ0N2sV957JLJVMS6t9AU+UddYtKyBWMQS8+9ijw3UsZNLYxQjpeIwRKA8I6NG6oo9S64u xM8Alit/ZRHdDbDMQAj5HK4I4dUe4P8EsaoydeYQ3TY/AJLCO5uKGNQ8kX2JL8Cvwu8KV2 xdLQEekHNLayNUK0I5WNk7oBRnAQOcnobXjQWZBwRCIPMtRkMRj4KKEN9NXiZIsKYl0eaI vA7G6btXCMBsYqFT4x7+/OARmhh6Q/VjOK9LsX7A7XSrDBcZ+uKfCCWO+OliUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676238783; 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=XmbiYB/2cJt87roCsGffSlNHKWs3yUyhPDEW0l9WUyI=; b=ogf07zNtyRPTHrKAUBcg1TAtpiSV4UQGtr2+vIwNBvTX/81AkONaPhHYRQktsKnjuREDhZ Xaupj5AvS9x4BJ3KX7VGtmgicgtZJqwq/HpMaJbx0rmpTPOumJnuKU2zGzn3NjqIA2Oltq rVW9eIyWF9vz9cJAPkma+hQwTPXkFbXNI3s7wtuE/SBwLfjSibAOHXvbmMJWANJnjs3lmw UMfSY3y20GXreOYRiWXrhmGpuT1EkwlX14z0+x/k4utnziAz+fc0c8Yjvi2NIpv45++Ccl K4e42Ew9lc+vSoKTEbKbaMIRQnbVpvgHD4YU1e+0BaN2MWAiWJvv/GdpBdls2w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676238783; a=rsa-sha256; cv=none; b=W1yIXVQukB8zf2T+kvJtEhMtFXl6oEjBNTxQVo1p5NkOvohUOxMTmVWVjQABisMwEN2xOl QmaqmK8/Iq2uCexgXO4HAbZnDD2HJq4jjbzWlof9LS0uvOLodMFNl321pCrdXieJ4k9rds Az5UiXaFMHPTaj+wNgXKRkqr6GuA0PPGH/uDOIP6ktDkU7btH55tJQfoGMNxBACF6A5Uwd lTW2q+7JstR5lLrVtfMMVF4hkzv347voAl3Hqz0lJWidn9xi1x03SaaD8gBig5T9HxfdX+ DOaom7IJCg50Tu598FbekP+sA3L98ne/fISMTru2AQqzvhNP+Qu+T2jJrHa87A== 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 4PFLnC3pZLztjc; Sun, 12 Feb 2023 21:53:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 31CLr3xn069223; Sun, 12 Feb 2023 21:53:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31CLr3Na069222; Sun, 12 Feb 2023 21:53:03 GMT (envelope-from git) Date: Sun, 12 Feb 2023 21:53:03 GMT Message-Id: <202302122153.31CLr3Na069222@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: ab0440af75ba - main - nfsd: Continue adding macros so nfsd can run in a vnet prison List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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: ab0440af75ba0c2dbf263c5441ccbe4058515fff Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=ab0440af75ba0c2dbf263c5441ccbe4058515fff commit ab0440af75ba0c2dbf263c5441ccbe4058515fff Author: Rick Macklem AuthorDate: 2023-02-12 21:52:13 +0000 Commit: Rick Macklem CommitDate: 2023-02-12 21:52:13 +0000 nfsd: Continue adding macros so nfsd can run in a vnet prison Commit 7344856e3a6d added a lot of macros that will front end vnet macros so that nfsd(8) can run in vnet prison. This patch adds some more of them. MFC after: 3 months --- sys/fs/nfs/nfsdport.h | 2 +- sys/fs/nfs/nfsrvstate.h | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/sys/fs/nfs/nfsdport.h b/sys/fs/nfs/nfsdport.h index 6d468219adf3..26bd57d5736d 100644 --- a/sys/fs/nfs/nfsdport.h +++ b/sys/fs/nfs/nfsdport.h @@ -92,7 +92,7 @@ struct nfsexstuff { bcmp(&(f1)->fh_fid, &(f2)->fh_fid, sizeof(struct fid)) == 0) #define NFSLOCKHASH(f) \ - (&nfslockhash[nfsrv_hashfh(f) % nfsrv_lockhashsize]) + (&NFSD_VNET(nfslockhash)[nfsrv_hashfh(f) % nfsrv_lockhashsize]) #define NFSFPVNODE(f) ((f)->f_vnode) #define NFSFPCRED(f) ((f)->f_cred) diff --git a/sys/fs/nfs/nfsrvstate.h b/sys/fs/nfs/nfsrvstate.h index 4c171e8b3f50..4dc9729a952f 100644 --- a/sys/fs/nfs/nfsrvstate.h +++ b/sys/fs/nfs/nfsrvstate.h @@ -58,18 +58,18 @@ LIST_HEAD(nfsdontlisthead, nfsdontlist); TAILQ_HEAD(nfsuserhashhead, nfsusrgrp); #define NFSCLIENTHASH(id) \ - (&nfsclienthash[(id).lval[1] % nfsrv_clienthashsize]) + (&NFSD_VNET(nfsclienthash)[(id).lval[1] % nfsrv_clienthashsize]) #define NFSSTATEHASH(clp, id) \ (&((clp)->lc_stateid[(id).other[2] % nfsrv_statehashsize])) #define NFSUSERHASH(id) \ - (&nfsuserhash[(id) % nfsrv_lughashsize]) + (&NFSD_VNET(nfsuserhash)[(id) % nfsrv_lughashsize]) #define NFSUSERNAMEHASH(p, l) \ - (&nfsusernamehash[((l)>=4?(*(p)+*((p)+1)+*((p)+2)+*((p)+3)):*(p)) \ + (&NFSD_VNET(nfsusernamehash)[((l)>=4?(*(p)+*((p)+1)+*((p)+2)+*((p)+3)):*(p)) \ % nfsrv_lughashsize]) #define NFSGROUPHASH(id) \ - (&nfsgrouphash[(id) % nfsrv_lughashsize]) + (&NFSD_VNET(nfsgrouphash)[(id) % nfsrv_lughashsize]) #define NFSGROUPNAMEHASH(p, l) \ - (&nfsgroupnamehash[((l)>=4?(*(p)+*((p)+1)+*((p)+2)+*((p)+3)):*(p)) \ + (&NFSD_VNET(nfsgroupnamehash)[((l)>=4?(*(p)+*((p)+1)+*((p)+2)+*((p)+3)):*(p)) \ % nfsrv_lughashsize]) struct nfssessionhash { @@ -77,7 +77,8 @@ struct nfssessionhash { struct nfssessionhashhead list; }; #define NFSSESSIONHASH(f) \ - (&nfssessionhash[nfsrv_hashsessionid(f) % nfsrv_sessionhashsize]) + (&NFSD_VNET(nfssessionhash)[nfsrv_hashsessionid(f) % \ + nfsrv_sessionhashsize]) struct nfslayouthash { struct mtx mtx;