Date: Fri, 1 May 2020 01:30:11 +0000 (UTC) From: Rick Macklem <rmacklem@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r360518 - projects/nfs-over-tls/sys/fs/nfs Message-ID: <202005010130.0411UBVp047582@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: rmacklem Date: Fri May 1 01:30:11 2020 New Revision: 360518 URL: https://svnweb.freebsd.org/changeset/base/360518 Log: Modify nfsm_copyfrommbuf() so that it calls nfsm_copfrommbuf_extpgs() for the ext_pgs mbuf case. This small change simplifies the callers and minimizes the changes required to integrate ext_pgs mbuf handling into the code in head. Modified: projects/nfs-over-tls/sys/fs/nfs/nfs_commonsubs.c Modified: projects/nfs-over-tls/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- projects/nfs-over-tls/sys/fs/nfs/nfs_commonsubs.c Fri May 1 01:26:36 2020 (r360517) +++ projects/nfs-over-tls/sys/fs/nfs/nfs_commonsubs.c Fri May 1 01:30:11 2020 (r360518) @@ -656,12 +656,8 @@ nfsm_mbufuio(struct nfsrv_descript *nd, struct uio *ui left = siz; uiosiz = left; while (left > 0) { - if ((nd->nd_md->m_flags & M_NOMAP) != 0) - xfer = nfsm_copyfrommbuf_extpgs(nd, uiocp, - uiop->uio_segflg, left); - else - xfer = nfsm_copyfrommbuf(nd, uiocp, - uiop->uio_segflg, left); + xfer = nfsm_copyfrommbuf(nd, uiocp, uiop->uio_segflg, + left); left -= xfer; uiocp += xfer; uiop->uio_offset += xfer; @@ -771,12 +767,7 @@ nfsm_dissct(struct nfsrv_descript *nd, int siz, int ho if (nd->nd_md == NULL) return (NULL); nfsm_set(nd, 0, false); - if ((nd->nd_md->m_flags & M_NOMAP) != 0) - xfer = nfsm_copyfrommbuf_extpgs(nd, p, - UIO_SYSSPACE, siz2); - else - xfer = nfsm_copyfrommbuf(nd, p, - UIO_SYSSPACE, siz2); + xfer = nfsm_copyfrommbuf(nd, p, UIO_SYSSPACE, siz2); p += xfer; siz2 -= xfer; if (siz2 > 0) @@ -2479,12 +2470,7 @@ nfsrv_mtostr(struct nfsrv_descript *nd, char *str, int rem = NFSM_RNDUP(siz) - siz; while (siz > 0) { - if ((nd->nd_md->m_flags & M_NOMAP) != 0) - xfer = nfsm_copyfrommbuf_extpgs(nd, str, - UIO_SYSSPACE, siz); - else - xfer = nfsm_copyfrommbuf(nd, str, - UIO_SYSSPACE, siz); + xfer = nfsm_copyfrommbuf(nd, str, UIO_SYSSPACE, siz); str += xfer; siz -= xfer; if (siz > 0 && !nfsm_shiftnext(nd, &xfer)) { @@ -4972,6 +4958,10 @@ nfsm_copyfrommbuf(struct nfsrv_descript *nd, char *cp, int xfer; m = nd->nd_md; + if ((m->m_flags & M_NOMAP) != 0) { + xfer = nfsm_copyfrommbuf_extpgs(nd, cp, segflg, len); + return (xfer); + } xfer = mtod(m, char *) + m->m_len - nd->nd_dpos; xfer = min(xfer, len); if (xfer > 0) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202005010130.0411UBVp047582>