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.
This commit is contained in:
Rick Macklem 2020-05-06 00:44:03 +00:00
parent 4ac4a7f80b
commit 04d6c514b0
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=360678
2 changed files with 0 additions and 48 deletions

View File

@ -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.
*/

View File

@ -324,7 +324,6 @@ int nfsm_mbufuio(struct nfsrv_descript *, struct uio *, int);
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 *);