Date: Tue, 12 Mar 2013 12:17:19 +0000 (UTC) From: Gleb Smirnoff <glebius@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r248195 - head/sys/rpc Message-ID: <201303121217.r2CCHJ2J069478@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: glebius Date: Tue Mar 12 12:17:19 2013 New Revision: 248195 URL: http://svnweb.freebsd.org/changeset/base/248195 Log: Use m_get(), m_gethdr() and m_getcl() instead of historic macros. Sponsored by: Nginx, Inc. Modified: head/sys/rpc/clnt_dg.c head/sys/rpc/clnt_vc.c head/sys/rpc/rpc_generic.c head/sys/rpc/rpcm_subs.h head/sys/rpc/svc.c head/sys/rpc/svc_dg.c head/sys/rpc/svc_vc.c Modified: head/sys/rpc/clnt_dg.c ============================================================================== --- head/sys/rpc/clnt_dg.c Tue Mar 12 12:15:24 2013 (r248194) +++ head/sys/rpc/clnt_dg.c Tue Mar 12 12:17:19 2013 (r248195) @@ -431,7 +431,7 @@ call_again: 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; Modified: head/sys/rpc/clnt_vc.c ============================================================================== --- head/sys/rpc/clnt_vc.c Tue Mar 12 12:15:24 2013 (r248194) +++ head/sys/rpc/clnt_vc.c Tue Mar 12 12:17:19 2013 (r248195) @@ -349,7 +349,7 @@ call_again: /* * 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")); Modified: head/sys/rpc/rpc_generic.c ============================================================================== --- head/sys/rpc/rpc_generic.c Tue Mar 12 12:15:24 2013 (r248194) +++ head/sys/rpc/rpc_generic.c Tue Mar 12 12:17:19 2013 (r248195) @@ -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)) { Modified: head/sys/rpc/rpcm_subs.h ============================================================================== --- head/sys/rpc/rpcm_subs.h Tue Mar 12 12:15:24 2013 (r248194) +++ head/sys/rpc/rpcm_subs.h Tue Mar 12 12:17:19 2013 (r248195) @@ -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; \ Modified: head/sys/rpc/svc.c ============================================================================== --- head/sys/rpc/svc.c Tue Mar 12 12:15:24 2013 (r248194) +++ head/sys/rpc/svc.c Tue Mar 12 12:17:19 2013 (r248195) @@ -563,9 +563,7 @@ svc_sendreply(struct svc_req *rqstp, xdr 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); Modified: head/sys/rpc/svc_dg.c ============================================================================== --- head/sys/rpc/svc_dg.c Tue Mar 12 12:15:24 2013 (r248194) +++ head/sys/rpc/svc_dg.c Tue Mar 12 12:17:19 2013 (r248195) @@ -238,8 +238,7 @@ svc_dg_reply(SVCXPRT *xprt, struct rpc_m 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); Modified: head/sys/rpc/svc_vc.c ============================================================================== --- head/sys/rpc/svc_vc.c Tue Mar 12 12:15:24 2013 (r248194) +++ head/sys/rpc/svc_vc.c Tue Mar 12 12:17:19 2013 (r248195) @@ -796,8 +796,7 @@ svc_vc_reply(SVCXPRT *xprt, struct rpc_m /* * 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, /* * 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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201303121217.r2CCHJ2J069478>