From nobody Sat Jul 09 15:03:41 2022 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 84B0A17D35FB; Sat, 9 Jul 2022 15:03:41 +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 4LgD1T3DnQz3S9G; Sat, 9 Jul 2022 15:03:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657379021; 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=rv9HPRqZ8lpMX6eqvQr1dES/NN9TlEu43NnwhIdRk1I=; b=JzxBUNKGz+gWsKjI3x4ZbIaRf8qbRxOpt7jWhsjnWPUxqsNJ5bk1bTVcuft/u379ZAj0uq x+9BMzTTwLm5lKiZ7Q8PccomJRibb2kIuU4eWMsWA0FoR9VBCnwtjcV5j5A1B6oVLn5vrS Qr7fRhr4VjXRt1177Y2h8LoZZ/o0o1Z3Fo3CUelLvZtli1/4j8Gp38AcivkZ4L85wmNhgm EKbXK/HiCAoxH3wXnR8i3M2ST3MYpNrYtRocUX8G0RjLVui+fc0nCBaiQiulOHGJcL98F6 5lZgM9v2QapqVScxFQEdN0yZdfXoyjZbTZEaQ+b/LUVljhzM/+MRKiaK3hDRcA== 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 4LgD1T2GdbzqPQ; Sat, 9 Jul 2022 15:03:41 +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 269F3fgF010390; Sat, 9 Jul 2022 15:03:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 269F3fTA010389; Sat, 9 Jul 2022 15:03:41 GMT (envelope-from git) Date: Sat, 9 Jul 2022 15:03:41 GMT Message-Id: <202207091503.269F3fTA010389@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: dff31ae1c59c - main - nfscl: Move nfsrpc_destroysession into nfscommon 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: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: 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: dff31ae1c59cab9437e88bfd0f2abd35ddaa98f1 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657379021; 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=rv9HPRqZ8lpMX6eqvQr1dES/NN9TlEu43NnwhIdRk1I=; b=skxODEo1eq0LspPiXjp3OBPJBLL/hd4guefqWcJCVILwF35nBQQSlAEAVnmGKbcXaFRmIF TqoPTO1Psq27BRScxjR4cgYxfzOk5xXnIEcPlO9Sg6YBaX1opptRBjvLEdOZ4N0aZWPaP6 8yVnx1OlpUMuGWK0CueZ6DOfLNeIPR7FGU7a5GpmpQR7IxkK1IQw/Or/bbm1fJF9Os6rRt WHhj7LBu+wQ/ZfL/cNCraMBjgUyB3h73tueTZYCDhTAwwoywOEo63u3r9HNHSU6Tc2a8BS p4RqyihMjregRwidtxEJTgANj+l4xvquWW9Db8mUf6fKgo8o0FS1r6nNar/I9w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1657379021; a=rsa-sha256; cv=none; b=g0/aUXl4SEYzQLRZKe5ghEXcqJ8QtTdnbtjwsiwKPmYA+QjHT/SOIaMAyQgkNrjaftPIT3 qPuBEVfY5qGyRqkGdVnz7jHJT8YUcAwxJBjzbP8QA0iONcnRBp5y51O1zU56IUy+bYKuVg JtAT6/gvw+8CEeYVX/Wmc4TutUOq9EVHFfkejgero4BR3ctl+WTnqcVOt7/9JEk09lgc5Q pI2VqjAsNhWbiHzfkbqJD4NHWkCnwIUEHr5kzfGwwbI3SvtlwMEbgZbtyPCo44hrPLa5u/ NkMMtj/BI7aZ5amseZaWUl4mMsPGiZkA9MoLEalV14xGH0i7lhqIUEx2LvH/xw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=dff31ae1c59cab9437e88bfd0f2abd35ddaa98f1 commit dff31ae1c59cab9437e88bfd0f2abd35ddaa98f1 Author: Rick Macklem AuthorDate: 2022-07-09 15:02:14 +0000 Commit: Rick Macklem CommitDate: 2022-07-09 15:02:14 +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 MFC after: 2 weeks --- 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 c983126acf94..4c38d29ed281 100644 --- a/sys/fs/nfs/nfs_commonsubs.c +++ b/sys/fs/nfs/nfs_commonsubs.c @@ -4985,3 +4985,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 f087ee6785ef..a9648de6b028 100644 --- a/sys/fs/nfs/nfs_var.h +++ b/sys/fs/nfs/nfs_var.h @@ -366,6 +366,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 05d98d52be4d..f5a74ecd7d65 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -5291,34 +5291,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 41ebbe8213c5..406f66c86287 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -2093,10 +2093,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);