From nobody Mon Jul 25 21:09:09 2022 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 4LsCMn6Mnbz4WnGG; Mon, 25 Jul 2022 21:09:09 +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 4LsCMn5rRjz3sf5; Mon, 25 Jul 2022 21:09:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658783349; 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=0Hn9BvPOdipcom+T19fp934R1vxYlCe1z8Zvexgcv7w=; b=RfBr2jSgLr1oVe+gEQpCgf3SNTT98ib5+ReB4BOsZBBylezPHmxKQuJJDuPSbAeObcJ4Kp Yku12ZKQPG2MTGTdJ6cePBEHj0LMHRDt+CEbgoIerZEUmDoLz4A/gAHt3iBiHK1iGhMRxd dvwuzTvNXiXgzkEGZCwn+b39n3DnNPRuunONeQGPMu+j7cebzv51+FQlcJtpBTN/fs0klF 3q0FTdEzRnOndK+0Js/4gjXEOSBMtjoU8MHD17qrqwbUFXRTXj4LoaxxjAL8ogElupgNuW +MuF+8uQ7pd9yZQsAnJ63FachH/pHEwwAC3XgyVTBdvPSQTv5NX7oYrYbEXBjA== 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 4LsCMn4nP7z1BbV; Mon, 25 Jul 2022 21:09:09 +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 26PL99iA004609; Mon, 25 Jul 2022 21:09:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26PL99Q7004608; Mon, 25 Jul 2022 21:09:09 GMT (envelope-from git) Date: Mon, 25 Jul 2022 21:09:09 GMT Message-Id: <202207252109.26PL99Q7004608@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 488f9d852787 - stable/13 - nfscl: Move nfsrpc_destroysession into nfscommon 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 488f9d852787dd03126d7fac8d76316ecb86da84 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658783349; 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=0Hn9BvPOdipcom+T19fp934R1vxYlCe1z8Zvexgcv7w=; b=HVXSOHLy6Cvps/rTB4NDUoy++SNqLQxFnEVLzC8pPjrn/jIuL6pDekJ3lhcoomfuU3zLel NGRGchI3bx10D+kWyy4rBMOEkutvT0wjfBowFZaj5G8znJhKavgheU756nsS3Z4ecPabMf SOclvTXUW0UaBrGz0sxqn3BVL991USKNfJENQnEJP7uUoVFzuIwRPRtIONb8LsDt4D/hYA SaQs6vxcpxVrE29dTaaVbRWPgLDApZpw7+DTGOrAP0lrq6I7ULXvAvTz02aNEIBsofKoqh lpeIpSBMrvAA2pTeeXYiWpm8sZHToLlASbOlUDfkdz33S/bZ1xQbL4pu3QWlzQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1658783349; a=rsa-sha256; cv=none; b=YsX7gp203TemMby4Uk0ssOwxDPsD2Elp1G342XCojEVo/zPbOJiwq+Ow/9P5KMZPW5q7SP ciUPKNN7GHgCklXWDIVvD9/YWFeQzu5f9HXz3wizC3aLAX0EGObRuuIOt8d191eZY8R1// 8Jv8T/ca01ujuk45ne3w1p6+Ii7Vhnnz9eIo9eqS5Gc7KpnXSJWKk/7iqE+b2VHlCFqlB/ oLbOjuWjpcUIkefxLbQrj95qnM0QRC/1lAHVGQRb9DwWKT3XXGSQ2zDliK23uPrh2RhGKA RkJbNB3hYLkRS2nRH19Dkir+6lVvWptymBtsx30bBOvKJF4OibeTaylVPhtR7Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=488f9d852787dd03126d7fac8d76316ecb86da84 commit 488f9d852787dd03126d7fac8d76316ecb86da84 Author: Rick Macklem AuthorDate: 2022-07-09 15:02:14 +0000 Commit: Rick Macklem CommitDate: 2022-07-25 21:05:45 +0000 nfscl: Move nfsrpc_destroysession into nfscommon This patch moves nfsrpc_destroysession() into nfscommon.ko and also modifies its arguments slightly. This will allow the function to be called from nfsv4_sequencelookup() in a future commit. This patch should not result in a semantics change. PR: 260011 (cherry picked from commit dff31ae1c59cab9437e88bfd0f2abd35ddaa98f1) --- sys/fs/nfs/nfs_commonsubs.c | 28 ++++++++++++++++++++++++++++ sys/fs/nfs/nfs_var.h | 4 ++-- sys/fs/nfsclient/nfs_clrpcops.c | 28 ---------------------------- sys/fs/nfsclient/nfs_clstate.c | 6 +++--- 4 files changed, 33 insertions(+), 33 deletions(-) diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c index 8c72f684a06c..bae4c82a998b 100644 --- a/sys/fs/nfs/nfs_commonsubs.c +++ b/sys/fs/nfs/nfs_commonsubs.c @@ -4989,3 +4989,31 @@ nfsm_add_ext_pgs(struct mbuf *m, int maxextsiz, int *bextpg) } return (mp); } + +/* + * Do the NFSv4.1 Destroy Session. + */ +int +nfsrpc_destroysession(struct nfsmount *nmp, struct nfsclsession *tsep, + struct ucred *cred, NFSPROC_T *p) +{ + uint32_t *tl; + struct nfsrv_descript nfsd; + struct nfsrv_descript *nd = &nfsd; + int error; + + nfscl_reqstart(nd, NFSPROC_DESTROYSESSION, nmp, NULL, 0, NULL, NULL, 0, + 0, NULL); + NFSM_BUILD(tl, uint32_t *, NFSX_V4SESSIONID); + if (tsep == NULL) + tsep = nfsmnt_mdssession(nmp); + bcopy(tsep->nfsess_sessionid, tl, NFSX_V4SESSIONID); + nd->nd_flag |= ND_USEGSSNAME; + error = newnfs_request(nd, nmp, NULL, &nmp->nm_sockreq, NULL, p, cred, + NFS_PROG, NFS_VER4, NULL, 1, NULL, NULL); + if (error != 0) + return (error); + error = nd->nd_repstat; + m_freem(nd->nd_mrep); + return (error); +} diff --git a/sys/fs/nfs/nfs_var.h b/sys/fs/nfs/nfs_var.h index b493ee509440..cf963691109b 100644 --- a/sys/fs/nfs/nfs_var.h +++ b/sys/fs/nfs/nfs_var.h @@ -364,6 +364,8 @@ struct ucred *nfsrv_getgrpscred(struct ucred *); struct nfsdevice *nfsv4_findmirror(struct nfsmount *); void nfsm_set(struct nfsrv_descript *, u_int); struct mbuf *nfsm_add_ext_pgs(struct mbuf *, int, int *); +int nfsrpc_destroysession(struct nfsmount *, struct nfsclsession *, + struct ucred *, NFSPROC_T *); /* nfs_clcomsubs.c */ void nfsm_uiombuf(struct nfsrv_descript *, struct uio *, int); @@ -530,8 +532,6 @@ int nfsrpc_exchangeid(struct nfsmount *, struct nfsclclient *, int nfsrpc_createsession(struct nfsmount *, struct nfsclsession *, struct nfssockreq *, struct nfsclds *, uint32_t, int, struct ucred *, NFSPROC_T *); -int nfsrpc_destroysession(struct nfsmount *, struct nfsclclient *, - struct ucred *, NFSPROC_T *); int nfsrpc_destroyclient(struct nfsmount *, struct nfsclclient *, struct ucred *, NFSPROC_T *); int nfsrpc_getdeviceinfo(struct nfsmount *, uint8_t *, int, uint32_t *, diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index 45aa2a8b4d6d..29e069f9d334 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -5061,34 +5061,6 @@ nfsmout: return (error); } -/* - * Do the NFSv4.1 Destroy Session. - */ -int -nfsrpc_destroysession(struct nfsmount *nmp, struct nfsclclient *clp, - struct ucred *cred, NFSPROC_T *p) -{ - uint32_t *tl; - struct nfsrv_descript nfsd; - struct nfsrv_descript *nd = &nfsd; - int error; - struct nfsclsession *tsep; - - nfscl_reqstart(nd, NFSPROC_DESTROYSESSION, nmp, NULL, 0, NULL, NULL, 0, - 0, NULL); - NFSM_BUILD(tl, uint32_t *, NFSX_V4SESSIONID); - tsep = nfsmnt_mdssession(nmp); - bcopy(tsep->nfsess_sessionid, tl, NFSX_V4SESSIONID); - nd->nd_flag |= ND_USEGSSNAME; - error = newnfs_request(nd, nmp, NULL, &nmp->nm_sockreq, NULL, p, cred, - NFS_PROG, NFS_VER4, NULL, 1, NULL, NULL); - if (error != 0) - return (error); - error = nd->nd_repstat; - m_freem(nd->nd_mrep); - return (error); -} - /* * Do the NFSv4.1 Destroy Client. */ diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index 9d4fe1d1cd7f..3779a323e04c 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -2089,10 +2089,10 @@ nfscl_umount(struct nfsmount *nmp, NFSPROC_T *p, struct nfscldeleghead *dhp) nfscl_delegreturnall(clp, p, dhp); cred = newnfs_getcred(); if (NFSHASNFSV4N(nmp)) { - (void)nfsrpc_destroysession(nmp, clp, cred, p); - (void)nfsrpc_destroyclient(nmp, clp, cred, p); + nfsrpc_destroysession(nmp, NULL, cred, p); + nfsrpc_destroyclient(nmp, clp, cred, p); } else - (void)nfsrpc_setclient(nmp, clp, 0, NULL, cred, p); + nfsrpc_setclient(nmp, clp, 0, NULL, cred, p); nfscl_cleanclient(clp); nmp->nm_clp = NULL; NFSFREECRED(cred);