Date: Wed, 6 May 2020 00:44:03 +0000 (UTC) From: Rick Macklem <rmacklem@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360678 - head/sys/fs/nfs Message-ID: <202005060044.0460i3IW029960@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: rmacklem Date: Wed May 6 00:44:03 2020 New Revision: 360678 URL: https://svnweb.freebsd.org/changeset/base/360678 Log: Delete unused function newnfs_trimleading. The NFS function called newnfs_trimleading() has not been used by the code in long time. To give you a clue, it still had a K&R style function declaration. Delete it, since it is just cruft, as a part of the NFS mbuf handling cleanup in preparation for adding ext_pgs mbuf support. The ext_pgs mbuf support for the build/send side is needed by nfs-over-tls. Modified: head/sys/fs/nfs/nfs_commonsubs.c head/sys/fs/nfs/nfs_var.h Modified: head/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- head/sys/fs/nfs/nfs_commonsubs.c Wed May 6 00:25:43 2020 (r360677) +++ head/sys/fs/nfs/nfs_commonsubs.c Wed May 6 00:44:03 2020 (r360678) @@ -1006,53 +1006,6 @@ nfsaddr2_match(NFSSOCKADDR_T nam1, NFSSOCKADDR_T nam2) return (0); } - -/* - * Trim the stuff already dissected off the mbuf list. - */ -APPLESTATIC void -newnfs_trimleading(nd) - struct nfsrv_descript *nd; -{ - struct mbuf *m, *n; - int offs; - - /* - * First, free up leading mbufs. - */ - if (nd->nd_mrep != nd->nd_md) { - m = nd->nd_mrep; - while (m->m_next != nd->nd_md) { - if (m->m_next == NULL) - panic("nfsm trim leading"); - m = m->m_next; - } - m->m_next = NULL; - m_freem(nd->nd_mrep); - } - m = nd->nd_md; - - /* - * Now, adjust this mbuf, based on nd_dpos. - */ - offs = nd->nd_dpos - mtod(m, caddr_t); - if (offs == m->m_len) { - n = m; - m = m->m_next; - if (m == NULL) - panic("nfsm trim leading2"); - n->m_next = NULL; - m_freem(n); - } else if (offs > 0) { - m->m_len -= offs; - m->m_data += offs; - } else if (offs < 0) - panic("nfsm trimleading offs"); - nd->nd_mrep = m; - nd->nd_md = m; - nd->nd_dpos = mtod(m, caddr_t); -} - /* * Trim trailing data off the mbuf list being built. */ Modified: head/sys/fs/nfs/nfs_var.h ============================================================================== --- head/sys/fs/nfs/nfs_var.h Wed May 6 00:25:43 2020 (r360677) +++ head/sys/fs/nfs/nfs_var.h Wed May 6 00:44:03 2020 (r360678) @@ -324,7 +324,6 @@ int nfsm_mbufuio(struct nfsrv_descript *, struct uio * int nfsm_fhtom(struct nfsrv_descript *, u_int8_t *, int, int); int nfsm_advance(struct nfsrv_descript *, int, int); void *nfsm_dissct(struct nfsrv_descript *, int, int); -void newnfs_trimleading(struct nfsrv_descript *); void newnfs_trimtrailing(struct nfsrv_descript *, struct mbuf *, caddr_t); void newnfs_copycred(struct nfscred *, struct ucred *);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202005060044.0460i3IW029960>