From owner-svn-src-projects@freebsd.org Tue Jul 28 03:25:31 2020 Return-Path: Delivered-To: svn-src-projects@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DE7FB37A1C0 for ; Tue, 28 Jul 2020 03:25:31 +0000 (UTC) (envelope-from rmacklem@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BG2B35KWBz3VqY; Tue, 28 Jul 2020 03:25:31 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9A17886E6; Tue, 28 Jul 2020 03:25:31 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06S3PVBK059734; Tue, 28 Jul 2020 03:25:31 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06S3PVGl059733; Tue, 28 Jul 2020 03:25:31 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <202007280325.06S3PVGl059733@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Tue, 28 Jul 2020 03:25:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r363631 - projects/nfs-over-tls/sys/fs/nfsserver X-SVN-Group: projects X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: projects/nfs-over-tls/sys/fs/nfsserver X-SVN-Commit-Revision: 363631 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jul 2020 03:25:31 -0000 Author: rmacklem Date: Tue Jul 28 03:25:31 2020 New Revision: 363631 URL: https://svnweb.freebsd.org/changeset/base/363631 Log: Put nfs_fha_new.c from head into sys/fs/nfsserver. The changes applied to nfs_fha_new.c were only needed if dissection of XDR needed to be done from ext_pgs mbufs, which is not currently needed. Modified: projects/nfs-over-tls/sys/fs/nfsserver/nfs_fha_new.c Modified: projects/nfs-over-tls/sys/fs/nfsserver/nfs_fha_new.c ============================================================================== --- projects/nfs-over-tls/sys/fs/nfsserver/nfs_fha_new.c Tue Jul 28 02:56:26 2020 (r363630) +++ projects/nfs-over-tls/sys/fs/nfsserver/nfs_fha_new.c Tue Jul 28 03:25:31 2020 (r363631) @@ -43,11 +43,11 @@ static MALLOC_DEFINE(M_NFS_FHA, "NFS FHA", "NFS FHA"); static void fhanew_init(void *foo); static void fhanew_uninit(void *foo); static rpcproc_t fhanew_get_procnum(rpcproc_t procnum); -static int fhanew_get_fh(uint64_t *fh, int v3, - struct nfsrv_descript *nd); +static int fhanew_get_fh(uint64_t *fh, int v3, struct mbuf **md, + caddr_t *dpos); static int fhanew_is_read(rpcproc_t procnum); static int fhanew_is_write(rpcproc_t procnum); -static int fhanew_get_offset(struct nfsrv_descript *nd, +static int fhanew_get_offset(struct mbuf **md, caddr_t *dpos, int v3, struct fha_info *info); static int fhanew_no_offset(rpcproc_t procnum); static void fhanew_set_locktype(rpcproc_t procnum, @@ -164,8 +164,9 @@ fhanew_get_procnum(rpcproc_t procnum) } static int -fhanew_get_fh(uint64_t *fh, int v3, struct nfsrv_descript *nd) +fhanew_get_fh(uint64_t *fh, int v3, struct mbuf **md, caddr_t *dpos) { + struct nfsrv_descript lnd, *nd; uint32_t *tl; uint8_t *buf; uint64_t t; @@ -173,7 +174,11 @@ fhanew_get_fh(uint64_t *fh, int v3, struct nfsrv_descr error = 0; len = 0; + nd = &lnd; + nd->nd_md = *md; + nd->nd_dpos = *dpos; + if (v3) { NFSM_DISSECT_NONBLOCK(tl, uint32_t *, NFSX_UNSIGNED); if ((len = fxdr_unsigned(int, *tl)) <= 0 || len > NFSX_FHMAX) { @@ -193,6 +198,9 @@ fhanew_get_fh(uint64_t *fh, int v3, struct nfsrv_descr *fh = t; nfsmout: + *md = nd->nd_md; + *dpos = nd->nd_dpos; + return (error); } @@ -215,14 +223,19 @@ fhanew_is_write(rpcproc_t procnum) } static int -fhanew_get_offset(struct nfsrv_descript *nd, int v3, +fhanew_get_offset(struct mbuf **md, caddr_t *dpos, int v3, struct fha_info *info) { + struct nfsrv_descript lnd, *nd; uint32_t *tl; int error; error = 0; + nd = &lnd; + nd->nd_md = *md; + nd->nd_dpos = *dpos; + if (v3) { NFSM_DISSECT_NONBLOCK(tl, uint32_t *, 2 * NFSX_UNSIGNED); info->offset = fxdr_hyper(tl); @@ -232,6 +245,9 @@ fhanew_get_offset(struct nfsrv_descript *nd, int v3, } nfsmout: + *md = nd->nd_md; + *dpos = nd->nd_dpos; + return (error); } @@ -290,13 +306,13 @@ fhanew_set_locktype(rpcproc_t procnum, struct fha_info static void fha_extract_info(struct svc_req *req, struct fha_info *i) { + struct mbuf *md; + caddr_t dpos; static u_int64_t random_fh = 0; int error; int v3 = (req->rq_vers == 3); rpcproc_t procnum; - struct nfsrv_descript lnd, *nd; - nd = &lnd; /* * We start off with a random fh. If we get a reasonable * procnum, we set the fh. If there's a concept of offset @@ -337,17 +353,17 @@ fha_extract_info(struct svc_req *req, struct fha_info error = newnfs_realign(&req->rq_args, M_NOWAIT); if (error) goto out; - nd->nd_md = req->rq_args; - nd->nd_dpos = mtod(nd->nd_md, char *); + md = req->rq_args; + dpos = mtod(md, caddr_t); /* Grab the filehandle. */ - error = fhanew_get_fh(&i->fh, v3, nd); + error = fhanew_get_fh(&i->fh, v3, &md, &dpos); if (error) goto out; /* Content ourselves with zero offset for all but reads. */ if (i->read || i->write) - fhanew_get_offset(nd, v3, i); + fhanew_get_offset(&md, &dpos, v3, i); out: fhanew_set_locktype(procnum, i);