Date: Thu, 23 Apr 2020 04:59:07 +0000 (UTC) From: Rick Macklem <rmacklem@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r360216 - in projects/nfs-over-tls/sys: fs/nfs fs/nfsclient fs/nfsserver kern rpc sys Message-ID: <202004230459.03N4x76E056821@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: rmacklem Date: Thu Apr 23 04:59:07 2020 New Revision: 360216 URL: https://svnweb.freebsd.org/changeset/base/360216 Log: Fix the updated kernel so that it will build post-r359919. Although it now builds, it won't work until how to pass the length of the mbuf list into sosend() without a m_pkthdr mbuf is resolved. Modified: projects/nfs-over-tls/sys/fs/nfs/nfs_commonport.c projects/nfs-over-tls/sys/fs/nfs/nfs_commonsubs.c projects/nfs-over-tls/sys/fs/nfs/nfsm_subs.h projects/nfs-over-tls/sys/fs/nfsclient/nfs_clcomsubs.c projects/nfs-over-tls/sys/fs/nfsserver/nfs_nfsdport.c projects/nfs-over-tls/sys/fs/nfsserver/nfs_nfsdserv.c projects/nfs-over-tls/sys/fs/nfsserver/nfs_nfsdsubs.c projects/nfs-over-tls/sys/kern/kern_mbuf.c projects/nfs-over-tls/sys/rpc/clnt_vc.c projects/nfs-over-tls/sys/rpc/rpc_generic.c projects/nfs-over-tls/sys/rpc/svc_vc.c projects/nfs-over-tls/sys/sys/mbuf.h Modified: projects/nfs-over-tls/sys/fs/nfs/nfs_commonport.c ============================================================================== --- projects/nfs-over-tls/sys/fs/nfs/nfs_commonport.c Thu Apr 23 04:51:32 2020 (r360215) +++ projects/nfs-over-tls/sys/fs/nfs/nfs_commonport.c Thu Apr 23 04:59:07 2020 (r360216) @@ -195,7 +195,7 @@ newnfs_realign(struct mbuf **pm, int how) m = *pm; while ((m->m_flags & M_NOMAP) != 0) { if ((m->m_len & 0x3) != 0 || - (m->m_ext.ext_pgs->first_pg_off & 0x3) != 0) { + (m->m_ext_pgs.first_pg_off & 0x3) != 0) { copyit = true; break; } Modified: projects/nfs-over-tls/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- projects/nfs-over-tls/sys/fs/nfs/nfs_commonsubs.c Thu Apr 23 04:51:32 2020 (r360215) +++ projects/nfs-over-tls/sys/fs/nfs/nfs_commonsubs.c Thu Apr 23 04:59:07 2020 (r360216) @@ -380,7 +380,7 @@ nfscl_reqstart(struct nfsrv_descript *nd, int procnum, * Get the first mbuf for the request. */ if ((nd->nd_flag & ND_NOMAP) != 0) { - mb = mb_alloc_ext_plus_pages(PAGE_SIZE, M_WAITOK, false, + mb = mb_alloc_ext_plus_pages(PAGE_SIZE, M_WAITOK, mb_free_mext_pgs); nd->nd_mreq = nd->nd_mb = mb; nfsm_set(nd, 0, true); @@ -715,11 +715,11 @@ nfsm_dissct(struct nfsrv_descript *nd, int siz, int ho while (left == 0) { if ((nd->nd_md->m_flags & M_NOMAP) != 0 && nd->nd_dextpg < - nd->nd_md->m_ext.ext_pgs->npgs - 1) { - pgs = nd->nd_md->m_ext.ext_pgs; + nd->nd_md->m_ext_pgs.npgs - 1) { + pgs = &nd->nd_md->m_ext_pgs; nd->nd_dextpg++; nd->nd_dpos = (char *)(void *) - PHYS_TO_DMAP(pgs->pa[nd->nd_dextpg]); + PHYS_TO_DMAP(nd->nd_md->m_epg_pa[nd->nd_dextpg]); left = nd->nd_dextpgsiz = mbuf_ext_pg_len(pgs, nd->nd_dextpg, 0); } else if (!nfsm_shiftnext(nd, &left)) @@ -736,14 +736,13 @@ nfsm_dissct(struct nfsrv_descript *nd, int siz, int ho /* Make sure an ext_pgs mbuf is at the last page. */ if ((nd->nd_md->m_flags & M_NOMAP) != 0) { if (nd->nd_dextpg < - nd->nd_md->m_ext.ext_pgs->npgs - 1) { + nd->nd_md->m_ext_pgs.npgs - 1) { mp2 = nfsm_splitatpgno(nd->nd_md, nd->nd_dextpg, how); if (mp2 == NULL) return (NULL); } - nd->nd_md->m_ext.ext_pgs->last_pg_len -= - left; + nd->nd_md->m_ext_pgs.last_pg_len -= left; } if (nd->nd_md->m_next == NULL) return (NULL); @@ -827,7 +826,7 @@ nfsm_advance(struct nfsrv_descript *nd, int offs, int while (offs > left) { if ((nd->nd_md->m_flags & M_NOMAP) != 0 && nd->nd_dextpg < - nd->nd_md->m_ext.ext_pgs->npgs - 1) { + nd->nd_md->m_ext_pgs.npgs - 1) { xfer = nfsm_copyfrommbuf_extpgs(nd, NULL, UIO_SYSSPACE, offs); offs -= xfer; @@ -891,7 +890,7 @@ nfsm_strtom(struct nfsrv_descript *nd, const char *cp, m2 = nfsm_add_ext_pgs(m2, nd->nd_maxextsiz, &nd->nd_bextpg); cp2 = (char *)(void *)PHYS_TO_DMAP( - m2->m_ext.ext_pgs->pa[nd->nd_bextpg]); + m2->m_epg_pa[nd->nd_bextpg]); nd->nd_bextpgsiz = left = PAGE_SIZE; } else { if (siz > ncl_mbuf_mlen) @@ -917,7 +916,7 @@ nfsm_strtom(struct nfsrv_descript *nd, const char *cp, left -= xfer; if ((nd->nd_flag & ND_NOMAP) != 0) { nd->nd_bextpgsiz -= xfer; - m2->m_ext.ext_pgs->last_pg_len += xfer; + m2->m_ext_pgs.last_pg_len += xfer; } if (siz == 0 && rem) { if (left < rem) @@ -927,7 +926,7 @@ nfsm_strtom(struct nfsrv_descript *nd, const char *cp, cp2 += rem; if ((nd->nd_flag & ND_NOMAP) != 0) { nd->nd_bextpgsiz -= rem; - m2->m_ext.ext_pgs->last_pg_len += rem; + m2->m_ext_pgs.last_pg_len += rem; } } } @@ -1103,10 +1102,10 @@ nfsm_trimtrailing(struct nfsrv_descript *nd, struct mb mb->m_next = NULL; } if ((mb->m_flags & M_NOMAP) != 0) { - pgs = mb->m_ext.ext_pgs; + pgs = &mb->m_ext_pgs; /* First, get rid of any pages after this position. */ for (i = pgs->npgs - 1; i > bextpg; i--) { - pg = PHYS_TO_VM_PAGE(pgs->pa[i]); + pg = PHYS_TO_VM_PAGE(mb->m_epg_pa[i]); vm_page_unwire_noq(pg); vm_page_free(pg); } @@ -4476,11 +4475,11 @@ nfsrvd_rephead(struct nfsrv_descript *nd) struct mbuf *mreq; if ((nd->nd_flag & ND_NOMAP) != 0) { - mreq = mb_alloc_ext_plus_pages(PAGE_SIZE, M_WAITOK, false, + mreq = mb_alloc_ext_plus_pages(PAGE_SIZE, M_WAITOK, mb_free_mext_pgs); nd->nd_mreq = nd->nd_mb = mreq; nd->nd_bpos = (char *)(void *) - PHYS_TO_DMAP(mreq->m_ext.ext_pgs->pa[0]); + PHYS_TO_DMAP(mreq->m_epg_pa[0]); nd->nd_bextpg = 0; nd->nd_bextpgsiz = PAGE_SIZE; } else { @@ -4891,7 +4890,7 @@ nfsm_set(struct nfsrv_descript *nd, u_int offs, bool b m = nd->nd_md; if ((m->m_flags & M_NOMAP) != 0) { if (build) { - pgs = m->m_ext.ext_pgs; + pgs = &m->m_ext_pgs; nd->nd_bextpg = 0; while (offs > 0) { if (nd->nd_bextpg == 0) @@ -4912,7 +4911,7 @@ nfsm_set(struct nfsrv_descript *nd, u_int offs, bool b } } nd->nd_bpos = (char *)(void *) - PHYS_TO_DMAP(pgs->pa[nd->nd_bextpg]); + PHYS_TO_DMAP(m->m_epg_pa[nd->nd_bextpg]); if (nd->nd_bextpg == 0) nd->nd_bpos += pgs->first_pg_off; if (offs > 0) { @@ -4924,11 +4923,11 @@ nfsm_set(struct nfsrv_descript *nd, u_int offs, bool b else rlen = nd->nd_bextpgsiz = PAGE_SIZE; } else { - pgs = m->m_ext.ext_pgs; + pgs = &m->m_ext_pgs; nd->nd_dextpg = 0; do { nd->nd_dpos = (char *)(void *) - PHYS_TO_DMAP(pgs->pa[nd->nd_dextpg]); + PHYS_TO_DMAP(m->m_epg_pa[nd->nd_dextpg]); if (nd->nd_dextpg == 0) { nd->nd_dpos += pgs->first_pg_off; rlen = nd->nd_dextpgsiz = @@ -5004,7 +5003,7 @@ nfsm_copyfrommbuf_extpgs(struct nfsrv_descript *nd, ch struct mbuf_ext_pgs *pgs; int tlen, xfer; - pgs = nd->nd_md->m_ext.ext_pgs; + pgs = &nd->nd_md->m_ext_pgs; tlen = 0; /* Copy from the page(s) into cp. */ do { @@ -5025,7 +5024,7 @@ nfsm_copyfrommbuf_extpgs(struct nfsrv_descript *nd, ch nd->nd_dextpg < pgs->npgs - 1) { nd->nd_dextpg++; nd->nd_dpos = (char *)(void *) - PHYS_TO_DMAP(pgs->pa[nd->nd_dextpg]); + PHYS_TO_DMAP(nd->nd_md->m_epg_pa[nd->nd_dextpg]); nd->nd_dextpgsiz = mbuf_ext_pg_len(pgs, nd->nd_dextpg, 0); } @@ -5045,18 +5044,18 @@ nfsm_splitatpgno(struct mbuf *mp, int pgno, int how) KASSERT((mp->m_flags & (M_EXT | M_NOMAP)) == (M_EXT | M_NOMAP), ("nfsm_splitatpgno: mp not ext_pgs")); - pgs = mp->m_ext.ext_pgs; + pgs = &mp->m_ext_pgs; KASSERT(pgno < pgs->npgs - 1, ("nfsm_splitatpgno:" " at the last page")); - m = mb_alloc_ext_pgs(how, false, mb_free_mext_pgs); + m = mb_alloc_ext_pgs(how, mb_free_mext_pgs); if (m == NULL) return (m); - pgs0 = m->m_ext.ext_pgs; + pgs0 = &m->m_ext_pgs; pgs0->flags |= MBUF_PEXT_FLAG_ANON; /* Move the pages beyond pgno to the new mbuf. */ for (i = pgno + 1, j = 0; i < pgs->npgs; i++, j++) - pgs0->pa[j] = pgs->pa[i]; + m->m_epg_pa[j] = mp->m_epg_pa[i]; pgs0->npgs = j; pgs0->last_pg_len = pgs->last_pg_len; pgs->npgs = pgno + 1; @@ -5108,10 +5107,10 @@ nfsm_add_ext_pgs(struct mbuf *m, int maxextsiz, int *b struct mbuf *mp; vm_page_t pg; - pgs = m->m_ext.ext_pgs; + pgs = &m->m_ext_pgs; if ((pgs->npgs + 1) * PAGE_SIZE > maxextsiz) { mp = mb_alloc_ext_plus_pages(PAGE_SIZE, M_WAITOK, - false, mb_free_mext_pgs); + mb_free_mext_pgs); *bextpg = 0; m->m_next = mp; } else { @@ -5122,7 +5121,7 @@ nfsm_add_ext_pgs(struct mbuf *m, int maxextsiz, int *b if (pg == NULL) vm_wait(NULL); } while (pg == NULL); - pgs->pa[pgs->npgs] = VM_PAGE_TO_PHYS(pg); + m->m_epg_pa[pgs->npgs] = VM_PAGE_TO_PHYS(pg); *bextpg = pgs->npgs; pgs->npgs++; pgs->last_pg_len = 0; @@ -5141,7 +5140,7 @@ nfsm_extpgs_calc_offs(struct mbuf *m, int dextpg, int int cnt, offs; offs = 0; - pgs = m->m_ext.ext_pgs; + pgs = &m->m_ext_pgs; for (cnt = 0; cnt < dextpg; cnt++) { if (cnt == 0) offs += mbuf_ext_pg_len(pgs, 0, Modified: projects/nfs-over-tls/sys/fs/nfs/nfsm_subs.h ============================================================================== --- projects/nfs-over-tls/sys/fs/nfs/nfsm_subs.h Thu Apr 23 04:51:32 2020 (r360215) +++ projects/nfs-over-tls/sys/fs/nfs/nfsm_subs.h Thu Apr 23 04:59:07 2020 (r360216) @@ -81,16 +81,16 @@ nfsm_build(struct nfsrv_descript *nd, int siz) } else if ((nd->nd_flag & ND_NOMAP) != 0) { if (siz > nd->nd_bextpgsiz) { mb2 = mb_alloc_ext_plus_pages(PAGE_SIZE, M_WAITOK, - false, mb_free_mext_pgs); + mb_free_mext_pgs); nd->nd_bpos = (char *)(void *) - PHYS_TO_DMAP(mb2->m_ext.ext_pgs->pa[0]); + PHYS_TO_DMAP(mb2->m_epg_pa[0]); nd->nd_bextpg = 0; nd->nd_bextpgsiz = PAGE_SIZE - siz; nd->nd_mb->m_next = mb2; nd->nd_mb = mb2; } else nd->nd_bextpgsiz -= siz; - nd->nd_mb->m_ext.ext_pgs->last_pg_len += siz; + nd->nd_mb->m_ext_pgs.last_pg_len += siz; } retp = (void *)(nd->nd_bpos); nd->nd_mb->m_len += siz; Modified: projects/nfs-over-tls/sys/fs/nfsclient/nfs_clcomsubs.c ============================================================================== --- projects/nfs-over-tls/sys/fs/nfsclient/nfs_clcomsubs.c Thu Apr 23 04:51:32 2020 (r360215) +++ projects/nfs-over-tls/sys/fs/nfsclient/nfs_clcomsubs.c Thu Apr 23 04:59:07 2020 (r360216) @@ -91,7 +91,7 @@ nfsm_uiombuf(struct nfsrv_descript *nd, struct uio *ui mp = nfsm_add_ext_pgs(mp, nd->nd_maxextsiz, &nd->nd_bextpg); mcp = (char *)(void *)PHYS_TO_DMAP( - mp->m_ext.ext_pgs->pa[nd->nd_bextpg]); + mp->m_epg_pa[nd->nd_bextpg]); nd->nd_bextpgsiz = PAGE_SIZE; } else { if (clflg) @@ -116,7 +116,7 @@ nfsm_uiombuf(struct nfsrv_descript *nd, struct uio *ui mcp += xfer; if ((nd->nd_flag & ND_NOMAP) != 0) { nd->nd_bextpgsiz -= xfer; - mp->m_ext.ext_pgs->last_pg_len += xfer; + mp->m_ext_pgs.last_pg_len += xfer; } uiop->uio_offset += xfer; uiop->uio_resid -= xfer; @@ -139,7 +139,7 @@ nfsm_uiombuf(struct nfsrv_descript *nd, struct uio *ui mp = nfsm_add_ext_pgs(mp, nd->nd_maxextsiz, &nd->nd_bextpg); mcp = (char *)(void *) - PHYS_TO_DMAP(mp->m_ext.ext_pgs->pa[nd->nd_bextpg]); + PHYS_TO_DMAP(mp->m_epg_pa[nd->nd_bextpg]); nd->nd_bextpgsiz = PAGE_SIZE; } for (left = 0; left < rem; left++) @@ -148,7 +148,7 @@ nfsm_uiombuf(struct nfsrv_descript *nd, struct uio *ui nd->nd_bpos = mcp; if ((nd->nd_flag & ND_NOMAP) != 0) { nd->nd_bextpgsiz -= rem; - mp->m_ext.ext_pgs->last_pg_len += rem; + mp->m_ext_pgs.last_pg_len += rem; } } else nd->nd_bpos = mcp; @@ -186,9 +186,9 @@ nfsm_uiombuflist(bool doextpgs, int maxextsiz, struct rem = NFSM_RNDUP(siz) - siz; if (doextpgs) { mp = mb_alloc_ext_plus_pages(PAGE_SIZE, M_WAITOK, - false, mb_free_mext_pgs); + mb_free_mext_pgs); mcp = (char *)(void *) - PHYS_TO_DMAP(mp->m_ext.ext_pgs->pa[0]); + PHYS_TO_DMAP(mp->m_epg_pa[0]); bextpgsiz = PAGE_SIZE; bextpg = 0; } else { @@ -216,7 +216,7 @@ nfsm_uiombuflist(bool doextpgs, int maxextsiz, struct mp = nfsm_add_ext_pgs(mp, maxextsiz, &bextpg); mcp = (char *)(void *)PHYS_TO_DMAP( - mp->m_ext.ext_pgs->pa[bextpg]); + mp->m_epg_pa[bextpg]); mlen = bextpgsiz = PAGE_SIZE; } else { if (clflg) @@ -241,7 +241,7 @@ nfsm_uiombuflist(bool doextpgs, int maxextsiz, struct mcp += xfer; if (doextpgs) { bextpgsiz -= xfer; - mp->m_ext.ext_pgs->last_pg_len += xfer; + mp->m_ext_pgs.last_pg_len += xfer; } uiop->uio_offset += xfer; uiop->uio_resid -= xfer; @@ -256,7 +256,7 @@ nfsm_uiombuflist(bool doextpgs, int maxextsiz, struct *mcp++ = '\0'; mp->m_len++; if (doextpgs) - mp->m_ext.ext_pgs->last_pg_len++; + mp->m_ext_pgs.last_pg_len++; } if (cpp != NULL) *cpp = mcp; Modified: projects/nfs-over-tls/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- projects/nfs-over-tls/sys/fs/nfsserver/nfs_nfsdport.c Thu Apr 23 04:51:32 2020 (r360215) +++ projects/nfs-over-tls/sys/fs/nfsserver/nfs_nfsdport.c Thu Apr 23 04:59:07 2020 (r360216) @@ -863,10 +863,10 @@ nfsrv_createiovec_extpgs(int len, int maxextsiz, struc i = 0; while (left > 0) { siz = min(left, maxextsiz); - m = mb_alloc_ext_plus_pages(siz, M_WAITOK, false, + m = mb_alloc_ext_plus_pages(siz, M_WAITOK, mb_free_mext_pgs); left -= siz; - i += m->m_ext.ext_pgs->npgs; + i += m->m_ext_pgs.npgs; if (m3 != NULL) m2->m_next = m; else @@ -878,13 +878,13 @@ nfsrv_createiovec_extpgs(int len, int maxextsiz, struc left = len; i = 0; pgno = 0; - pgs = m->m_ext.ext_pgs; + pgs = &m->m_ext_pgs; while (left > 0) { if (m == NULL) panic("nfsvno_createiovec_extpgs iov"); siz = min(PAGE_SIZE, left); if (siz > 0) { - iv->iov_base = (void *)PHYS_TO_DMAP(pgs->pa[pgno]); + iv->iov_base = (void *)PHYS_TO_DMAP(m->m_epg_pa[pgno]); iv->iov_len = siz; m->m_len += siz; if (pgno == pgs->npgs - 1) @@ -898,7 +898,7 @@ nfsrv_createiovec_extpgs(int len, int maxextsiz, struc m = m->m_next; if (m == NULL) panic("nfsvno_createiovec_extpgs iov"); - pgs = m->m_ext.ext_pgs; + pgs = &m->m_ext_pgs; pgno = 0; } } @@ -1053,7 +1053,7 @@ nfsrv_createiovecw_extpgs(int retlen, struct mbuf *m, cnt = 0; len = retlen; mp = m; - pgs = mp->m_ext.ext_pgs; + pgs = &mp->m_ext_pgs; i = dextpgsiz; pgno = dextpg; while (len > 0) { @@ -1067,7 +1067,7 @@ nfsrv_createiovecw_extpgs(int retlen, struct mbuf *m, if (mp == NULL) return (EBADRPC); pgno = 0; - pgs = mp->m_ext.ext_pgs; + pgs = &mp->m_ext_pgs; } else pgno++; if (pgno == 0) @@ -1084,7 +1084,7 @@ nfsrv_createiovecw_extpgs(int retlen, struct mbuf *m, M_WAITOK); *iovcntp = cnt; len = retlen; - pgs = mp->m_ext.ext_pgs; + pgs = &mp->m_ext_pgs; i = dextpgsiz; pgno = dextpg; while (len > 0) { @@ -1101,11 +1101,11 @@ nfsrv_createiovecw_extpgs(int retlen, struct mbuf *m, if (mp == NULL) return (EBADRPC); pgno = 0; - pgs = mp->m_ext.ext_pgs; + pgs = &mp->m_ext_pgs; } else pgno++; cp = (char *)(void *) - PHYS_TO_DMAP(pgs->pa[pgno]); + PHYS_TO_DMAP(mp->m_epg_pa[pgno]); if (pgno == 0) { cp += pgs->first_pg_off; i = mbuf_ext_pg_len(pgs, 0, Modified: projects/nfs-over-tls/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- projects/nfs-over-tls/sys/fs/nfsserver/nfs_nfsdserv.c Thu Apr 23 04:51:32 2020 (r360215) +++ projects/nfs-over-tls/sys/fs/nfsserver/nfs_nfsdserv.c Thu Apr 23 04:59:07 2020 (r360216) @@ -704,10 +704,10 @@ nfsrvd_readlink(struct nfsrv_descript *nd, __unused in nd->nd_mb->m_next = mp; nd->nd_mb = mpend; if ((mpend->m_flags & M_NOMAP) != 0) { - pgs = mpend->m_ext.ext_pgs; + pgs = &mpend->m_ext_pgs; nd->nd_bextpg = pgs->npgs - 1; nd->nd_bpos = (char *)(void *) - PHYS_TO_DMAP(pgs->pa[nd->nd_bextpg]); + PHYS_TO_DMAP(mpend->m_epg_pa[nd->nd_bextpg]); off = (nd->nd_bextpg == 0) ? pgs->first_pg_off : 0; nd->nd_bpos += off + pgs->last_pg_len; nd->nd_bextpgsiz = PAGE_SIZE - pgs->last_pg_len - off; @@ -909,10 +909,10 @@ nfsrvd_read(struct nfsrv_descript *nd, __unused int is nd->nd_mb = m2; if ((m2->m_flags & M_NOMAP) != 0) { nd->nd_flag |= ND_NOMAP; - pgs = m2->m_ext.ext_pgs; + pgs = &m2->m_ext_pgs; nd->nd_bextpg = pgs->npgs - 1; nd->nd_bpos = (char *)(void *) - PHYS_TO_DMAP(pgs->pa[nd->nd_bextpg]); + PHYS_TO_DMAP(m2->m_epg_pa[nd->nd_bextpg]); poff = (nd->nd_bextpg == 0) ? pgs->first_pg_off : 0; nd->nd_bpos += poff + pgs->last_pg_len; nd->nd_bextpgsiz = PAGE_SIZE - pgs->last_pg_len - poff; @@ -5614,10 +5614,10 @@ nfsrvd_getxattr(struct nfsrv_descript *nd, __unused in nd->nd_mb = mpend; if ((mpend->m_flags & M_NOMAP) != 0) { nd->nd_flag |= ND_NOMAP; - pgs = mpend->m_ext.ext_pgs; + pgs = &mpend->m_ext_pgs; nd->nd_bextpg = pgs->npgs - 1; nd->nd_bpos = (char *)(void *) - PHYS_TO_DMAP(pgs->pa[nd->nd_bextpg]); + PHYS_TO_DMAP(mpend->m_epg_pa[nd->nd_bextpg]); off = (nd->nd_bextpg == 0) ? pgs->first_pg_off : 0; nd->nd_bpos += off + pgs->last_pg_len; Modified: projects/nfs-over-tls/sys/fs/nfsserver/nfs_nfsdsubs.c ============================================================================== --- projects/nfs-over-tls/sys/fs/nfsserver/nfs_nfsdsubs.c Thu Apr 23 04:51:32 2020 (r360215) +++ projects/nfs-over-tls/sys/fs/nfsserver/nfs_nfsdsubs.c Thu Apr 23 04:59:07 2020 (r360216) @@ -1320,7 +1320,7 @@ nfsrv_adj(struct mbuf *mp, int len, int nul) /* Adjust the last mbuf. */ if ((m->m_flags & M_NOMAP) != 0) { - pgs = m->m_ext.ext_pgs; + pgs = &m->m_ext_pgs; pgno = pgs->npgs - 1; off = (pgno == 0) ? pgs->first_pg_off : 0; plen = mbuf_ext_pg_len(pgs, pgno, off); @@ -1329,7 +1329,7 @@ nfsrv_adj(struct mbuf *mp, int len, int nul) trim = m->m_len - lastlen; while (trim >= plen) { /* Free page. */ - pg = PHYS_TO_VM_PAGE(pgs->pa[pgno]); + pg = PHYS_TO_VM_PAGE(m->m_epg_pa[pgno]); vm_page_unwire_noq(pg); vm_page_free(pg); trim -= plen; @@ -1342,7 +1342,7 @@ nfsrv_adj(struct mbuf *mp, int len, int nul) pgs->last_pg_len = plen; m->m_len = lastlen; } - cp = (char *)(void *)PHYS_TO_DMAP(pgs->pa[pgno]); + cp = (char *)(void *)PHYS_TO_DMAP(m->m_epg_pa[pgno]); cp += off + plen - nul; } else { m->m_len = lastlen; @@ -1921,21 +1921,22 @@ nfsrv_parsename(struct nfsrv_descript *nd, char *bufp, while (rem == 0) { if ((nd->nd_md->m_flags & M_NOMAP) != 0 && nd->nd_dextpg < - nd->nd_md->m_ext.ext_pgs->npgs - 1) { - pgs = nd->nd_md->m_ext.ext_pgs; + nd->nd_md->m_ext_pgs.npgs - 1) { + pgs = &nd->nd_md->m_ext_pgs; pg = PHYS_TO_VM_PAGE( - pgs->pa[nd->nd_dextpg]); + nd->nd_md->m_epg_pa[nd->nd_dextpg]); vm_page_unwire_noq(pg); vm_page_free(pg); for (i = nd->nd_bextpg; i < pgs->npgs - 1; i++) - pgs->pa[i] = pgs->pa[i + 1]; + nd->nd_md->m_epg_pa[i] = + nd->nd_md->m_epg_pa[i + 1]; pgs->npgs--; if (nd->nd_dextpg == 0) pgs->first_pg_off = 0; fromcp = nd->nd_dpos = (char *)(void *) PHYS_TO_DMAP( - pgs->pa[nd->nd_dextpg]); + nd->nd_md->m_epg_pa[nd->nd_dextpg]); rem = nd->nd_dextpgsiz = mbuf_ext_pg_len(pgs, nd->nd_dextpg, 0); Modified: projects/nfs-over-tls/sys/kern/kern_mbuf.c ============================================================================== --- projects/nfs-over-tls/sys/kern/kern_mbuf.c Thu Apr 23 04:51:32 2020 (r360215) +++ projects/nfs-over-tls/sys/kern/kern_mbuf.c Thu Apr 23 04:59:07 2020 (r360216) @@ -1568,16 +1568,16 @@ m_snd_tag_destroy(struct m_snd_tag *mst) * Allocate an mbuf with anonymous external pages. */ struct mbuf * -mb_alloc_ext_plus_pages(int len, int how, bool pkthdr, m_ext_free_t ext_free) +mb_alloc_ext_plus_pages(int len, int how, m_ext_free_t ext_free) { struct mbuf *m; vm_page_t pg; int i, npgs; - m = mb_alloc_ext_pgs(how, pkthdr, ext_free); + m = mb_alloc_ext_pgs(how, ext_free); if (m == NULL) return (NULL); - m->m_ext.ext_pgs->flags |= MBUF_PEXT_FLAG_ANON; + m->m_ext_pgs.flags |= MBUF_PEXT_FLAG_ANON; npgs = howmany(len, PAGE_SIZE); for (i = 0; i < npgs; i++) { do { @@ -1585,16 +1585,16 @@ mb_alloc_ext_plus_pages(int len, int how, bool pkthdr, VM_ALLOC_NOOBJ | VM_ALLOC_NODUMP | VM_ALLOC_WIRED); if (pg == NULL) { if (how == M_NOWAIT) { - m->m_ext.ext_pgs->npgs = i; + m->m_ext_pgs.npgs = i; m_free(m); return (NULL); } vm_wait(NULL); } } while (pg == NULL); - m->m_ext.ext_pgs->pa[i] = VM_PAGE_TO_PHYS(pg); + m->m_epg_pa[i] = VM_PAGE_TO_PHYS(pg); } - m->m_ext.ext_pgs->npgs = npgs; + m->m_ext_pgs.npgs = npgs; return (m); } @@ -1604,7 +1604,7 @@ mb_alloc_ext_plus_pages(int len, int how, bool pkthdr, * mlen is the maximum number of bytes put into each ext_page mbuf. */ struct mbuf * -mb_copym_ext_pgs(struct mbuf *mp, int len, int mlen, int how, bool pkthdr, +mb_copym_ext_pgs(struct mbuf *mp, int len, int mlen, int how, m_ext_free_t ext_free, struct mbuf **mlast) { struct mbuf *m, *mout = NULL; @@ -1617,20 +1617,18 @@ mb_copym_ext_pgs(struct mbuf *mp, int len, int mlen, i pglen = mblen = 0; do { if (pglen == 0) { - if (m == NULL || ++i == m->m_ext.ext_pgs->npgs) { + if (m == NULL || ++i == m->m_ext_pgs.npgs) { mbufsiz = min(mlen, len); if (m == NULL) { m = mout = mb_alloc_ext_plus_pages( - mbufsiz, how, pkthdr, ext_free); + mbufsiz, how, ext_free); if (m == NULL) return (m); - if (pkthdr) - m->m_pkthdr.len = len; } else { - m->m_ext.ext_pgs->last_pg_len = + m->m_ext_pgs.last_pg_len = PAGE_SIZE; m->m_next = mb_alloc_ext_plus_pages( - mbufsiz, how, false, ext_free); + mbufsiz, how, ext_free); m = m->m_next; if (m == NULL) { m_freem(mout); @@ -1640,7 +1638,7 @@ mb_copym_ext_pgs(struct mbuf *mp, int len, int mlen, i i = 0; } pgpos = (char *)(void *) - PHYS_TO_DMAP(m->m_ext.ext_pgs->pa[i]); + PHYS_TO_DMAP(m->m_epg_pa[i]); pglen = PAGE_SIZE; } while (mblen == 0) { @@ -1663,7 +1661,7 @@ mb_copym_ext_pgs(struct mbuf *mp, int len, int mlen, i len -= xfer; m->m_len += xfer; } while (len > 0); - m->m_ext.ext_pgs->last_pg_len = PAGE_SIZE - pglen; + m->m_ext_pgs.last_pg_len = PAGE_SIZE - pglen; if (mlast != NULL) *mlast = m; return (mout); @@ -1704,7 +1702,7 @@ mb_splitatpos_ext(struct mbuf *m0, int len, int how) KASSERT((mp->m_flags & (M_EXT | M_NOMAP)) == (M_EXT | M_NOMAP), ("mb_splitatpos_ext: m0 not ext_pgs")); - pgs = mp->m_ext.ext_pgs; + pgs = &mp->m_ext_pgs; KASSERT((pgs->flags & MBUF_PEXT_FLAG_ANON) != 0, ("mb_splitatpos_ext: not anonymous pages")); pgno = 0; @@ -1724,10 +1722,10 @@ mb_splitatpos_ext(struct mbuf *m0, int len, int how) panic("mb_splitatpos_ext"); mp->m_len = len; - m = mb_alloc_ext_pgs(how, false, mb_free_mext_pgs); + m = mb_alloc_ext_pgs(how, mb_free_mext_pgs); if (m == NULL) return (NULL); - pgs0 = m->m_ext.ext_pgs; + pgs0 = &m->m_ext_pgs; pgs0->flags |= MBUF_PEXT_FLAG_ANON; /* @@ -1748,11 +1746,11 @@ mb_splitatpos_ext(struct mbuf *m0, int len, int how) vm_wait(NULL); } } while (pg == NULL); - pgs0->pa[0] = VM_PAGE_TO_PHYS(pg); + m->m_epg_pa[0] = VM_PAGE_TO_PHYS(pg); pgs0->npgs++; trim = plen - left; - cp = (char *)(void *)PHYS_TO_DMAP(pgs->pa[pgno]); - cp0 = (char *)(void *)PHYS_TO_DMAP(pgs0->pa[0]); + cp = (char *)(void *)PHYS_TO_DMAP(mp->m_epg_pa[pgno]); + cp0 = (char *)(void *)PHYS_TO_DMAP(m->m_epg_pa[0]); if (pgno == 0) cp += pgs->first_pg_off; cp += left; @@ -1770,7 +1768,7 @@ mb_splitatpos_ext(struct mbuf *m0, int len, int how) /* Move the pages beyond pgno to the new mbuf. */ for (i = pgno + 1, j = pgs0->npgs; i < pgs->npgs; i++, j++) { - pgs0->pa[j] = pgs->pa[i]; + m->m_epg_pa[j] = mp->m_epg_pa[i]; /* Never moves page 0. */ m->m_len += mbuf_ext_pg_len(pgs, i, 0); } Modified: projects/nfs-over-tls/sys/rpc/clnt_vc.c ============================================================================== --- projects/nfs-over-tls/sys/rpc/clnt_vc.c Thu Apr 23 04:51:32 2020 (r360215) +++ projects/nfs-over-tls/sys/rpc/clnt_vc.c Thu Apr 23 04:59:07 2020 (r360216) @@ -540,7 +540,7 @@ if (cr->cr_mrep != NULL) { txxxx = m_length(cr->cr_mrep, NULL); if (txxxx > 0) { m = mb_copym_ext_pgs(cr->cr_mrep, txxxx, 16384, M_WAITOK, - false, mb_free_mext_pgs, &m2); + mb_free_mext_pgs, &m2); m2 = cr->cr_mrep; cr->cr_mrep = m; m_freem(m2); Modified: projects/nfs-over-tls/sys/rpc/rpc_generic.c ============================================================================== --- projects/nfs-over-tls/sys/rpc/rpc_generic.c Thu Apr 23 04:51:32 2020 (r360215) +++ projects/nfs-over-tls/sys/rpc/rpc_generic.c Thu Apr 23 04:59:07 2020 (r360216) @@ -912,13 +912,12 @@ _rpc_copym_into_ext_pgs(struct mbuf *mp, int maxextsiz */ m2->m_next = NULL; mhead = mb_copym_ext_pgs(mp, tlen, maxextsiz, M_WAITOK, - true, mb_free_mext_pgs, &m2); + mb_free_mext_pgs, &m2); /* * Link the ext_pgs list onto the newly copied * list and free up the non-ext_pgs mbuf(s). */ - mhead->m_pkthdr.len = mp->m_pkthdr.len; m2->m_next = m; m_freem(mp); @@ -949,8 +948,7 @@ _rpc_copym_into_ext_pgs(struct mbuf *mp, int maxextsiz else m2 = m; } else { - MBUF_EXT_PGS_ASSERT_SANITY( - m2->m_ext.ext_pgs); + MBUF_EXT_PGS_ASSERT_SANITY(&m2->m_ext_pgs); m3 = m2; tlen += m2->m_len; m2 = m2->m_next; Modified: projects/nfs-over-tls/sys/rpc/svc_vc.c ============================================================================== --- projects/nfs-over-tls/sys/rpc/svc_vc.c Thu Apr 23 04:51:32 2020 (r360215) +++ projects/nfs-over-tls/sys/rpc/svc_vc.c Thu Apr 23 04:59:07 2020 (r360216) @@ -608,7 +608,7 @@ svc_vc_process_pending(SVCXPRT *xprt) txxxx = m_length(m3, NULL); if (txxxx > 0) { m1 = mb_copym_ext_pgs(m3, txxxx, 16384, M_WAITOK, - false, mb_free_mext_pgs, &m2); + mb_free_mext_pgs, &m2); if (m4 != NULL) { m4->m_next = m1; m_freem(m3); @@ -882,7 +882,7 @@ if (m != NULL) { txxxx = m_length(m, NULL); if (txxxx > 0) { m1 = mb_copym_ext_pgs(m, txxxx, 16384, M_WAITOK, - false, mb_free_mext_pgs, &m2); + mb_free_mext_pgs, &m2); m2 = m; m = m1; m_freem(m2); Modified: projects/nfs-over-tls/sys/sys/mbuf.h ============================================================================== --- projects/nfs-over-tls/sys/sys/mbuf.h Thu Apr 23 04:51:32 2020 (r360215) +++ projects/nfs-over-tls/sys/sys/mbuf.h Thu Apr 23 04:59:07 2020 (r360216) @@ -694,8 +694,8 @@ void mb_dupcl(struct mbuf *, struct mbuf *); void mb_free_ext(struct mbuf *); void mb_free_mext_pgs(struct mbuf *); struct mbuf *mb_alloc_ext_pgs(int, m_ext_free_t); -struct mbuf *mb_alloc_ext_plus_pages(int, int, bool, m_ext_free_t); -struct mbuf *mb_copym_ext_pgs(struct mbuf *, int, int, int, bool, +struct mbuf *mb_alloc_ext_plus_pages(int, int, m_ext_free_t); +struct mbuf *mb_copym_ext_pgs(struct mbuf *, int, int, int, m_ext_free_t, struct mbuf **); struct mbuf *mb_splitatpos_ext(struct mbuf *, int, int); int mb_unmapped_compress(struct mbuf *m);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202004230459.03N4x76E056821>