Use m_get(), m_gethdr() and m_getcl() instead of historic macros.

Sponsored by:	Nginx, Inc.
This commit is contained in:
Gleb Smirnoff 2013-03-12 12:17:19 +00:00
parent 3b4a84e757
commit bd54830bcb
7 changed files with 8 additions and 15 deletions

View File

@ -431,7 +431,7 @@ clnt_dg_call(
send_again:
mtx_unlock(&cs->cs_lock);
MGETHDR(mreq, M_WAITOK, MT_DATA);
mreq = m_gethdr(M_WAITOK, MT_DATA);
KASSERT(cu->cu_mcalllen <= MHLEN, ("RPC header too big"));
bcopy(cu->cu_mcallc, mreq->m_data, cu->cu_mcalllen);
mreq->m_len = cu->cu_mcalllen;

View File

@ -349,7 +349,7 @@ clnt_vc_call(
/*
* Leave space to pre-pend the record mark.
*/
MGETHDR(mreq, M_WAITOK, MT_DATA);
mreq = m_gethdr(M_WAITOK, MT_DATA);
mreq->m_data += sizeof(uint32_t);
KASSERT(ct->ct_mpos + sizeof(uint32_t) <= MHLEN,
("RPC header too big"));

View File

@ -750,9 +750,7 @@ clnt_call_private(
struct mbuf *mrep;
enum clnt_stat stat;
MGET(mreq, M_WAITOK, MT_DATA);
MCLGET(mreq, M_WAITOK);
mreq->m_len = 0;
mreq = m_getcl(M_WAITOK, MT_DATA, 0);
xdrmbuf_create(&xdrs, mreq, XDR_ENCODE);
if (!xargs(&xdrs, argsp)) {

View File

@ -80,7 +80,7 @@
#define rpcm_build(a,c,s) \
{ if ((s) > M_TRAILINGSPACE(mb)) { \
MGET(mb2, M_WAITOK, MT_DATA); \
mb2 = m_get(M_WAITOK, MT_DATA); \
if ((s) > MLEN) \
panic("build > MLEN"); \
mb->m_next = mb2; \

View File

@ -563,9 +563,7 @@ svc_sendreply(struct svc_req *rqstp, xdrproc_t xdr_results, void * xdr_location)
rply.acpted_rply.ar_results.where = NULL;
rply.acpted_rply.ar_results.proc = (xdrproc_t) xdr_void;
MGET(m, M_WAITOK, MT_DATA);
MCLGET(m, M_WAITOK);
m->m_len = 0;
m = m_getcl(M_WAITOK, MT_DATA, 0);
xdrmbuf_create(&xdrs, m, XDR_ENCODE);
ok = xdr_results(&xdrs, xdr_location);
XDR_DESTROY(&xdrs);

View File

@ -238,8 +238,7 @@ svc_dg_reply(SVCXPRT *xprt, struct rpc_msg *msg,
bool_t stat = TRUE;
int error;
MGETHDR(mrep, M_WAITOK, MT_DATA);
mrep->m_len = 0;
mrep = m_gethdr(M_WAITOK, MT_DATA);
xdrmbuf_create(&xdrs, mrep, XDR_ENCODE);

View File

@ -796,8 +796,7 @@ svc_vc_reply(SVCXPRT *xprt, struct rpc_msg *msg,
/*
* Leave space for record mark.
*/
MGETHDR(mrep, M_WAITOK, MT_DATA);
mrep->m_len = 0;
mrep = m_gethdr(M_WAITOK, MT_DATA);
mrep->m_data += sizeof(uint32_t);
xdrmbuf_create(&xdrs, mrep, XDR_ENCODE);
@ -850,8 +849,7 @@ svc_vc_backchannel_reply(SVCXPRT *xprt, struct rpc_msg *msg,
/*
* Leave space for record mark.
*/
MGETHDR(mrep, M_WAITOK, MT_DATA);
mrep->m_len = 0;
mrep = m_gethdr(M_WAITOK, MT_DATA);
mrep->m_data += sizeof(uint32_t);
xdrmbuf_create(&xdrs, mrep, XDR_ENCODE);