From eb1b1807afd1266445720b768b1bdbcdf7655a0a Mon Sep 17 00:00:00 2001 From: Gleb Smirnoff Date: Wed, 5 Dec 2012 08:04:20 +0000 Subject: [PATCH] Mechanically substitute flags from historic mbuf allocator with malloc(9) flags within sys. Exceptions: - sys/contrib not touched - sys/mbuf.h edited manually --- sys/arm/at91/if_ate.c | 6 +- sys/arm/at91/if_macb.c | 6 +- sys/arm/econa/if_ece.c | 2 +- sys/arm/lpc/if_lpe.c | 2 +- sys/arm/ti/cpsw/if_cpsw.c | 2 +- sys/arm/xscale/ixp425/if_npe.c | 6 +- sys/compat/linux/linux_socket.c | 2 +- sys/compat/ndis/kern_ndis.c | 6 +- sys/fs/nfs/nfs_commonsubs.c | 4 +- sys/fs/nfs/nfsm_subs.h | 2 +- sys/fs/nfsclient/nfs_clcomsubs.c | 4 +- sys/fs/nfsserver/nfs_nfsdcache.c | 8 +- sys/fs/nfsserver/nfs_nfsdport.c | 4 +- sys/fs/nfsserver/nfs_nfsdstate.c | 2 +- sys/kern/subr_mchain.c | 10 +-- sys/kern/uipc_mbuf.c | 20 ++--- sys/kern/uipc_mbuf2.c | 6 +- sys/kern/uipc_sockbuf.c | 8 +- sys/kern/uipc_socket.c | 26 +++--- sys/kern/uipc_syscalls.c | 6 +- sys/mips/adm5120/if_admsw.c | 8 +- sys/mips/atheros/if_arge.c | 4 +- sys/mips/cavium/if_octm.c | 2 +- sys/mips/cavium/octe/ethernet-mem.c | 2 +- sys/mips/cavium/octe/ethernet-rx.c | 2 +- sys/mips/idt/if_kr.c | 2 +- sys/mips/nlm/dev/net/xlpge.c | 2 +- sys/mips/rmi/dev/nlge/if_nlge.c | 2 +- sys/mips/rmi/dev/xlr/rge.c | 2 +- sys/net/bpf.c | 8 +- sys/net/bridgestp.c | 4 +- sys/net/ieee8023ad_lacp.c | 4 +- sys/net/if_arcsubr.c | 10 +-- sys/net/if_atmsubr.c | 2 +- sys/net/if_bridge.c | 18 ++-- sys/net/if_ef.c | 4 +- sys/net/if_ethersubr.c | 10 +-- sys/net/if_fddisubr.c | 6 +- sys/net/if_fwsubr.c | 6 +- sys/net/if_gre.c | 4 +- sys/net/if_iso88025subr.c | 6 +- sys/net/if_spppfr.c | 6 +- sys/net/if_spppsubr.c | 10 +-- sys/net/if_stf.c | 2 +- sys/net/if_tap.c | 2 +- sys/net/if_tun.c | 6 +- sys/net/rtsock.c | 4 +- sys/net80211/ieee80211_freebsd.c | 4 +- sys/net80211/ieee80211_hostap.c | 2 +- sys/net80211/ieee80211_hwmp.c | 2 +- sys/net80211/ieee80211_input.c | 2 +- sys/net80211/ieee80211_mesh.c | 2 +- sys/net80211/ieee80211_output.c | 20 ++--- sys/net80211/ieee80211_superg.c | 6 +- sys/net80211/ieee80211_wds.c | 2 +- sys/netatalk/aarp.c | 10 +-- sys/netatalk/ddp_output.c | 4 +- sys/netgraph/atm/ccatm/ng_ccatm.c | 4 +- sys/netgraph/atm/ng_atm.c | 6 +- .../bluetooth/drivers/bt3c/ng_bt3c_pccard.c | 4 +- sys/netgraph/bluetooth/drivers/h4/ng_h4.c | 2 +- sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c | 12 +-- sys/netgraph/bluetooth/hci/ng_hci_cmds.c | 2 +- sys/netgraph/bluetooth/hci/ng_hci_evnt.c | 2 +- sys/netgraph/bluetooth/hci/ng_hci_misc.c | 2 +- sys/netgraph/bluetooth/hci/ng_hci_ulpi.c | 10 +-- sys/netgraph/bluetooth/l2cap/ng_l2cap_cmds.h | 22 ++--- sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c | 2 +- sys/netgraph/bluetooth/l2cap/ng_l2cap_llpi.c | 2 +- sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c | 2 +- .../bluetooth/socket/ng_btsocket_hci_raw.c | 6 +- .../bluetooth/socket/ng_btsocket_l2cap.c | 6 +- .../bluetooth/socket/ng_btsocket_rfcomm.c | 14 ++-- .../bluetooth/socket/ng_btsocket_sco.c | 4 +- sys/netgraph/netflow/netflow.c | 2 +- sys/netgraph/netflow/netflow_v9.c | 2 +- sys/netgraph/ng_UI.c | 2 +- sys/netgraph/ng_atmllc.c | 4 +- sys/netgraph/ng_bridge.c | 2 +- sys/netgraph/ng_cisco.c | 4 +- sys/netgraph/ng_deflate.c | 4 +- sys/netgraph/ng_device.c | 2 +- sys/netgraph/ng_frame_relay.c | 2 +- sys/netgraph/ng_gif.c | 2 +- sys/netgraph/ng_gif_demux.c | 2 +- sys/netgraph/ng_hub.c | 2 +- sys/netgraph/ng_iface.c | 2 +- sys/netgraph/ng_ipfw.c | 2 +- sys/netgraph/ng_l2tp.c | 14 ++-- sys/netgraph/ng_lmi.c | 2 +- sys/netgraph/ng_mppc.c | 6 +- sys/netgraph/ng_one2many.c | 2 +- sys/netgraph/ng_ppp.c | 6 +- sys/netgraph/ng_pppoe.c | 20 ++--- sys/netgraph/ng_pptpgre.c | 4 +- sys/netgraph/ng_pred1.c | 4 +- sys/netgraph/ng_rfc1490.c | 10 +-- sys/netgraph/ng_source.c | 8 +- sys/netgraph/ng_tee.c | 2 +- sys/netgraph/ng_tty.c | 4 +- sys/netgraph/ng_vjc.c | 4 +- sys/netgraph/ng_vlan.c | 2 +- sys/netinet/if_ether.c | 2 +- sys/netinet/igmp.c | 18 ++-- sys/netinet/in_gif.c | 4 +- sys/netinet/ip_icmp.c | 6 +- sys/netinet/ip_input.c | 4 +- sys/netinet/ip_mroute.c | 12 +-- sys/netinet/ip_options.c | 4 +- sys/netinet/ip_output.c | 10 +-- sys/netinet/libalias/alias.c | 4 +- sys/netinet/raw_ip.c | 2 +- sys/netinet/sctp_asconf.c | 10 +-- sys/netinet/sctp_auth.c | 4 +- sys/netinet/sctp_indata.c | 58 ++++++------- sys/netinet/sctp_input.c | 14 ++-- sys/netinet/sctp_output.c | 84 +++++++++---------- sys/netinet/sctp_pcb.c | 6 +- sys/netinet/sctp_timer.c | 4 +- sys/netinet/sctp_usrreq.c | 6 +- sys/netinet/sctputil.c | 34 ++++---- sys/netinet/tcp_output.c | 6 +- sys/netinet/tcp_subr.c | 4 +- sys/netinet/tcp_syncache.c | 2 +- sys/netinet/tcp_timewait.c | 2 +- sys/netinet/udp_usrreq.c | 2 +- sys/netinet6/frag6.c | 2 +- sys/netinet6/icmp6.c | 38 ++++----- sys/netinet6/in6_gif.c | 4 +- sys/netinet6/ip6_input.c | 8 +- sys/netinet6/ip6_mroute.c | 2 +- sys/netinet6/ip6_output.c | 18 ++-- sys/netinet6/mld6.c | 18 ++-- sys/netinet6/nd6_nbr.c | 8 +- sys/netinet6/raw_ip6.c | 2 +- sys/netinet6/udp6_usrreq.c | 2 +- sys/netipsec/ipsec_mbuf.c | 8 +- sys/netipsec/ipsec_output.c | 4 +- sys/netipsec/key.c | 42 +++++----- sys/netipsec/keysock.c | 8 +- sys/netipsec/xform_ipip.c | 4 +- sys/netipx/ipx_outputfl.c | 2 +- sys/netipx/ipx_usrreq.c | 4 +- sys/netipx/spx_reass.c | 2 +- sys/netipx/spx_usrreq.c | 10 +-- sys/netnatm/natm.c | 2 +- sys/netncp/ncp_sock.c | 2 +- sys/netpfil/ipfw/ip_dn_glue.c | 2 +- sys/netpfil/ipfw/ip_fw_dynamic.c | 2 +- sys/netpfil/ipfw/ip_fw_pfil.c | 4 +- sys/netsmb/smb_iod.c | 2 +- sys/netsmb/smb_rq.c | 2 +- sys/netsmb/smb_trantcp.c | 2 +- sys/nfs/krpc_subr.c | 10 +-- sys/nfs/nfs_common.c | 6 +- sys/nfsclient/nfs_krpc.c | 2 +- sys/nfsclient/nfs_subs.c | 16 ++-- sys/nfsserver/nfs_fha.c | 2 +- sys/nfsserver/nfs_serv.c | 8 +- sys/nfsserver/nfs_srvkrpc.c | 6 +- sys/nfsserver/nfs_srvsubs.c | 4 +- .../drivers/infiniband/ulp/ipoib/ipoib_ib.c | 2 +- .../drivers/infiniband/ulp/ipoib/ipoib_main.c | 2 +- .../drivers/infiniband/ulp/sdp/sdp_bcopy.c | 2 +- .../drivers/infiniband/ulp/sdp/sdp_main.c | 8 +- sys/ofed/drivers/infiniband/ulp/sdp/sdp_tx.c | 2 +- sys/ofed/drivers/net/mlx4/en_tx.c | 2 +- sys/pci/if_rl.c | 2 +- sys/powerpc/ps3/if_glc.c | 4 +- sys/rpc/clnt_dg.c | 2 +- sys/rpc/clnt_vc.c | 4 +- sys/rpc/rpc_generic.c | 4 +- sys/rpc/rpcm_subs.h | 2 +- sys/rpc/rpcsec_gss/rpcsec_gss_prot.c | 4 +- sys/rpc/svc.c | 4 +- sys/rpc/svc_dg.c | 2 +- sys/rpc/svc_vc.c | 6 +- sys/sys/mbuf.h | 15 +--- 178 files changed, 582 insertions(+), 593 deletions(-) diff --git a/sys/arm/at91/if_ate.c b/sys/arm/at91/if_ate.c index 58062e73f0e5..9da2abafcd13 100644 --- a/sys/arm/at91/if_ate.c +++ b/sys/arm/at91/if_ate.c @@ -901,9 +901,9 @@ ate_intr(void *xsc) /* Get an appropriately sized mbuf */ if (remain + ETHER_ALIGN >= MINCLSIZE) - mb = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + mb = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); else - MGETHDR(mb, M_DONTWAIT, MT_DATA); + MGETHDR(mb, M_NOWAIT, MT_DATA); if (mb == NULL) { sc->ifp->if_iqdrops++; @@ -1135,7 +1135,7 @@ atestart_locked(struct ifnet *ifp) e = bus_dmamap_load_mbuf_sg(sc->mtag, sc->tx_map[sc->txhead], m, segs, &nseg, 0); if (e == EFBIG) { - mdefrag = m_defrag(m, M_DONTWAIT); + mdefrag = m_defrag(m, M_NOWAIT); if (mdefrag == NULL) { IFQ_DRV_PREPEND(&ifp->if_snd, m); return; diff --git a/sys/arm/at91/if_macb.c b/sys/arm/at91/if_macb.c index ac280a1918e5..1a46adc52506 100644 --- a/sys/arm/at91/if_macb.c +++ b/sys/arm/at91/if_macb.c @@ -435,7 +435,7 @@ macb_new_rxbuf(struct macb_softc *sc, int index) bus_dma_segment_t seg[1]; int error, nsegs; - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) return (ENOBUFS); m->m_len = m->m_pkthdr.len = MCLBYTES - ETHER_ALIGN; @@ -878,7 +878,7 @@ macb_encap(struct macb_softc *sc, struct mbuf **m_head) error = bus_dmamap_load_mbuf_sg(sc->dmatag_ring_tx, txd->dmamap, *m_head, segs, &nsegs, 0); if (error == EFBIG) { - m = m_collapse(*m_head, M_DONTWAIT, MAX_FRAGMENT); + m = m_collapse(*m_head, M_NOWAIT, MAX_FRAGMENT); if (m == NULL) { m_freem(*m_head); *m_head = NULL; @@ -973,7 +973,7 @@ macbstart_locked(struct ifnet *ifp) #if 0 if (m0->m_next != NULL) { /* Fragmented mbuf chain, collapse it. */ - m_new = m_defrag(m0, M_DONTWAIT); + m_new = m_defrag(m0, M_NOWAIT); if (m_new != NULL) { /* Original frame freed. */ m0 = m_new; diff --git a/sys/arm/econa/if_ece.c b/sys/arm/econa/if_ece.c index 5169101704b3..cafc2f920615 100644 --- a/sys/arm/econa/if_ece.c +++ b/sys/arm/econa/if_ece.c @@ -714,7 +714,7 @@ ece_new_rxbuf(struct ece_softc *sc, struct rx_desc_info* descinfo) tag = sc->dmatag_ring_rx; - new_mbuf = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + new_mbuf = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (new_mbuf == NULL) return (ENOBUFS); diff --git a/sys/arm/lpc/if_lpe.c b/sys/arm/lpc/if_lpe.c index b7b5a9ac49fa..025aa72545cf 100644 --- a/sys/arm/lpc/if_lpe.c +++ b/sys/arm/lpc/if_lpe.c @@ -1122,7 +1122,7 @@ lpe_init_rxbuf(struct lpe_softc *sc, int n) rxd = &sc->lpe_cdata.lpe_rx_desc[n]; hwd = &sc->lpe_rdata.lpe_rx_ring[n]; hws = &sc->lpe_rdata.lpe_rx_status[n]; - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (!m) { device_printf(sc->lpe_dev, "WARNING: mbufs exhausted!\n"); diff --git a/sys/arm/ti/cpsw/if_cpsw.c b/sys/arm/ti/cpsw/if_cpsw.c index d671c728f145..8ed0ce581c3d 100644 --- a/sys/arm/ti/cpsw/if_cpsw.c +++ b/sys/arm/ti/cpsw/if_cpsw.c @@ -625,7 +625,7 @@ cpsw_pad(struct mbuf *m) ; if (!(M_WRITABLE(last) && M_TRAILINGSPACE(last) >= padlen)) { /* Allocate new empty mbuf, pad it. Compact later. */ - MGET(n, M_DONTWAIT, MT_DATA); + MGET(n, M_NOWAIT, MT_DATA); if (n == NULL) return (ENOBUFS); n->m_len = 0; diff --git a/sys/arm/xscale/ixp425/if_npe.c b/sys/arm/xscale/ixp425/if_npe.c index 5063ac61ad02..21e39267fbe2 100644 --- a/sys/arm/xscale/ixp425/if_npe.c +++ b/sys/arm/xscale/ixp425/if_npe.c @@ -1064,7 +1064,7 @@ npe_rxbuf_init(struct npe_softc *sc, struct npebuf *npe, struct mbuf *m) int error, nseg; if (m == NULL) { - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) return ENOBUFS; } @@ -1120,7 +1120,7 @@ npe_rxdone(int qid, void *arg) * data up the stack and replace it with the newly * allocated one. */ - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m != NULL) { struct mbuf *mrx = npe->ix_m; struct npehwbuf *hw = npe->ix_hw; @@ -1316,7 +1316,7 @@ npestart_locked(struct ifnet *ifp) error = bus_dmamap_load_mbuf_sg(dma->mtag, npe->ix_map, m, segs, &nseg, 0); if (error == EFBIG) { - n = m_collapse(m, M_DONTWAIT, NPE_MAXSEG); + n = m_collapse(m, M_NOWAIT, NPE_MAXSEG); if (n == NULL) { if_printf(ifp, "%s: too many fragments %u\n", __func__, nseg); diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c index d8fcd2d3bd83..7271a18385af 100644 --- a/sys/compat/linux/linux_socket.c +++ b/sys/compat/linux/linux_socket.c @@ -1173,7 +1173,7 @@ linux_sendmsg(struct thread *td, struct linux_sendmsg_args *args) error = ENOBUFS; cmsg = malloc(CMSG_HDRSZ, M_TEMP, M_WAITOK | M_ZERO); - control = m_get(M_WAIT, MT_CONTROL); + control = m_get(M_WAITOK, MT_CONTROL); if (control == NULL) goto bad; diff --git a/sys/compat/ndis/kern_ndis.c b/sys/compat/ndis/kern_ndis.c index ce7ee4c40256..23abaf130f28 100644 --- a/sys/compat/ndis/kern_ndis.c +++ b/sys/compat/ndis/kern_ndis.c @@ -657,12 +657,12 @@ ndis_ptom(m0, p) for (buf = priv->npp_head; buf != NULL; buf = buf->mdl_next) { if (buf == priv->npp_head) #ifdef MT_HEADER - MGETHDR(m, M_DONTWAIT, MT_HEADER); + MGETHDR(m, M_NOWAIT, MT_HEADER); #else - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); #endif else - MGET(m, M_DONTWAIT, MT_DATA); + MGET(m, M_NOWAIT, MT_DATA); if (m == NULL) { m_freem(*m0); *m0 = NULL; diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c index 71cfbabc8b1f..5fe831528de0 100644 --- a/sys/fs/nfs/nfs_commonsubs.c +++ b/sys/fs/nfs/nfs_commonsubs.c @@ -382,7 +382,7 @@ nfsm_strtom(struct nfsrv_descript *nd, const char *cp, int siz) while (siz > 0) { if (left == 0) { if (siz > ncl_mbuf_mlen) - NFSMCLGET(m1, M_WAIT); + NFSMCLGET(m1, M_WAITOK); else NFSMGET(m1); mbuf_setlen(m1, 0); @@ -3455,7 +3455,7 @@ nfsrvd_rephead(struct nfsrv_descript *nd) */ if ((nd->nd_flag & ND_GSSINITREPLY) == 0 && nfs_bigreply[nd->nd_procnum]) { - NFSMCLGET(mreq, M_WAIT); + NFSMCLGET(mreq, M_WAITOK); nd->nd_mreq = mreq; nd->nd_mb = mreq; } else { diff --git a/sys/fs/nfs/nfsm_subs.h b/sys/fs/nfs/nfsm_subs.h index a2777a0ca47a..6e91b9954c1b 100644 --- a/sys/fs/nfs/nfsm_subs.h +++ b/sys/fs/nfs/nfsm_subs.h @@ -73,7 +73,7 @@ nfsm_build(struct nfsrv_descript *nd, int siz) struct mbuf *mb2; if (siz > M_TRAILINGSPACE(nd->nd_mb)) { - NFSMCLGET(mb2, M_DONTWAIT); + NFSMCLGET(mb2, M_NOWAIT); if (siz > MLEN) panic("build > MLEN"); mbuf_setlen(mb2, 0); diff --git a/sys/fs/nfsclient/nfs_clcomsubs.c b/sys/fs/nfsclient/nfs_clcomsubs.c index 28d8ba11dfdc..b68e5bd07fd5 100644 --- a/sys/fs/nfsclient/nfs_clcomsubs.c +++ b/sys/fs/nfsclient/nfs_clcomsubs.c @@ -138,7 +138,7 @@ nfscl_reqstart(struct nfsrv_descript *nd, int procnum, struct nfsmount *nmp, * Get the first mbuf for the request. */ if (nfs_bigrequest[procnum]) - NFSMCLGET(mb, M_WAIT); + NFSMCLGET(mb, M_WAITOK); else NFSMGET(mb); mbuf_setlen(mb, 0); @@ -212,7 +212,7 @@ nfsm_uiombuf(struct nfsrv_descript *nd, struct uio *uiop, int siz) mlen = M_TRAILINGSPACE(mp); if (mlen == 0) { if (clflg) - NFSMCLGET(mp, M_WAIT); + NFSMCLGET(mp, M_WAITOK); else NFSMGET(mp); mbuf_setlen(mp, 0); diff --git a/sys/fs/nfsserver/nfs_nfsdcache.c b/sys/fs/nfsserver/nfs_nfsdcache.c index 0ee3b024dead..b979b358d6b6 100644 --- a/sys/fs/nfsserver/nfs_nfsdcache.c +++ b/sys/fs/nfsserver/nfs_nfsdcache.c @@ -364,7 +364,7 @@ nfsrc_getudp(struct nfsrv_descript *nd, struct nfsrvcache *newrp) newnfsstats.srvcache_nonidemdonehits++; NFSUNLOCKCACHE(); nd->nd_mreq = m_copym(rp->rc_reply, 0, - M_COPYALL, M_WAIT); + M_COPYALL, M_WAITOK); ret = RC_REPLY; rp->rc_timestamp = NFSD_MONOSEC + NFSRVCACHE_UDPTIMEOUT; @@ -437,7 +437,7 @@ nfsrvd_updatecache(struct nfsrv_descript *nd, struct socket *so) if (!(rp->rc_flag & RC_REPMBUF)) panic("reply from cache"); nd->nd_mreq = m_copym(rp->rc_reply, 0, - M_COPYALL, M_WAIT); + M_COPYALL, M_WAITOK); rp->rc_timestamp = NFSD_MONOSEC + NFSRVCACHE_TCPTIMEOUT; nfsrc_unlock(rp); goto out; @@ -473,7 +473,7 @@ nfsrvd_updatecache(struct nfsrv_descript *nd, struct socket *so) nfsrc_tcpsavedreplies; } NFSUNLOCKCACHE(); - m = m_copym(nd->nd_mreq, 0, M_COPYALL, M_WAIT); + m = m_copym(nd->nd_mreq, 0, M_COPYALL, M_WAITOK); NFSLOCKCACHE(); rp->rc_reply = m; rp->rc_flag |= RC_REPMBUF; @@ -654,7 +654,7 @@ nfsrc_gettcp(struct nfsrv_descript *nd, struct nfsrvcache *newrp) nfsrc_marksametcpconn(rp->rc_sockref); ret = RC_REPLY; nd->nd_mreq = m_copym(rp->rc_reply, 0, - M_COPYALL, M_WAIT); + M_COPYALL, M_WAITOK); rp->rc_timestamp = NFSD_MONOSEC + NFSRVCACHE_TCPTIMEOUT; } else { diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index 1234a4a6281c..f56a292ca64b 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -565,7 +565,7 @@ nfsvno_readlink(struct vnode *vp, struct ucred *cred, struct thread *p, i = 0; while (len < NFS_MAXPATHLEN) { NFSMGET(mp); - MCLGET(mp, M_WAIT); + MCLGET(mp, M_WAITOK); mp->m_len = NFSMSIZ(mp); if (len == 0) { mp3 = mp2 = mp; @@ -635,7 +635,7 @@ nfsvno_read(struct vnode *vp, off_t off, int cnt, struct ucred *cred, i = 0; while (left > 0) { NFSMGET(m); - MCLGET(m, M_WAIT); + MCLGET(m, M_WAITOK); m->m_len = 0; siz = min(M_TRAILINGSPACE(m), left); left -= siz; diff --git a/sys/fs/nfsserver/nfs_nfsdstate.c b/sys/fs/nfsserver/nfs_nfsdstate.c index e9962c720cc9..515f8111d423 100644 --- a/sys/fs/nfsserver/nfs_nfsdstate.c +++ b/sys/fs/nfsserver/nfs_nfsdstate.c @@ -3726,7 +3726,7 @@ nfsrv_docallback(struct nfsclient *clp, int procnum, /* * Get the first mbuf for the request. */ - MGET(m, M_WAIT, MT_DATA); + MGET(m, M_WAITOK, MT_DATA); mbuf_setlen(m, 0); nd->nd_mreq = nd->nd_mb = m; nd->nd_bpos = NFSMTOD(m, caddr_t); diff --git a/sys/kern/subr_mchain.c b/sys/kern/subr_mchain.c index cd2a5f370ed2..e9d7d22129b4 100644 --- a/sys/kern/subr_mchain.c +++ b/sys/kern/subr_mchain.c @@ -59,7 +59,7 @@ mb_init(struct mbchain *mbp) { struct mbuf *m; - m = m_gethdr(M_WAIT, MT_DATA); + m = m_gethdr(M_WAITOK, MT_DATA); m->m_len = 0; mb_initm(mbp, m); return (0); @@ -114,7 +114,7 @@ mb_reserve(struct mbchain *mbp, int size) panic("mb_reserve: size = %d\n", size); m = mbp->mb_cur; if (mbp->mb_mleft < size) { - mn = m_get(M_WAIT, MT_DATA); + mn = m_get(M_WAITOK, MT_DATA); mbp->mb_cur = m->m_next = mn; m = mn; m->m_len = 0; @@ -205,7 +205,7 @@ mb_put_mem(struct mbchain *mbp, c_caddr_t source, int size, int type) while (size > 0) { if (mleft == 0) { if (m->m_next == NULL) - m = m_getm(m, size, M_WAIT, MT_DATA); + m = m_getm(m, size, M_WAITOK, MT_DATA); else m = m->m_next; mleft = M_TRAILINGSPACE(m); @@ -307,7 +307,7 @@ md_init(struct mdchain *mdp) { struct mbuf *m; - m = m_gethdr(M_WAIT, MT_DATA); + m = m_gethdr(M_WAITOK, MT_DATA); m->m_len = 0; md_initm(mdp, m); return (0); @@ -514,7 +514,7 @@ md_get_mbuf(struct mdchain *mdp, int size, struct mbuf **ret) { struct mbuf *m = mdp->md_cur, *rm; - rm = m_copym(m, mdp->md_pos - mtod(m, u_char*), size, M_WAIT); + rm = m_copym(m, mdp->md_pos - mtod(m, u_char*), size, M_WAITOK); md_get_mem(mdp, NULL, size, MB_MZERO); *ret = rm; return (0); diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c index 4130361e781d..ab6163dd7829 100644 --- a/sys/kern/uipc_mbuf.c +++ b/sys/kern/uipc_mbuf.c @@ -520,7 +520,7 @@ m_prepend(struct mbuf *m, int len, int how) /* * Make a copy of an mbuf chain starting "off0" bytes from the beginning, * continuing for "len" bytes. If len is M_COPYALL, copy to end of mbuf. - * The wait parameter is a choice of M_WAIT/M_DONTWAIT from caller. + * The wait parameter is a choice of M_WAITOK/M_NOWAIT from caller. * Note that the copy is read-only, because clusters are not copied, * only their reference counts are incremented. */ @@ -1028,7 +1028,7 @@ m_pullup(struct mbuf *n, int len) } else { if (len > MHLEN) goto bad; - MGET(m, M_DONTWAIT, n->m_type); + MGET(m, M_NOWAIT, n->m_type); if (m == NULL) goto bad; m->m_len = 0; @@ -1076,7 +1076,7 @@ m_copyup(struct mbuf *n, int len, int dstoff) if (len > (MHLEN - dstoff)) goto bad; - MGET(m, M_DONTWAIT, n->m_type); + MGET(m, M_NOWAIT, n->m_type); if (m == NULL) goto bad; m->m_len = 0; @@ -1195,10 +1195,10 @@ m_devget(char *buf, int totlen, int off, struct ifnet *ifp, while (totlen > 0) { if (top == NULL) { /* First one, must be PKTHDR */ if (totlen + off >= MINCLSIZE) { - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); len = MCLBYTES; } else { - m = m_gethdr(M_DONTWAIT, MT_DATA); + m = m_gethdr(M_NOWAIT, MT_DATA); len = MHLEN; /* Place initial small packet/header at end of mbuf */ @@ -1213,10 +1213,10 @@ m_devget(char *buf, int totlen, int off, struct ifnet *ifp, m->m_pkthdr.len = totlen; } else { if (totlen + off >= MINCLSIZE) { - m = m_getcl(M_DONTWAIT, MT_DATA, 0); + m = m_getcl(M_NOWAIT, MT_DATA, 0); len = MCLBYTES; } else { - m = m_get(M_DONTWAIT, MT_DATA); + m = m_get(M_NOWAIT, MT_DATA); len = MLEN; } if (m == NULL) { @@ -1260,7 +1260,7 @@ m_copyback(struct mbuf *m0, int off, int len, c_caddr_t cp) off -= mlen; totlen += mlen; if (m->m_next == NULL) { - n = m_get(M_DONTWAIT, m->m_type); + n = m_get(M_NOWAIT, m->m_type); if (n == NULL) goto out; bzero(mtod(n, caddr_t), MLEN); @@ -1284,7 +1284,7 @@ m_copyback(struct mbuf *m0, int off, int len, c_caddr_t cp) if (len == 0) break; if (m->m_next == NULL) { - n = m_get(M_DONTWAIT, m->m_type); + n = m_get(M_NOWAIT, m->m_type); if (n == NULL) break; n->m_len = min(MLEN, len); @@ -1328,7 +1328,7 @@ m_append(struct mbuf *m0, int len, c_caddr_t cp) * Allocate a new mbuf; could check space * and allocate a cluster instead. */ - n = m_get(M_DONTWAIT, m->m_type); + n = m_get(M_NOWAIT, m->m_type); if (n == NULL) break; n->m_len = min(MLEN, remainder); diff --git a/sys/kern/uipc_mbuf2.c b/sys/kern/uipc_mbuf2.c index 96be658c4775..e32e2a127124 100644 --- a/sys/kern/uipc_mbuf2.c +++ b/sys/kern/uipc_mbuf2.c @@ -171,7 +171,7 @@ m_pulldown(struct mbuf *m, int off, int len, int *offp) * chop the current mbuf into two pieces, set off to 0. */ if (len <= n->m_len - off) { - o = m_dup1(n, off, n->m_len - off, M_DONTWAIT); + o = m_dup1(n, off, n->m_len - off, M_NOWAIT); if (o == NULL) { m_freem(m); return NULL; /* ENOBUFS */ @@ -231,9 +231,9 @@ m_pulldown(struct mbuf *m, int off, int len, int *offp) * on both end. */ if (len > MLEN) - o = m_getcl(M_DONTWAIT, m->m_type, 0); + o = m_getcl(M_NOWAIT, m->m_type, 0); else - o = m_get(M_DONTWAIT, m->m_type); + o = m_get(M_NOWAIT, m->m_type); if (!o) { m_freem(m); return NULL; /* ENOBUFS */ diff --git a/sys/kern/uipc_sockbuf.c b/sys/kern/uipc_sockbuf.c index 272f9392bbd2..6325840d4662 100644 --- a/sys/kern/uipc_sockbuf.c +++ b/sys/kern/uipc_sockbuf.c @@ -188,7 +188,7 @@ sowakeup(struct socket *so, struct sockbuf *sb) } KNOTE_LOCKED(&sb->sb_sel.si_note, 0); if (sb->sb_upcall != NULL) { - ret = sb->sb_upcall(so, sb->sb_upcallarg, M_DONTWAIT); + ret = sb->sb_upcall(so, sb->sb_upcallarg, M_NOWAIT); if (ret == SU_ISCONNECTED) { KASSERT(sb == &so->so_rcv, ("SO_SND upcall returned SU_ISCONNECTED")); @@ -644,7 +644,7 @@ sbappendaddr_locked(struct sockbuf *sb, const struct sockaddr *asa, if (asa->sa_len > MLEN) return (0); #endif - MGET(m, M_DONTWAIT, MT_SONAME); + MGET(m, M_NOWAIT, MT_SONAME); if (m == 0) return (0); m->m_len = asa->sa_len; @@ -1002,9 +1002,9 @@ sbcreatecontrol(caddr_t p, int size, int type, int level) if (CMSG_SPACE((u_int)size) > MCLBYTES) return ((struct mbuf *) NULL); if (CMSG_SPACE((u_int)size) > MLEN) - m = m_getcl(M_DONTWAIT, MT_CONTROL, 0); + m = m_getcl(M_NOWAIT, MT_CONTROL, 0); else - m = m_get(M_DONTWAIT, MT_CONTROL); + m = m_get(M_NOWAIT, MT_CONTROL); if (m == NULL) return ((struct mbuf *) NULL); cp = mtod(m, struct cmsghdr *); diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 4416eca93775..2d84afedeecd 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -998,7 +998,7 @@ sosend_copyin(struct uio *uio, struct mbuf **retmp, int atomic, long *space, } } else { if (top == NULL) { - m = m_gethdr(M_WAIT, MT_DATA); + m = m_gethdr(M_WAITOK, MT_DATA); m->m_pkthdr.len = 0; m->m_pkthdr.rcvif = NULL; @@ -1010,7 +1010,7 @@ sosend_copyin(struct uio *uio, struct mbuf **retmp, int atomic, long *space, if (atomic && m && len < MHLEN) MH_ALIGN(m, len); } else { - m = m_get(M_WAIT, MT_DATA); + m = m_get(M_WAITOK, MT_DATA); len = min(min(MLEN, resid), *space); } } @@ -1433,7 +1433,7 @@ soreceive_rcvoob(struct socket *so, struct uio *uio, int flags) KASSERT(flags & MSG_OOB, ("soreceive_rcvoob: (flags & MSG_OOB) == 0")); VNET_SO_ASSERT(so); - m = m_get(M_WAIT, MT_DATA); + m = m_get(M_WAITOK, MT_DATA); error = (*pr->pr_usrreqs->pru_rcvoob)(so, m, flags & MSG_PEEK); if (error) goto bad; @@ -1841,13 +1841,13 @@ soreceive_generic(struct socket *so, struct sockaddr **psa, struct uio *uio, int copy_flag; if (flags & MSG_DONTWAIT) - copy_flag = M_DONTWAIT; + copy_flag = M_NOWAIT; else copy_flag = M_WAIT; - if (copy_flag == M_WAIT) + if (copy_flag == M_WAITOK) SOCKBUF_UNLOCK(&so->so_rcv); *mp = m_copym(m, 0, len, copy_flag); - if (copy_flag == M_WAIT) + if (copy_flag == M_WAITOK) SOCKBUF_LOCK(&so->so_rcv); if (*mp == NULL) { /* @@ -2114,7 +2114,7 @@ soreceive_stream(struct socket *so, struct sockaddr **psa, struct uio *uio, KASSERT(sb->sb_mb != NULL, ("%s: len > 0 && sb->sb_mb empty", __func__)); - m = m_copym(sb->sb_mb, 0, len, M_DONTWAIT); + m = m_copym(sb->sb_mb, 0, len, M_NOWAIT); if (m == NULL) len = 0; /* Don't flush data from sockbuf. */ else @@ -2901,11 +2901,11 @@ soopt_getm(struct sockopt *sopt, struct mbuf **mp) struct mbuf *m, *m_prev; int sopt_size = sopt->sopt_valsize; - MGET(m, sopt->sopt_td ? M_WAIT : M_DONTWAIT, MT_DATA); + MGET(m, sopt->sopt_td ? M_WAITOK : M_NOWAIT, MT_DATA); if (m == NULL) return ENOBUFS; if (sopt_size > MLEN) { - MCLGET(m, sopt->sopt_td ? M_WAIT : M_DONTWAIT); + MCLGET(m, sopt->sopt_td ? M_WAITOK : M_NOWAIT); if ((m->m_flags & M_EXT) == 0) { m_free(m); return ENOBUFS; @@ -2919,14 +2919,14 @@ soopt_getm(struct sockopt *sopt, struct mbuf **mp) m_prev = m; while (sopt_size) { - MGET(m, sopt->sopt_td ? M_WAIT : M_DONTWAIT, MT_DATA); + MGET(m, sopt->sopt_td ? M_WAITOK : M_NOWAIT, MT_DATA); if (m == NULL) { m_freem(*mp); return ENOBUFS; } if (sopt_size > MLEN) { - MCLGET(m, sopt->sopt_td != NULL ? M_WAIT : - M_DONTWAIT); + MCLGET(m, sopt->sopt_td != NULL ? M_WAITOK : + M_NOWAIT); if ((m->m_flags & M_EXT) == 0) { m_freem(m); m_freem(*mp); @@ -3409,7 +3409,7 @@ soisconnected(struct socket *so) head->so_accf->so_accept_filter_arg); so->so_options &= ~SO_ACCEPTFILTER; ret = head->so_accf->so_accept_filter->accf_callback(so, - head->so_accf->so_accept_filter_arg, M_DONTWAIT); + head->so_accf->so_accept_filter_arg, M_NOWAIT); if (ret == SU_ISCONNECTED) soupcall_clear(so, SO_RCV); SOCK_UNLOCK(so); diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c index 8ecaa02ea251..b29c2c6b80b7 100644 --- a/sys/kern/uipc_syscalls.c +++ b/sys/kern/uipc_syscalls.c @@ -722,7 +722,7 @@ sendit(td, s, mp, flags) if (mp->msg_flags == MSG_COMPAT) { struct cmsghdr *cm; - M_PREPEND(control, sizeof(*cm), M_WAIT); + M_PREPEND(control, sizeof(*cm), M_WAITOK); cm = mtod(control, struct cmsghdr *); cm->cmsg_len = control->m_len; cm->cmsg_level = SOL_SOCKET; @@ -1661,9 +1661,9 @@ sockargs(mp, buf, buflen, type) if ((u_int)buflen > MCLBYTES) return (EINVAL); } - m = m_get(M_WAIT, type); + m = m_get(M_WAITOK, type); if ((u_int)buflen > MLEN) - MCLGET(m, M_WAIT); + MCLGET(m, M_WAITOK); m->m_len = buflen; error = copyin(buf, mtod(m, caddr_t), (u_int)buflen); if (error) diff --git a/sys/mips/adm5120/if_admsw.c b/sys/mips/adm5120/if_admsw.c index b3f6e3bdd403..f17df00f8365 100644 --- a/sys/mips/adm5120/if_admsw.c +++ b/sys/mips/adm5120/if_admsw.c @@ -647,14 +647,14 @@ admsw_start(struct ifnet *ifp) if (m0->m_pkthdr.len < ETHER_MIN_LEN || bus_dmamap_load_mbuf(sc->sc_bufs_dmat, dmamap, m0, admsw_mbuf_map_addr, ds, BUS_DMA_NOWAIT) != 0) { - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) { device_printf(sc->sc_dev, "unable to allocate Tx mbuf\n"); break; } if (m0->m_pkthdr.len > MHLEN) { - MCLGET(m, M_DONTWAIT); + MCLGET(m, M_NOWAIT); if ((m->m_flags & M_EXT) == 0) { device_printf(sc->sc_dev, "unable to allocate Tx cluster\n"); @@ -1222,11 +1222,11 @@ admsw_add_rxbuf(struct admsw_softc *sc, int idx, int high) else ds = &sc->sc_rxlsoft[idx]; - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) return (ENOBUFS); - MCLGET(m, M_DONTWAIT); + MCLGET(m, M_NOWAIT); if ((m->m_flags & M_EXT) == 0) { m_freem(m); return (ENOBUFS); diff --git a/sys/mips/atheros/if_arge.c b/sys/mips/atheros/if_arge.c index 6c6398299e0f..247d331b9021 100644 --- a/sys/mips/atheros/if_arge.c +++ b/sys/mips/atheros/if_arge.c @@ -1090,7 +1090,7 @@ arge_encap(struct arge_softc *sc, struct mbuf **m_head) m = *m_head; if (! arge_mbuf_chain_is_tx_aligned(m)) { sc->stats.tx_pkts_unaligned++; - m = m_defrag(*m_head, M_DONTWAIT); + m = m_defrag(*m_head, M_NOWAIT); if (m == NULL) { *m_head = NULL; return (ENOBUFS); @@ -1772,7 +1772,7 @@ arge_newbuf(struct arge_softc *sc, int idx) bus_dmamap_t map; int nsegs; - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) return (ENOBUFS); m->m_len = m->m_pkthdr.len = MCLBYTES; diff --git a/sys/mips/cavium/if_octm.c b/sys/mips/cavium/if_octm.c index c6778fff5c3e..bfb58976aefb 100644 --- a/sys/mips/cavium/if_octm.c +++ b/sys/mips/cavium/if_octm.c @@ -505,7 +505,7 @@ octm_rx_intr(void *arg) } for (;;) { - struct mbuf *m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + struct mbuf *m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) { device_printf(sc->sc_dev, "no memory for receive mbuf.\n"); return; diff --git a/sys/mips/cavium/octe/ethernet-mem.c b/sys/mips/cavium/octe/ethernet-mem.c index d7af1ae4d602..d101d7cc9568 100644 --- a/sys/mips/cavium/octe/ethernet-mem.c +++ b/sys/mips/cavium/octe/ethernet-mem.c @@ -57,7 +57,7 @@ int cvm_oct_mem_fill_fpa(int pool, int size, int elements) while (freed) { KASSERT(size <= MCLBYTES - 128, ("mbuf clusters are too small")); - struct mbuf *m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + struct mbuf *m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (__predict_false(m == NULL)) { printf("Failed to allocate mbuf for hardware pool %d\n", pool); break; diff --git a/sys/mips/cavium/octe/ethernet-rx.c b/sys/mips/cavium/octe/ethernet-rx.c index 0f00245d2f16..910d6bdbb65d 100644 --- a/sys/mips/cavium/octe/ethernet-rx.c +++ b/sys/mips/cavium/octe/ethernet-rx.c @@ -228,7 +228,7 @@ void cvm_oct_tasklet_rx(void *context, int pending) /* We have to copy the packet. First allocate an mbuf for it */ - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) { DEBUGPRINT("Port %d failed to allocate mbuf, packet dropped\n", work->word1.cn38xx.ipprt); cvm_oct_free_work(work); diff --git a/sys/mips/idt/if_kr.c b/sys/mips/idt/if_kr.c index b43defa25716..aa533eb889b8 100644 --- a/sys/mips/idt/if_kr.c +++ b/sys/mips/idt/if_kr.c @@ -1305,7 +1305,7 @@ kr_newbuf(struct kr_softc *sc, int idx) bus_dmamap_t map; int nsegs; - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) return (ENOBUFS); m->m_len = m->m_pkthdr.len = MCLBYTES; diff --git a/sys/mips/nlm/dev/net/xlpge.c b/sys/mips/nlm/dev/net/xlpge.c index 3af802e3deb1..0e41559cbb06 100644 --- a/sys/mips/nlm/dev/net/xlpge.c +++ b/sys/mips/nlm/dev/net/xlpge.c @@ -1125,7 +1125,7 @@ get_buf(void) vm_paddr_t temp1, temp2; #endif - if ((m_new = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR)) == NULL) + if ((m_new = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR)) == NULL) return (NULL); m_new->m_len = m_new->m_pkthdr.len = MCLBYTES; m_adj(m_new, NAE_CACHELINE_SIZE - ((uintptr_t)m_new->m_data & 0x1f)); diff --git a/sys/mips/rmi/dev/nlge/if_nlge.c b/sys/mips/rmi/dev/nlge/if_nlge.c index a25ebe3c95e3..331064ae72a0 100644 --- a/sys/mips/rmi/dev/nlge/if_nlge.c +++ b/sys/mips/rmi/dev/nlge/if_nlge.c @@ -2158,7 +2158,7 @@ get_buf(void) vm_paddr_t temp1, temp2; #endif - if ((m_new = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR)) == NULL) + if ((m_new = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR)) == NULL) return (NULL); m_new->m_len = m_new->m_pkthdr.len = MCLBYTES; m_adj(m_new, XLR_CACHELINE_SIZE - ((uintptr_t)m_new->m_data & 0x1f)); diff --git a/sys/mips/rmi/dev/xlr/rge.c b/sys/mips/rmi/dev/xlr/rge.c index 1af97c2fbd9e..2d2ba9e4bf79 100644 --- a/sys/mips/rmi/dev/xlr/rge.c +++ b/sys/mips/rmi/dev/xlr/rge.c @@ -568,7 +568,7 @@ get_mbuf(void) { struct mbuf *m_new = NULL; - if ((m_new = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR)) == NULL) + if ((m_new = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR)) == NULL) return NULL; m_new->m_len = MCLBYTES; diff --git a/sys/net/bpf.c b/sys/net/bpf.c index 79ea5242283e..6d9a917a8b91 100644 --- a/sys/net/bpf.c +++ b/sys/net/bpf.c @@ -530,11 +530,11 @@ bpf_movein(struct uio *uio, int linktype, struct ifnet *ifp, struct mbuf **mp, return (EIO); if (len <= MHLEN) - MGETHDR(m, M_WAIT, MT_DATA); + MGETHDR(m, M_WAITOK, MT_DATA); else if (len <= MCLBYTES) - m = m_getcl(M_WAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_WAITOK, MT_DATA, M_PKTHDR); else - m = m_getjcl(M_WAIT, MT_DATA, M_PKTHDR, + m = m_getjcl(M_WAITOK, MT_DATA, M_PKTHDR, #if (MJUMPAGESIZE > MCLBYTES) len <= MJUMPAGESIZE ? MJUMPAGESIZE : #endif @@ -1064,7 +1064,7 @@ bpfwrite(struct cdev *dev, struct uio *uio, int ioflag) dst.sa_family = pseudo_AF_HDRCMPLT; if (d->bd_feedback) { - mc = m_dup(m, M_DONTWAIT); + mc = m_dup(m, M_NOWAIT); if (mc != NULL) mc->m_pkthdr.rcvif = ifp; /* Set M_PROMISC for outgoing packets to be discarded. */ diff --git a/sys/net/bridgestp.c b/sys/net/bridgestp.c index 15d4ee96a475..43dd005244db 100644 --- a/sys/net/bridgestp.c +++ b/sys/net/bridgestp.c @@ -234,7 +234,7 @@ bstp_transmit_tcn(struct bstp_state *bs, struct bstp_port *bp) if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) return; - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) return; @@ -348,7 +348,7 @@ bstp_send_bpdu(struct bstp_state *bs, struct bstp_port *bp, if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) return; - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) return; diff --git a/sys/net/ieee8023ad_lacp.c b/sys/net/ieee8023ad_lacp.c index b2a6a7daf152..87c4e9bcb237 100644 --- a/sys/net/ieee8023ad_lacp.c +++ b/sys/net/ieee8023ad_lacp.c @@ -348,7 +348,7 @@ lacp_xmit_lacpdu(struct lacp_port *lp) LACP_LOCK_ASSERT(lp->lp_lsc); - m = m_gethdr(M_DONTWAIT, MT_DATA); + m = m_gethdr(M_NOWAIT, MT_DATA); if (m == NULL) { return (ENOMEM); } @@ -402,7 +402,7 @@ lacp_xmit_marker(struct lacp_port *lp) LACP_LOCK_ASSERT(lp->lp_lsc); - m = m_gethdr(M_DONTWAIT, MT_DATA); + m = m_gethdr(M_NOWAIT, MT_DATA); if (m == NULL) { return (ENOMEM); } diff --git a/sys/net/if_arcsubr.c b/sys/net/if_arcsubr.c index 03f3a1c305bc..faa37cf9e0fd 100644 --- a/sys/net/if_arcsubr.c +++ b/sys/net/if_arcsubr.c @@ -214,7 +214,7 @@ arc_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, } isphds = arc_isphds(atype); - M_PREPEND(m, isphds ? ARC_HDRNEWLEN : ARC_HDRLEN, M_DONTWAIT); + M_PREPEND(m, isphds ? ARC_HDRNEWLEN : ARC_HDRLEN, M_NOWAIT); if (m == 0) senderr(ENOBUFS); ah = mtod(m, struct arc_header *); @@ -294,13 +294,13 @@ arc_frag_next(struct ifnet *ifp) /* split out next fragment and return it */ if (ac->sflag < ac->fsflag) { /* we CAN'T have short packets here */ - ac->curr_frag = m_split(m, ARC_MAX_DATA, M_DONTWAIT); + ac->curr_frag = m_split(m, ARC_MAX_DATA, M_NOWAIT); if (ac->curr_frag == 0) { m_freem(m); return 0; } - M_PREPEND(m, ARC_HDRNEWLEN, M_DONTWAIT); + M_PREPEND(m, ARC_HDRNEWLEN, M_NOWAIT); if (m == 0) { m_freem(ac->curr_frag); ac->curr_frag = 0; @@ -319,7 +319,7 @@ arc_frag_next(struct ifnet *ifp) ARC_MAX_FORBID_LEN - ARC_HDRNEWLEN + 2)) { ac->curr_frag = 0; - M_PREPEND(m, ARC_HDRNEWLEN_EXC, M_DONTWAIT); + M_PREPEND(m, ARC_HDRNEWLEN_EXC, M_NOWAIT); if (m == 0) return 0; @@ -332,7 +332,7 @@ arc_frag_next(struct ifnet *ifp) } else { ac->curr_frag = 0; - M_PREPEND(m, ARC_HDRNEWLEN, M_DONTWAIT); + M_PREPEND(m, ARC_HDRNEWLEN, M_NOWAIT); if (m == 0) return 0; diff --git a/sys/net/if_atmsubr.c b/sys/net/if_atmsubr.c index bb691e1fb97e..fdb8931ec76b 100644 --- a/sys/net/if_atmsubr.c +++ b/sys/net/if_atmsubr.c @@ -190,7 +190,7 @@ atm_output(struct ifnet *ifp, struct mbuf *m0, struct sockaddr *dst, atm_flags = ATM_PH_FLAGS(&atmdst); if (atm_flags & ATM_PH_LLCSNAP) sz += 8; /* sizeof snap == 8 */ - M_PREPEND(m, sz, M_DONTWAIT); + M_PREPEND(m, sz, M_NOWAIT); if (m == 0) senderr(ENOBUFS); ad = mtod(m, struct atm_pseudohdr *); diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index 015cc64091e7..7666d5e99529 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -1948,7 +1948,7 @@ bridge_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *sa, used = 1; mc = m; } else { - mc = m_copypacket(m, M_DONTWAIT); + mc = m_copypacket(m, M_NOWAIT); if (mc == NULL) { sc->sc_ifp->if_oerrors++; continue; @@ -2237,7 +2237,7 @@ bridge_input(struct ifnet *ifp, struct mbuf *m) * for bridge processing; return the original packet for * local processing. */ - mc = m_dup(m, M_DONTWAIT); + mc = m_dup(m, M_NOWAIT); if (mc == NULL) { BRIDGE_UNLOCK(sc); return (m); @@ -2254,7 +2254,7 @@ bridge_input(struct ifnet *ifp, struct mbuf *m) */ KASSERT(bifp->if_bridge == NULL, ("loop created in bridge_input")); - mc2 = m_dup(m, M_DONTWAIT); + mc2 = m_dup(m, M_NOWAIT); if (mc2 != NULL) { /* Keep the layer3 header aligned */ int i = min(mc2->m_pkthdr.len, max_protohdr); @@ -2431,7 +2431,7 @@ bridge_broadcast(struct bridge_softc *sc, struct ifnet *src_if, mc = m; used = 1; } else { - mc = m_dup(m, M_DONTWAIT); + mc = m_dup(m, M_NOWAIT); if (mc == NULL) { sc->sc_ifp->if_oerrors++; continue; @@ -2494,7 +2494,7 @@ bridge_span(struct bridge_softc *sc, struct mbuf *m) if ((dst_if->if_drv_flags & IFF_DRV_RUNNING) == 0) continue; - mc = m_copypacket(m, M_DONTWAIT); + mc = m_copypacket(m, M_NOWAIT); if (mc == NULL) { sc->sc_ifp->if_oerrors++; continue; @@ -3189,13 +3189,13 @@ bridge_pfil(struct mbuf **mp, struct ifnet *bifp, struct ifnet *ifp, int dir) * Finally, put everything back the way it was and return */ if (snap) { - M_PREPEND(*mp, sizeof(struct llc), M_DONTWAIT); + M_PREPEND(*mp, sizeof(struct llc), M_NOWAIT); if (*mp == NULL) return (error); bcopy(&llc1, mtod(*mp, caddr_t), sizeof(struct llc)); } - M_PREPEND(*mp, ETHER_HDR_LEN, M_DONTWAIT); + M_PREPEND(*mp, ETHER_HDR_LEN, M_NOWAIT); if (*mp == NULL) return (error); bcopy(&eh2, mtod(*mp, caddr_t), ETHER_HDR_LEN); @@ -3390,7 +3390,7 @@ bridge_fragment(struct ifnet *ifp, struct mbuf *m, struct ether_header *eh, for (m0 = m; m0; m0 = m0->m_nextpkt) { if (error == 0) { if (snap) { - M_PREPEND(m0, sizeof(struct llc), M_DONTWAIT); + M_PREPEND(m0, sizeof(struct llc), M_NOWAIT); if (m0 == NULL) { error = ENOBUFS; continue; @@ -3398,7 +3398,7 @@ bridge_fragment(struct ifnet *ifp, struct mbuf *m, struct ether_header *eh, bcopy(llc, mtod(m0, caddr_t), sizeof(struct llc)); } - M_PREPEND(m0, ETHER_HDR_LEN, M_DONTWAIT); + M_PREPEND(m0, ETHER_HDR_LEN, M_NOWAIT); if (m0 == NULL) { error = ENOBUFS; continue; diff --git a/sys/net/if_ef.c b/sys/net/if_ef.c index 8e84b0792272..94337934b521 100644 --- a/sys/net/if_ef.c +++ b/sys/net/if_ef.c @@ -408,7 +408,7 @@ ef_output(struct ifnet *ifp, struct mbuf **mp, struct sockaddr *dst, short *tp, type = htons(m->m_pkthdr.len); break; case ETHER_FT_8022: - M_PREPEND(m, ETHER_HDR_LEN + 3, M_WAIT); + M_PREPEND(m, ETHER_HDR_LEN + 3, M_WAITOK); /* * Ensure that ethernet header and next three bytes * will fit into single mbuf @@ -427,7 +427,7 @@ ef_output(struct ifnet *ifp, struct mbuf **mp, struct sockaddr *dst, short *tp, *hlen += 3; break; case ETHER_FT_SNAP: - M_PREPEND(m, 8, M_WAIT); + M_PREPEND(m, 8, M_WAITOK); type = htons(m->m_pkthdr.len); cp = mtod(m, u_char *); bcopy("\xAA\xAA\x03\x00\x00\x00\x81\x37", cp, 8); diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index 44ac25d53935..bb4029e95dfc 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -260,7 +260,7 @@ ether_output(struct ifnet *ifp, struct mbuf *m, struct llc llc; ifa_free(&aa->aa_ifa); - M_PREPEND(m, LLC_SNAPFRAMELEN, M_DONTWAIT); + M_PREPEND(m, LLC_SNAPFRAMELEN, M_NOWAIT); if (m == NULL) senderr(ENOBUFS); llc.llc_dsap = llc.llc_ssap = LLC_SNAP_LSAP; @@ -313,7 +313,7 @@ ether_output(struct ifnet *ifp, struct mbuf *m, * Add local net header. If no space in first mbuf, * allocate another. */ - M_PREPEND(m, ETHER_HDR_LEN, M_DONTWAIT); + M_PREPEND(m, ETHER_HDR_LEN, M_NOWAIT); if (m == NULL) senderr(ENOBUFS); eh = mtod(m, struct ether_header *); @@ -362,7 +362,7 @@ ether_output(struct ifnet *ifp, struct mbuf *m, * often used kernel parts suffer from the same bug. * See PR kern/105943 for a proposed general solution. */ - if ((n = m_dup(m, M_DONTWAIT)) != NULL) { + if ((n = m_dup(m, M_NOWAIT)) != NULL) { n->m_pkthdr.csum_flags |= csum_flags; if (csum_flags & CSUM_DATA_VALID) n->m_pkthdr.csum_data = 0xffff; @@ -864,7 +864,7 @@ ether_demux(struct ifnet *ifp, struct mbuf *m) * Put back the ethernet header so netgraph has a * consistent view of inbound packets. */ - M_PREPEND(m, ETHER_HDR_LEN, M_DONTWAIT); + M_PREPEND(m, ETHER_HDR_LEN, M_NOWAIT); (*ng_ether_input_orphan_p)(ifp, m); return; } @@ -1288,7 +1288,7 @@ ether_vlanencap(struct mbuf *m, uint16_t tag) { struct ether_vlan_header *evl; - M_PREPEND(m, ETHER_VLAN_ENCAP_LEN, M_DONTWAIT); + M_PREPEND(m, ETHER_VLAN_ENCAP_LEN, M_NOWAIT); if (m == NULL) return (NULL); /* M_PREPEND takes care of m_len, m_pkthdr.len for us */ diff --git a/sys/net/if_fddisubr.c b/sys/net/if_fddisubr.c index d98029cfe887..57fb27d36d51 100644 --- a/sys/net/if_fddisubr.c +++ b/sys/net/if_fddisubr.c @@ -212,7 +212,7 @@ fddi_output(ifp, m, dst, ro) if (aa->aa_flags & AFA_PHASE2) { struct llc llc; - M_PREPEND(m, LLC_SNAPFRAMELEN, M_WAIT); + M_PREPEND(m, LLC_SNAPFRAMELEN, M_WAITOK); llc.llc_dsap = llc.llc_ssap = LLC_SNAP_LSAP; llc.llc_control = LLC_UI; bcopy(at_org_code, llc.llc_snap.org_code, sizeof(at_org_code)); @@ -291,7 +291,7 @@ fddi_output(ifp, m, dst, ro) */ if (type != 0) { struct llc *l; - M_PREPEND(m, LLC_SNAPFRAMELEN, M_DONTWAIT); + M_PREPEND(m, LLC_SNAPFRAMELEN, M_NOWAIT); if (m == 0) senderr(ENOBUFS); l = mtod(m, struct llc *); @@ -307,7 +307,7 @@ fddi_output(ifp, m, dst, ro) * Add local net header. If no space in first mbuf, * allocate another. */ - M_PREPEND(m, FDDI_HDR_LEN, M_DONTWAIT); + M_PREPEND(m, FDDI_HDR_LEN, M_NOWAIT); if (m == 0) senderr(ENOBUFS); fh = mtod(m, struct fddi_header *); diff --git a/sys/net/if_fwsubr.c b/sys/net/if_fwsubr.c index 5414d792de04..e1d5c01022a6 100644 --- a/sys/net/if_fwsubr.c +++ b/sys/net/if_fwsubr.c @@ -229,7 +229,7 @@ firewire_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, /* * No fragmentation is necessary. */ - M_PREPEND(m, sizeof(uint32_t), M_DONTWAIT); + M_PREPEND(m, sizeof(uint32_t), M_NOWAIT); if (!m) { error = ENOBUFS; goto bad; @@ -261,7 +261,7 @@ firewire_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, * Split off the tail segment from the * datagram, copying our tags over. */ - mtail = m_split(m, fsize, M_DONTWAIT); + mtail = m_split(m, fsize, M_NOWAIT); m_tag_copy_chain(mtail, m, M_NOWAIT); } else { mtail = 0; @@ -271,7 +271,7 @@ firewire_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, * Add our encapsulation header to this * fragment and hand it off to the link. */ - M_PREPEND(m, 2*sizeof(uint32_t), M_DONTWAIT); + M_PREPEND(m, 2*sizeof(uint32_t), M_NOWAIT); if (!m) { error = ENOBUFS; goto bad; diff --git a/sys/net/if_gre.c b/sys/net/if_gre.c index b72f064fa641..27e58d800ce8 100644 --- a/sys/net/if_gre.c +++ b/sys/net/if_gre.c @@ -385,7 +385,7 @@ gre_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, if ((m->m_data - msiz) < m->m_pktdat) { /* need new mbuf */ - MGETHDR(m0, M_DONTWAIT, MT_DATA); + MGETHDR(m0, M_NOWAIT, MT_DATA); if (m0 == NULL) { _IF_DROP(&ifp->if_snd); m_freem(m); @@ -452,7 +452,7 @@ gre_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, int hdrlen = sizeof(struct greip) + extra; if (sc->key) hdrlen += sizeof(uint32_t); - M_PREPEND(m, hdrlen, M_DONTWAIT); + M_PREPEND(m, hdrlen, M_NOWAIT); } else { _IF_DROP(&ifp->if_snd); m_freem(m); diff --git a/sys/net/if_iso88025subr.c b/sys/net/if_iso88025subr.c index 91d67fdd5323..7f9e8bd10ae0 100644 --- a/sys/net/if_iso88025subr.c +++ b/sys/net/if_iso88025subr.c @@ -338,7 +338,7 @@ iso88025_output(ifp, m, dst, ro) bcopy((caddr_t)&(satoipx_addr(dst).x_host), (caddr_t)edst, ISO88025_ADDR_LEN); - M_PREPEND(m, 3, M_WAIT); + M_PREPEND(m, 3, M_WAITOK); m = m_pullup(m, 3); if (m == 0) senderr(ENOBUFS); @@ -382,7 +382,7 @@ iso88025_output(ifp, m, dst, ro) */ if (snap_type != 0) { struct llc *l; - M_PREPEND(m, LLC_SNAPFRAMELEN, M_DONTWAIT); + M_PREPEND(m, LLC_SNAPFRAMELEN, M_NOWAIT); if (m == 0) senderr(ENOBUFS); l = mtod(m, struct llc *); @@ -398,7 +398,7 @@ iso88025_output(ifp, m, dst, ro) * Add local net header. If no space in first mbuf, * allocate another. */ - M_PREPEND(m, ISO88025_HDR_LEN + rif_len, M_DONTWAIT); + M_PREPEND(m, ISO88025_HDR_LEN + rif_len, M_NOWAIT); if (m == 0) senderr(ENOBUFS); th = mtod(m, struct iso88025_header *); diff --git a/sys/net/if_spppfr.c b/sys/net/if_spppfr.c index ee5339e56ab7..b5e24f6802d2 100644 --- a/sys/net/if_spppfr.c +++ b/sys/net/if_spppfr.c @@ -304,7 +304,7 @@ struct mbuf *sppp_fr_header (struct sppp *sp, struct mbuf *m, /* Prepend the space for Frame Relay header. */ hlen = (family == AF_INET) ? 4 : 10; - M_PREPEND (m, hlen, M_DONTWAIT); + M_PREPEND (m, hlen, M_NOWAIT); if (! m) return 0; h = mtod (m, u_char*); @@ -381,7 +381,7 @@ void sppp_fr_keepalive (struct sppp *sp) unsigned char *h, *p; struct mbuf *m; - MGETHDR (m, M_DONTWAIT, MT_DATA); + MGETHDR (m, M_NOWAIT, MT_DATA); if (! m) return; m->m_pkthdr.rcvif = 0; @@ -501,7 +501,7 @@ static void sppp_fr_arp (struct sppp *sp, struct arp_req *req, (unsigned char) his_ip_address); /* Send the Inverse ARP reply. */ - MGETHDR (m, M_DONTWAIT, MT_DATA); + MGETHDR (m, M_NOWAIT, MT_DATA); if (! m) return; m->m_pkthdr.len = m->m_len = 10 + sizeof (*reply); diff --git a/sys/net/if_spppsubr.c b/sys/net/if_spppsubr.c index e5fbac902c67..23851099f81b 100644 --- a/sys/net/if_spppsubr.c +++ b/sys/net/if_spppsubr.c @@ -629,7 +629,7 @@ sppp_input(struct ifnet *ifp, struct mbuf *m) * enough leading space in the existing mbuf). */ m_adj(m, vjlen); - M_PREPEND(m, hlen, M_DONTWAIT); + M_PREPEND(m, hlen, M_NOWAIT); if (m == NULL) { SPPP_UNLOCK(sp); goto drop2; @@ -920,7 +920,7 @@ sppp_output(struct ifnet *ifp, struct mbuf *m, /* * Prepend general data packet PPP header. For now, IP only. */ - M_PREPEND (m, PPP_HEADER_LEN, M_DONTWAIT); + M_PREPEND (m, PPP_HEADER_LEN, M_NOWAIT); if (! m) { nobufs: if (debug) log(LOG_DEBUG, SPP_FMT "no memory for transmit header\n", @@ -1392,7 +1392,7 @@ sppp_cisco_send(struct sppp *sp, int type, long par1, long par2) getmicrouptime(&tv); - MGETHDR (m, M_DONTWAIT, MT_DATA); + MGETHDR (m, M_NOWAIT, MT_DATA); if (! m) return; m->m_pkthdr.len = m->m_len = PPP_HEADER_LEN + CISCO_PACKET_LEN; @@ -1440,7 +1440,7 @@ sppp_cp_send(struct sppp *sp, u_short proto, u_char type, if (len > MHLEN - PPP_HEADER_LEN - LCP_HEADER_LEN) len = MHLEN - PPP_HEADER_LEN - LCP_HEADER_LEN; - MGETHDR (m, M_DONTWAIT, MT_DATA); + MGETHDR (m, M_NOWAIT, MT_DATA); if (! m) return; m->m_pkthdr.len = m->m_len = PPP_HEADER_LEN + LCP_HEADER_LEN + len; @@ -4722,7 +4722,7 @@ sppp_auth_send(const struct cp *cp, struct sppp *sp, const char *msg; va_list ap; - MGETHDR (m, M_DONTWAIT, MT_DATA); + MGETHDR (m, M_NOWAIT, MT_DATA); if (! m) return; m->m_pkthdr.rcvif = 0; diff --git a/sys/net/if_stf.c b/sys/net/if_stf.c index edde4561f7fa..c7ea06c59e76 100644 --- a/sys/net/if_stf.c +++ b/sys/net/if_stf.c @@ -506,7 +506,7 @@ stf_output(ifp, m, dst, ro) bpf_mtap2(ifp->if_bpf, &af, sizeof(af), m); } - M_PREPEND(m, sizeof(struct ip), M_DONTWAIT); + M_PREPEND(m, sizeof(struct ip), M_NOWAIT); if (m && m->m_len < sizeof(struct ip)) m = m_pullup(m, sizeof(struct ip)); if (m == NULL) { diff --git a/sys/net/if_tap.c b/sys/net/if_tap.c index 5c8da74fd0ca..45bd7d269b9e 100644 --- a/sys/net/if_tap.c +++ b/sys/net/if_tap.c @@ -948,7 +948,7 @@ tapwrite(struct cdev *dev, struct uio *uio, int flag) return (EIO); } - if ((m = m_uiotombuf(uio, M_DONTWAIT, 0, ETHER_ALIGN, + if ((m = m_uiotombuf(uio, M_NOWAIT, 0, ETHER_ALIGN, M_PKTHDR)) == NULL) { ifp->if_ierrors ++; return (ENOBUFS); diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c index 086a3c188f8a..3630732deedd 100644 --- a/sys/net/if_tun.c +++ b/sys/net/if_tun.c @@ -622,7 +622,7 @@ tunoutput(struct ifnet *ifp, struct mbuf *m0, struct sockaddr *dst, /* prepend sockaddr? this may abort if the mbuf allocation fails */ if (cached_tun_flags & TUN_LMODE) { /* allocate space for sockaddr */ - M_PREPEND(m0, dst->sa_len, M_DONTWAIT); + M_PREPEND(m0, dst->sa_len, M_NOWAIT); /* if allocation failed drop packet */ if (m0 == NULL) { @@ -636,7 +636,7 @@ tunoutput(struct ifnet *ifp, struct mbuf *m0, struct sockaddr *dst, if (cached_tun_flags & TUN_IFHEAD) { /* Prepend the address family */ - M_PREPEND(m0, 4, M_DONTWAIT); + M_PREPEND(m0, 4, M_NOWAIT); /* if allocation failed drop packet */ if (m0 == NULL) { @@ -872,7 +872,7 @@ tunwrite(struct cdev *dev, struct uio *uio, int flag) return (EIO); } - if ((m = m_uiotombuf(uio, M_DONTWAIT, 0, 0, M_PKTHDR)) == NULL) { + if ((m = m_uiotombuf(uio, M_NOWAIT, 0, 0, M_PKTHDR)) == NULL) { ifp->if_ierrors++; return (ENOBUFS); } diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c index d1bf200619ed..a4d7407814e2 100644 --- a/sys/net/rtsock.c +++ b/sys/net/rtsock.c @@ -1113,9 +1113,9 @@ rt_msg1(int type, struct rt_addrinfo *rtinfo) } if (len > MCLBYTES) panic("rt_msg1"); - m = m_gethdr(M_DONTWAIT, MT_DATA); + m = m_gethdr(M_NOWAIT, MT_DATA); if (m && len > MHLEN) { - MCLGET(m, M_DONTWAIT); + MCLGET(m, M_NOWAIT); if ((m->m_flags & M_EXT) == 0) { m_free(m); m = NULL; diff --git a/sys/net80211/ieee80211_freebsd.c b/sys/net80211/ieee80211_freebsd.c index ec7ee49b9779..1c6491551a4c 100644 --- a/sys/net80211/ieee80211_freebsd.c +++ b/sys/net80211/ieee80211_freebsd.c @@ -445,9 +445,9 @@ ieee80211_realign(struct ieee80211vap *vap, struct mbuf *m, size_t align) pktlen = m->m_pkthdr.len; space = pktlen + align; if (space < MINCLSIZE) - n = m_gethdr(M_DONTWAIT, MT_DATA); + n = m_gethdr(M_NOWAIT, MT_DATA); else { - n = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, + n = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, space <= MCLBYTES ? MCLBYTES : #if MJUMPAGESIZE != MCLBYTES space <= MJUMPAGESIZE ? MJUMPAGESIZE : diff --git a/sys/net80211/ieee80211_hostap.c b/sys/net80211/ieee80211_hostap.c index 01a8078bdfe0..ad7987646c11 100644 --- a/sys/net80211/ieee80211_hostap.c +++ b/sys/net80211/ieee80211_hostap.c @@ -376,7 +376,7 @@ hostap_deliver_data(struct ieee80211vap *vap, struct mbuf *mcopy = NULL; if (m->m_flags & M_MCAST) { - mcopy = m_dup(m, M_DONTWAIT); + mcopy = m_dup(m, M_NOWAIT); if (mcopy == NULL) ifp->if_oerrors++; else diff --git a/sys/net80211/ieee80211_hwmp.c b/sys/net80211/ieee80211_hwmp.c index 4e2508e12027..fcc4af1a66a1 100644 --- a/sys/net80211/ieee80211_hwmp.c +++ b/sys/net80211/ieee80211_hwmp.c @@ -652,7 +652,7 @@ hwmp_send_action(struct ieee80211_node *ni, } m->m_pkthdr.len = m->m_len = frm - mtod(m, uint8_t *); - M_PREPEND(m, sizeof(struct ieee80211_frame), M_DONTWAIT); + M_PREPEND(m, sizeof(struct ieee80211_frame), M_NOWAIT); if (m == NULL) { ieee80211_free_node(ni); vap->iv_stats.is_tx_nobuf++; diff --git a/sys/net80211/ieee80211_input.c b/sys/net80211/ieee80211_input.c index 76b3bedf12b1..a9acad189b32 100644 --- a/sys/net80211/ieee80211_input.c +++ b/sys/net80211/ieee80211_input.c @@ -131,7 +131,7 @@ ieee80211_input_mimo_all(struct ieee80211com *ic, struct mbuf *m, * Packet contents are changed by ieee80211_decap * so do a deep copy of the packet. */ - mcopy = m_dup(m, M_DONTWAIT); + mcopy = m_dup(m, M_NOWAIT); if (mcopy == NULL) { /* XXX stat+msg */ continue; diff --git a/sys/net80211/ieee80211_mesh.c b/sys/net80211/ieee80211_mesh.c index 89f85ad12632..6ab76d92a158 100644 --- a/sys/net80211/ieee80211_mesh.c +++ b/sys/net80211/ieee80211_mesh.c @@ -947,7 +947,7 @@ mesh_forward(struct ieee80211vap *vap, struct mbuf *m, vap->iv_stats.is_mesh_fwd_disabled++; return; } - mcopy = m_dup(m, M_DONTWAIT); + mcopy = m_dup(m, M_NOWAIT); if (mcopy == NULL) { IEEE80211_NOTE_FRAME(vap, IEEE80211_MSG_MESH, wh, "%s", "frame not fwd'd, cannot dup"); diff --git a/sys/net80211/ieee80211_output.c b/sys/net80211/ieee80211_output.c index 7430c34aedda..57925f2e038c 100644 --- a/sys/net80211/ieee80211_output.c +++ b/sys/net80211/ieee80211_output.c @@ -632,7 +632,7 @@ ieee80211_mgmt_output(struct ieee80211_node *ni, struct mbuf *m, int type, return EIO; /* XXX */ } - M_PREPEND(m, sizeof(struct ieee80211_frame), M_DONTWAIT); + M_PREPEND(m, sizeof(struct ieee80211_frame), M_NOWAIT); if (m == NULL) { ieee80211_free_node(ni); return ENOMEM; @@ -718,7 +718,7 @@ ieee80211_send_nulldata(struct ieee80211_node *ni) } KASSERT(M_LEADINGSPACE(m) >= hdrlen, ("leading space %zd", M_LEADINGSPACE(m))); - M_PREPEND(m, hdrlen, M_DONTWAIT); + M_PREPEND(m, hdrlen, M_NOWAIT); if (m == NULL) { /* NB: cannot happen */ ieee80211_free_node(ni); @@ -1191,7 +1191,7 @@ ieee80211_encap(struct ieee80211vap *vap, struct ieee80211_node *ni, } datalen = m->m_pkthdr.len; /* NB: w/o 802.11 header */ - M_PREPEND(m, hdrspace + meshhdrsize, M_DONTWAIT); + M_PREPEND(m, hdrspace + meshhdrsize, M_NOWAIT); if (m == NULL) { vap->iv_stats.is_tx_nobuf++; goto bad; @@ -1430,9 +1430,9 @@ ieee80211_fragment(struct ieee80211vap *vap, struct mbuf *m0, KASSERT(fragsize < MCLBYTES, ("fragment size %u too big!", fragsize)); if (fragsize > MHLEN) - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); else - m = m_gethdr(M_DONTWAIT, MT_DATA); + m = m_gethdr(M_NOWAIT, MT_DATA); if (m == NULL) goto bad; /* leave room to prepend any cipher header */ @@ -1867,7 +1867,7 @@ ieee80211_send_probereq(struct ieee80211_node *ni, KASSERT(M_LEADINGSPACE(m) >= sizeof(struct ieee80211_frame), ("leading space %zd", M_LEADINGSPACE(m))); - M_PREPEND(m, sizeof(struct ieee80211_frame), M_DONTWAIT); + M_PREPEND(m, sizeof(struct ieee80211_frame), M_NOWAIT); if (m == NULL) { /* NB: cannot happen */ ieee80211_free_node(ni); @@ -2495,7 +2495,7 @@ ieee80211_send_proberesp(struct ieee80211vap *vap, return ENOMEM; } - M_PREPEND(m, sizeof(struct ieee80211_frame), M_DONTWAIT); + M_PREPEND(m, sizeof(struct ieee80211_frame), M_NOWAIT); KASSERT(m != NULL, ("no room for header")); wh = mtod(m, struct ieee80211_frame *); @@ -2529,7 +2529,7 @@ ieee80211_alloc_rts(struct ieee80211com *ic, struct mbuf *m; /* XXX honor ic_headroom */ - m = m_gethdr(M_DONTWAIT, MT_DATA); + m = m_gethdr(M_NOWAIT, MT_DATA); if (m != NULL) { rts = mtod(m, struct ieee80211_frame_rts *); rts->i_fc[0] = IEEE80211_FC0_VERSION_0 | @@ -2555,7 +2555,7 @@ ieee80211_alloc_cts(struct ieee80211com *ic, struct mbuf *m; /* XXX honor ic_headroom */ - m = m_gethdr(M_DONTWAIT, MT_DATA); + m = m_gethdr(M_NOWAIT, MT_DATA); if (m != NULL) { cts = mtod(m, struct ieee80211_frame_cts *); cts->i_fc[0] = IEEE80211_FC0_VERSION_0 | @@ -2865,7 +2865,7 @@ ieee80211_beacon_alloc(struct ieee80211_node *ni, } ieee80211_beacon_construct(m, frm, bo, ni); - M_PREPEND(m, sizeof(struct ieee80211_frame), M_DONTWAIT); + M_PREPEND(m, sizeof(struct ieee80211_frame), M_NOWAIT); KASSERT(m != NULL, ("no space for 802.11 header?")); wh = mtod(m, struct ieee80211_frame *); wh->i_fc[0] = IEEE80211_FC0_VERSION_0 | IEEE80211_FC0_TYPE_MGT | diff --git a/sys/net80211/ieee80211_superg.c b/sys/net80211/ieee80211_superg.c index 172c1f91fe6d..a061929d47a4 100644 --- a/sys/net80211/ieee80211_superg.c +++ b/sys/net80211/ieee80211_superg.c @@ -352,7 +352,7 @@ ff_encap1(struct ieee80211vap *vap, struct mbuf *m, llc->llc_snap.ether_type = eh->ether_type; payload = m->m_pkthdr.len; /* NB: w/o Ethernet header */ - M_PREPEND(m, sizeof(struct ether_header), M_DONTWAIT); + M_PREPEND(m, sizeof(struct ether_header), M_NOWAIT); if (m == NULL) { /* XXX cannot happen */ IEEE80211_DPRINTF(vap, IEEE80211_MSG_SUPERG, "%s: no space for ether_header\n", __func__); @@ -460,7 +460,7 @@ ieee80211_ff_encap(struct ieee80211vap *vap, struct mbuf *m1, int hdrspace, */ m->m_next = m2; /* NB: last mbuf from above */ m1->m_pkthdr.len += m2->m_pkthdr.len; - M_PREPEND(m1, sizeof(uint32_t)+2, M_DONTWAIT); + M_PREPEND(m1, sizeof(uint32_t)+2, M_NOWAIT); if (m1 == NULL) { /* XXX cannot happen */ IEEE80211_DPRINTF(vap, IEEE80211_MSG_SUPERG, "%s: no space for tunnel header\n", __func__); @@ -469,7 +469,7 @@ ieee80211_ff_encap(struct ieee80211vap *vap, struct mbuf *m1, int hdrspace, } memset(mtod(m1, void *), 0, sizeof(uint32_t)+2); - M_PREPEND(m1, sizeof(struct llc), M_DONTWAIT); + M_PREPEND(m1, sizeof(struct llc), M_NOWAIT); if (m1 == NULL) { /* XXX cannot happen */ IEEE80211_DPRINTF(vap, IEEE80211_MSG_SUPERG, "%s: no space for llc header\n", __func__); diff --git a/sys/net80211/ieee80211_wds.c b/sys/net80211/ieee80211_wds.c index ed82fac1c086..b9fd4ff87564 100644 --- a/sys/net80211/ieee80211_wds.c +++ b/sys/net80211/ieee80211_wds.c @@ -256,7 +256,7 @@ ieee80211_dwds_mcast(struct ieee80211vap *vap0, struct mbuf *m) /* * Duplicate the frame and send it. */ - mcopy = m_copypacket(m, M_DONTWAIT); + mcopy = m_copypacket(m, M_NOWAIT); if (mcopy == NULL) { ifp->if_oerrors++; /* XXX stat + msg */ diff --git a/sys/netatalk/aarp.c b/sys/netatalk/aarp.c index 7e340de85004..4426d57c11fa 100644 --- a/sys/netatalk/aarp.c +++ b/sys/netatalk/aarp.c @@ -190,7 +190,7 @@ aarpwhohas(struct ifnet *ifp, struct sockaddr_at *sat) struct sockaddr sa; AARPTAB_UNLOCK_ASSERT(); - m = m_gethdr(M_DONTWAIT, MT_DATA); + m = m_gethdr(M_NOWAIT, MT_DATA); if (m == NULL) return; #ifdef MAC @@ -230,7 +230,7 @@ aarpwhohas(struct ifnet *ifp, struct sockaddr_at *sat) sizeof(eh->ether_dhost)); eh->ether_type = htons(sizeof(struct llc) + sizeof(struct ether_aarp)); - M_PREPEND(m, sizeof(struct llc), M_DONTWAIT); + M_PREPEND(m, sizeof(struct llc), M_NOWAIT); if (m == NULL) { ifa_free(&aa->aa_ifa); return; @@ -524,7 +524,7 @@ at_aarpinput(struct ifnet *ifp, struct mbuf *m) if (aa->aa_flags & AFA_PHASE2) { eh->ether_type = htons(sizeof(struct llc) + sizeof(struct ether_aarp)); - M_PREPEND(m, sizeof(struct llc), M_DONTWAIT); + M_PREPEND(m, sizeof(struct llc), M_NOWAIT); if (m == NULL) { ifa_free(&aa->aa_ifa); return; @@ -643,7 +643,7 @@ aarpprobe(void *arg) ifa_ref(&aa->aa_ifa); AARPTAB_UNLOCK(); - m = m_gethdr(M_DONTWAIT, MT_DATA); + m = m_gethdr(M_NOWAIT, MT_DATA); if (m == NULL) { ifa_free(&aa->aa_ifa); return; @@ -673,7 +673,7 @@ aarpprobe(void *arg) sizeof(eh->ether_dhost)); eh->ether_type = htons(sizeof(struct llc) + sizeof(struct ether_aarp)); - M_PREPEND(m, sizeof(struct llc), M_WAIT); + M_PREPEND(m, sizeof(struct llc), M_WAITOK); llc = mtod(m, struct llc *); llc->llc_dsap = llc->llc_ssap = LLC_SNAP_LSAP; llc->llc_control = LLC_UI; diff --git a/sys/netatalk/ddp_output.c b/sys/netatalk/ddp_output.c index 1b178be49b8c..2b53de46e759 100644 --- a/sys/netatalk/ddp_output.c +++ b/sys/netatalk/ddp_output.c @@ -54,7 +54,7 @@ ddp_output(struct mbuf *m, struct socket *so) mac_socket_create_mbuf(so, m); #endif - M_PREPEND(m, sizeof(struct ddpehdr), M_DONTWAIT); + M_PREPEND(m, sizeof(struct ddpehdr), M_NOWAIT); if (m == NULL) return (ENOBUFS); @@ -201,7 +201,7 @@ ddp_route(struct mbuf *m, struct route *ro) * removing mac_mbuf_copy(). */ if (!(aa->aa_flags & AFA_PHASE2)) { - MGET(m0, M_DONTWAIT, MT_DATA); + MGET(m0, M_NOWAIT, MT_DATA); if (m0 == NULL) { ifa_free(&aa->aa_ifa); m_freem(m); diff --git a/sys/netgraph/atm/ccatm/ng_ccatm.c b/sys/netgraph/atm/ccatm/ng_ccatm.c index a6ff474f2ae1..cdbc86f86331 100644 --- a/sys/netgraph/atm/ccatm/ng_ccatm.c +++ b/sys/netgraph/atm/ccatm/ng_ccatm.c @@ -434,13 +434,13 @@ send_dump(struct ccdata *data, void *uarg, const char *buf) struct ccnode *priv = uarg; if (priv->dump == NULL) { - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) return (ENOBUFS); priv->dump_first = priv->dump_last = m; m->m_pkthdr.len = 0; } else { - m = m_getcl(M_DONTWAIT, MT_DATA, 0); + m = m_getcl(M_NOWAIT, MT_DATA, 0); if (m == 0) { m_freem(priv->dump_first); return (ENOBUFS); diff --git a/sys/netgraph/atm/ng_atm.c b/sys/netgraph/atm/ng_atm.c index 32bde57ad02f..ef168ac719c2 100644 --- a/sys/netgraph/atm/ng_atm.c +++ b/sys/netgraph/atm/ng_atm.c @@ -384,7 +384,7 @@ ng_atm_input(struct ifnet *ifp, struct mbuf **mp, /* * Prepend the atm_pseudoheader. */ - M_PREPEND(*mp, sizeof(*ah), M_DONTWAIT); + M_PREPEND(*mp, sizeof(*ah), M_NOWAIT); if (*mp == NULL) return; memcpy(mtod(*mp, struct atm_pseudohdr *), ah, sizeof(*ah)); @@ -462,7 +462,7 @@ ng_atm_input_orphans(struct ifnet *ifp, struct mbuf *m, /* * Prepend the atm_pseudoheader. */ - M_PREPEND(m, sizeof(*ah), M_DONTWAIT); + M_PREPEND(m, sizeof(*ah), M_NOWAIT); if (m == NULL) return; memcpy(mtod(m, struct atm_pseudohdr *), ah, sizeof(*ah)); @@ -502,7 +502,7 @@ ng_atm_rcvdata(hook_p hook, item_p item) /* * Prepend pseudo-hdr. Drivers don't care about the flags. */ - M_PREPEND(m, sizeof(*aph), M_DONTWAIT); + M_PREPEND(m, sizeof(*aph), M_NOWAIT); if (m == NULL) { NG_FREE_M(m); return (ENOMEM); diff --git a/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c b/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c index b244b3019cd1..f2930abcdb02 100644 --- a/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c +++ b/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c @@ -807,7 +807,7 @@ bt3c_receive(bt3c_softc_p sc) sc->state = NG_BT3C_W4_PKT_IND; sc->want = 1; - MGETHDR(sc->m, M_DONTWAIT, MT_DATA); + MGETHDR(sc->m, M_NOWAIT, MT_DATA); if (sc->m == NULL) { NG_BT3C_ERR(sc->dev, "Could not get mbuf\n"); NG_BT3C_STAT_IERROR(sc->stat); @@ -815,7 +815,7 @@ bt3c_receive(bt3c_softc_p sc) break; /* XXX lost of sync */ } - MCLGET(sc->m, M_DONTWAIT); + MCLGET(sc->m, M_NOWAIT); if (!(sc->m->m_flags & M_EXT)) { NG_FREE_M(sc->m); diff --git a/sys/netgraph/bluetooth/drivers/h4/ng_h4.c b/sys/netgraph/bluetooth/drivers/h4/ng_h4.c index 2bf1717db7f6..97cee2ed29ad 100644 --- a/sys/netgraph/bluetooth/drivers/h4/ng_h4.c +++ b/sys/netgraph/bluetooth/drivers/h4/ng_h4.c @@ -525,7 +525,7 @@ ng_h4_input(int c, struct tty *tp) if (sc->hook != NULL && NG_HOOK_IS_VALID(sc->hook)) { struct mbuf *m = NULL; - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m != NULL) { m->m_pkthdr.len = 0; diff --git a/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c b/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c index 44654d20555d..6de270fd9f9b 100644 --- a/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c +++ b/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c @@ -710,13 +710,13 @@ ubt_intr_read_callback(struct usb_xfer *xfer, usb_error_t error) switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: /* Allocate a new mbuf */ - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) { UBT_STAT_IERROR(sc); goto submit_next; } - MCLGET(m, M_DONTWAIT); + MCLGET(m, M_NOWAIT); if (!(m->m_flags & M_EXT)) { UBT_STAT_IERROR(sc); goto submit_next; @@ -810,13 +810,13 @@ ubt_bulk_read_callback(struct usb_xfer *xfer, usb_error_t error) switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: /* Allocate new mbuf */ - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) { UBT_STAT_IERROR(sc); goto submit_next; } - MCLGET(m, M_DONTWAIT); + MCLGET(m, M_NOWAIT); if (!(m->m_flags & M_EXT)) { UBT_STAT_IERROR(sc); goto submit_next; @@ -1020,13 +1020,13 @@ ubt_isoc_read_one_frame(struct usb_xfer *xfer, int frame_no) while (total > 0) { if (m == NULL) { /* Start new reassembly buffer */ - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) { UBT_STAT_IERROR(sc); return (-1); /* XXX out of sync! */ } - MCLGET(m, M_DONTWAIT); + MCLGET(m, M_NOWAIT); if (!(m->m_flags & M_EXT)) { UBT_STAT_IERROR(sc); NG_FREE_M(m); diff --git a/sys/netgraph/bluetooth/hci/ng_hci_cmds.c b/sys/netgraph/bluetooth/hci/ng_hci_cmds.c index 8d630a272b84..1dc9854e342a 100644 --- a/sys/netgraph/bluetooth/hci/ng_hci_cmds.c +++ b/sys/netgraph/bluetooth/hci/ng_hci_cmds.c @@ -118,7 +118,7 @@ ng_hci_send_command(ng_hci_unit_p unit) ng_hci_mtap(unit, m0); - m = m_dup(m0, M_DONTWAIT); + m = m_dup(m0, M_NOWAIT); if (m != NULL) NG_SEND_DATA_ONLY(error, unit->drv, m); else diff --git a/sys/netgraph/bluetooth/hci/ng_hci_evnt.c b/sys/netgraph/bluetooth/hci/ng_hci_evnt.c index a4cc9ba45470..b8dd21fd1580 100644 --- a/sys/netgraph/bluetooth/hci/ng_hci_evnt.c +++ b/sys/netgraph/bluetooth/hci/ng_hci_evnt.c @@ -511,7 +511,7 @@ con_compl(ng_hci_unit_p unit, struct mbuf *event) } __attribute__ ((packed)) *lp; struct mbuf *m; - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m != NULL) { m->m_pkthdr.len = m->m_len = sizeof(*lp); lp = mtod(m, struct __link_policy *); diff --git a/sys/netgraph/bluetooth/hci/ng_hci_misc.c b/sys/netgraph/bluetooth/hci/ng_hci_misc.c index 252a5809039e..2209fbde0493 100644 --- a/sys/netgraph/bluetooth/hci/ng_hci_misc.c +++ b/sys/netgraph/bluetooth/hci/ng_hci_misc.c @@ -65,7 +65,7 @@ ng_hci_mtap(ng_hci_unit_p unit, struct mbuf *m0) int error = 0; if (unit->raw != NULL && NG_HOOK_IS_VALID(unit->raw)) { - m = m_dup(m0, M_DONTWAIT); + m = m_dup(m0, M_NOWAIT); if (m != NULL) NG_SEND_DATA_ONLY(error, unit->raw, m); diff --git a/sys/netgraph/bluetooth/hci/ng_hci_ulpi.c b/sys/netgraph/bluetooth/hci/ng_hci_ulpi.c index 311bd4f782f6..4c06c07938b0 100644 --- a/sys/netgraph/bluetooth/hci/ng_hci_ulpi.c +++ b/sys/netgraph/bluetooth/hci/ng_hci_ulpi.c @@ -224,7 +224,7 @@ ng_hci_lp_acl_con_req(ng_hci_unit_p unit, item_p item, hook_p hook) * Create HCI command */ - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) { ng_hci_free_con(con); error = ENOBUFS; @@ -417,7 +417,7 @@ ng_hci_lp_sco_con_req(ng_hci_unit_p unit, item_p item, hook_p hook) * Create HCI command */ - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) { ng_hci_free_con(sco_con); error = ENOBUFS; @@ -531,7 +531,7 @@ ng_hci_lp_discon_req(ng_hci_unit_p unit, item_p item, hook_p hook) * Create HCI command */ - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) { error = ENOBUFS; goto out; @@ -776,7 +776,7 @@ ng_hci_lp_con_rsp(ng_hci_unit_p unit, item_p item, hook_p hook) * Create HCI command */ - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) { error = ENOBUFS; goto out; @@ -996,7 +996,7 @@ ng_hci_lp_qos_req(ng_hci_unit_p unit, item_p item, hook_p hook) * Create HCI command */ - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) { error = ENOBUFS; goto out; diff --git a/sys/netgraph/bluetooth/l2cap/ng_l2cap_cmds.h b/sys/netgraph/bluetooth/l2cap/ng_l2cap_cmds.h index ed225c837792..52789a159125 100644 --- a/sys/netgraph/bluetooth/l2cap/ng_l2cap_cmds.h +++ b/sys/netgraph/bluetooth/l2cap/ng_l2cap_cmds.h @@ -56,7 +56,7 @@ do { \ ng_l2cap_cmd_rej_data_t data; \ } __attribute__ ((packed)) *c = NULL; \ \ - MGETHDR((_m), M_DONTWAIT, MT_DATA); \ + MGETHDR((_m), M_NOWAIT, MT_DATA); \ if ((_m) == NULL) \ break; \ \ @@ -90,7 +90,7 @@ do { \ ng_l2cap_con_req_cp param; \ } __attribute__ ((packed)) *c = NULL; \ \ - MGETHDR((_m), M_DONTWAIT, MT_DATA); \ + MGETHDR((_m), M_NOWAIT, MT_DATA); \ if ((_m) == NULL) \ break; \ \ @@ -113,7 +113,7 @@ do { \ ng_l2cap_con_rsp_cp param; \ } __attribute__ ((packed)) *c = NULL; \ \ - MGETHDR((_m), M_DONTWAIT, MT_DATA); \ + MGETHDR((_m), M_NOWAIT, MT_DATA); \ if ((_m) == NULL) \ break; \ \ @@ -138,7 +138,7 @@ do { \ ng_l2cap_cfg_req_cp param; \ } __attribute__ ((packed)) *c = NULL; \ \ - MGETHDR((_m), M_DONTWAIT, MT_DATA); \ + MGETHDR((_m), M_NOWAIT, MT_DATA); \ if ((_m) == NULL) { \ NG_FREE_M((_data)); \ break; \ @@ -172,7 +172,7 @@ do { \ ng_l2cap_cfg_rsp_cp param; \ } __attribute__ ((packed)) *c = NULL; \ \ - MGETHDR((_m), M_DONTWAIT, MT_DATA); \ + MGETHDR((_m), M_NOWAIT, MT_DATA); \ if ((_m) == NULL) { \ NG_FREE_M((_data)); \ break; \ @@ -204,7 +204,7 @@ do { \ do { \ u_int8_t *p = NULL; \ \ - MGETHDR((_m), M_DONTWAIT, MT_DATA); \ + MGETHDR((_m), M_NOWAIT, MT_DATA); \ if ((_m) == NULL) \ break; \ \ @@ -281,7 +281,7 @@ do { \ ng_l2cap_discon_req_cp param; \ } __attribute__ ((packed)) *c = NULL; \ \ - MGETHDR((_m), M_DONTWAIT, MT_DATA); \ + MGETHDR((_m), M_NOWAIT, MT_DATA); \ if ((_m) == NULL) \ break; \ \ @@ -304,7 +304,7 @@ do { \ ng_l2cap_discon_rsp_cp param; \ } __attribute__ ((packed)) *c = NULL; \ \ - MGETHDR((_m), M_DONTWAIT, MT_DATA); \ + MGETHDR((_m), M_NOWAIT, MT_DATA); \ if ((_m) == NULL) \ break; \ \ @@ -324,7 +324,7 @@ do { \ do { \ ng_l2cap_cmd_hdr_t *c = NULL; \ \ - MGETHDR((_m), M_DONTWAIT, MT_DATA); \ + MGETHDR((_m), M_NOWAIT, MT_DATA); \ if ((_m) == NULL) \ break; \ \ @@ -351,7 +351,7 @@ do { \ ng_l2cap_info_req_cp param; \ } __attribute__ ((packed)) *c = NULL; \ \ - MGETHDR((_m), M_DONTWAIT, MT_DATA); \ + MGETHDR((_m), M_NOWAIT, MT_DATA); \ if ((_m) == NULL) \ break; \ \ @@ -374,7 +374,7 @@ do { \ ng_l2cap_info_rsp_data_t data; \ } __attribute__ ((packed)) *c = NULL; \ \ - MGETHDR((_m), M_DONTWAIT, MT_DATA); \ + MGETHDR((_m), M_NOWAIT, MT_DATA); \ if ((_m) == NULL) \ break; \ \ diff --git a/sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c b/sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c index 9d5268e89cf4..747b74ca7086 100644 --- a/sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c +++ b/sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c @@ -192,7 +192,7 @@ ng_l2cap_process_signal_cmd(ng_l2cap_con_p con) /* Get the command, save the rest (if any) */ if (con->rx_pkt->m_pkthdr.len > hdr->length) - m = m_split(con->rx_pkt, hdr->length, M_DONTWAIT); + m = m_split(con->rx_pkt, hdr->length, M_NOWAIT); else m = NULL; diff --git a/sys/netgraph/bluetooth/l2cap/ng_l2cap_llpi.c b/sys/netgraph/bluetooth/l2cap/ng_l2cap_llpi.c index 923ecfc6ffdd..704e74a9110e 100644 --- a/sys/netgraph/bluetooth/l2cap/ng_l2cap_llpi.c +++ b/sys/netgraph/bluetooth/l2cap/ng_l2cap_llpi.c @@ -528,7 +528,7 @@ ng_l2cap_lp_send(ng_l2cap_con_p con, u_int16_t dcid, struct mbuf *m0) /* Check length of the packet against HCI MTU */ len = m0->m_pkthdr.len; if (len > l2cap->pkt_size) { - m = m_split(m0, l2cap->pkt_size, M_DONTWAIT); + m = m_split(m0, l2cap->pkt_size, M_NOWAIT); if (m == NULL) { NG_L2CAP_ALERT( "%s: %s - m_split(%d) failed\n", __func__, NG_NODE_NAME(l2cap->node), diff --git a/sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c b/sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c index 3791dcd0f0fb..0c3f1d0877bf 100644 --- a/sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c +++ b/sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c @@ -558,7 +558,7 @@ ng_l2cap_command_untimeout(ng_l2cap_cmd_p cmd) struct mbuf * ng_l2cap_prepend(struct mbuf *m, int size) { - M_PREPEND(m, size, M_DONTWAIT); + M_PREPEND(m, size, M_NOWAIT); if (m == NULL || (m->m_len < size && (m = m_pullup(m, size)) == NULL)) return (NULL); diff --git a/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c b/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c index df189130fb6d..35cd766d2ebe 100644 --- a/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c +++ b/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c @@ -310,7 +310,7 @@ ng_btsocket_hci_raw_node_rcvdata(hook_p hook, item_p item) * for now */ - MGET(nam, M_DONTWAIT, MT_SONAME); + MGET(nam, M_NOWAIT, MT_SONAME); if (nam != NULL) { struct sockaddr_hci *sa = mtod(nam, struct sockaddr_hci *); @@ -519,7 +519,7 @@ ng_btsocket_hci_raw_data_input(struct mbuf *nam) * will check if socket has enough buffer space. */ - m = m_dup(m0, M_DONTWAIT); + m = m_dup(m0, M_NOWAIT); if (m != NULL) { struct mbuf *ctl = NULL; @@ -1585,7 +1585,7 @@ ng_btsocket_hci_raw_send(struct socket *so, int flags, struct mbuf *m, sa = (struct sockaddr *) &pcb->addr; } - MGET(nam, M_DONTWAIT, MT_SONAME); + MGET(nam, M_NOWAIT, MT_SONAME); if (nam == NULL) { mtx_unlock(&pcb->pcb_mtx); error = ENOBUFS; diff --git a/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c b/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c index 0066a855a2bd..993494596ccc 100644 --- a/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c +++ b/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c @@ -1533,7 +1533,7 @@ ng_btsocket_l2cap_data_input(struct mbuf *m, hook_p hook) * it is a broadcast traffic after all */ - copy = m_dup(m, M_DONTWAIT); + copy = m_dup(m, M_NOWAIT); if (copy != NULL) { sbappendrecord(&pcb->so->so_rcv, copy); sorwakeup(pcb->so); @@ -2513,12 +2513,12 @@ ng_btsocket_l2cap_send2(ng_btsocket_l2cap_pcb_p pcb) if (pcb->so->so_snd.sb_cc == 0) return (EINVAL); /* XXX */ - m = m_dup(pcb->so->so_snd.sb_mb, M_DONTWAIT); + m = m_dup(pcb->so->so_snd.sb_mb, M_NOWAIT); if (m == NULL) return (ENOBUFS); /* Create L2CA packet header */ - M_PREPEND(m, sizeof(*hdr), M_DONTWAIT); + M_PREPEND(m, sizeof(*hdr), M_NOWAIT); if (m != NULL) if (m->m_len < sizeof(*hdr)) m = m_pullup(m, sizeof(*hdr)); diff --git a/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c b/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c index a0e266ed72b5..0ffc12e8957b 100644 --- a/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c +++ b/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c @@ -3005,7 +3005,7 @@ ng_btsocket_rfcomm_send_command(ng_btsocket_rfcomm_session_p s, /* NOT REACHED */ } - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) return (ENOBUFS); @@ -3036,14 +3036,14 @@ ng_btsocket_rfcomm_send_uih(ng_btsocket_rfcomm_session_p s, u_int8_t address, mtx_assert(&s->session_mtx, MA_OWNED); - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) { NG_FREE_M(data); return (ENOBUFS); } m->m_pkthdr.len = m->m_len = sizeof(*hdr); - MGET(mcrc, M_DONTWAIT, MT_DATA); + MGET(mcrc, M_NOWAIT, MT_DATA); if (mcrc == NULL) { NG_FREE_M(data); return (ENOBUFS); @@ -3110,7 +3110,7 @@ ng_btsocket_rfcomm_send_msc(ng_btsocket_rfcomm_pcb_p pcb) mtx_assert(&pcb->session->session_mtx, MA_OWNED); mtx_assert(&pcb->pcb_mtx, MA_OWNED); - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) return (ENOBUFS); @@ -3148,7 +3148,7 @@ ng_btsocket_rfcomm_send_pn(ng_btsocket_rfcomm_pcb_p pcb) mtx_assert(&pcb->session->session_mtx, MA_OWNED); mtx_assert(&pcb->pcb_mtx, MA_OWNED); - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) return (ENOBUFS); @@ -3519,7 +3519,7 @@ ng_btsocket_rfcomm_prepare_packet(struct sockbuf *sb, int length) struct mbuf *top = NULL, *m = NULL, *n = NULL, *nextpkt = NULL; int mlen, noff, len; - MGETHDR(top, M_DONTWAIT, MT_DATA); + MGETHDR(top, M_NOWAIT, MT_DATA); if (top == NULL) return (NULL); @@ -3543,7 +3543,7 @@ ng_btsocket_rfcomm_prepare_packet(struct sockbuf *sb, int length) length -= len; if (length > 0 && m->m_len == mlen) { - MGET(m->m_next, M_DONTWAIT, MT_DATA); + MGET(m->m_next, M_NOWAIT, MT_DATA); if (m->m_next == NULL) { NG_FREE_M(top); return (NULL); diff --git a/sys/netgraph/bluetooth/socket/ng_btsocket_sco.c b/sys/netgraph/bluetooth/socket/ng_btsocket_sco.c index 12786fa9cd1a..7727d7c7f5c8 100644 --- a/sys/netgraph/bluetooth/socket/ng_btsocket_sco.c +++ b/sys/netgraph/bluetooth/socket/ng_btsocket_sco.c @@ -1746,14 +1746,14 @@ ng_btsocket_sco_send2(ng_btsocket_sco_pcb_p pcb) while (pcb->rt->pending < pcb->rt->num_pkts && pcb->so->so_snd.sb_cc > 0) { /* Get a copy of the first packet on send queue */ - m = m_dup(pcb->so->so_snd.sb_mb, M_DONTWAIT); + m = m_dup(pcb->so->so_snd.sb_mb, M_NOWAIT); if (m == NULL) { error = ENOBUFS; break; } /* Create SCO packet header */ - M_PREPEND(m, sizeof(*hdr), M_DONTWAIT); + M_PREPEND(m, sizeof(*hdr), M_NOWAIT); if (m != NULL) if (m->m_len < sizeof(*hdr)) m = m_pullup(m, sizeof(*hdr)); diff --git a/sys/netgraph/netflow/netflow.c b/sys/netgraph/netflow/netflow.c index 2775756d0449..c889a0de91a0 100644 --- a/sys/netgraph/netflow/netflow.c +++ b/sys/netgraph/netflow/netflow.c @@ -214,7 +214,7 @@ get_export_dgram(priv_p priv, fib_export_p fe) struct netflow_v5_export_dgram *dgram; struct mbuf *m; - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) return (NULL); item = ng_package_data(m, NG_NOFLAGS); diff --git a/sys/netgraph/netflow/netflow_v9.c b/sys/netgraph/netflow/netflow_v9.c index e0406655f770..a3c57911c9b3 100644 --- a/sys/netgraph/netflow/netflow_v9.c +++ b/sys/netgraph/netflow/netflow_v9.c @@ -386,7 +386,7 @@ get_export9_dgram(priv_p priv, fib_export_p fe, struct netflow_v9_packet_opt **t uint16_t mtu = priv->mtu; /* Allocate entire packet at once, allowing easy m_append() calls */ - m = m_getm(NULL, mtu, M_DONTWAIT, MT_DATA); + m = m_getm(NULL, mtu, M_NOWAIT, MT_DATA); if (m == NULL) return (NULL); diff --git a/sys/netgraph/ng_UI.c b/sys/netgraph/ng_UI.c index b06c17a22038..8e8ab55d6490 100644 --- a/sys/netgraph/ng_UI.c +++ b/sys/netgraph/ng_UI.c @@ -188,7 +188,7 @@ ng_UI_rcvdata(hook_p hook, item_p item) m_adj(m, ptr - start); NG_FWD_NEW_DATA(error, item, priv->uplink, m); /* m -> NULL */ } else if (hook == priv->uplink) { - M_PREPEND(m, 1, M_DONTWAIT); /* Prepend IP NLPID */ + M_PREPEND(m, 1, M_NOWAIT); /* Prepend IP NLPID */ if (!m) ERROUT(ENOBUFS); mtod(m, u_char *)[0] = HDLC_UI; diff --git a/sys/netgraph/ng_atmllc.c b/sys/netgraph/ng_atmllc.c index 3ba9dff75ae0..f35707b90b6d 100644 --- a/sys/netgraph/ng_atmllc.c +++ b/sys/netgraph/ng_atmllc.c @@ -202,7 +202,7 @@ ng_atmllc_rcvdata(hook_p hook, item_p item) m_adj(m, sizeof(struct atmllc) + padding); } else if (hook == priv->ether) { /* Add the LLC header */ - M_PREPEND(m, NG_ATMLLC_HEADER_LEN + 2, M_DONTWAIT); + M_PREPEND(m, NG_ATMLLC_HEADER_LEN + 2, M_NOWAIT); if (m == NULL) { printf("ng_atmllc: M_PREPEND failed\n"); NG_FREE_ITEM(item); @@ -219,7 +219,7 @@ ng_atmllc_rcvdata(hook_p hook, item_p item) outhook = priv->atm; } else if (hook == priv->fddi) { /* Add the LLC header */ - M_PREPEND(m, NG_ATMLLC_HEADER_LEN + 3, M_DONTWAIT); + M_PREPEND(m, NG_ATMLLC_HEADER_LEN + 3, M_NOWAIT); if (m == NULL) { printf("ng_atmllc: M_PREPEND failed\n"); NG_FREE_ITEM(item); diff --git a/sys/netgraph/ng_bridge.c b/sys/netgraph/ng_bridge.c index 738441d835c1..becfea160ed7 100644 --- a/sys/netgraph/ng_bridge.c +++ b/sys/netgraph/ng_bridge.c @@ -719,7 +719,7 @@ ng_bridge_rcvdata(hook_p hook, item_p item) * It's usable link but not the reserved (first) one. * Copy mbuf info for sending. */ - m2 = m_dup(m, M_DONTWAIT); /* XXX m_copypacket() */ + m2 = m_dup(m, M_NOWAIT); /* XXX m_copypacket() */ if (m2 == NULL) { link->stats.memoryFailures++; NG_FREE_ITEM(item); diff --git a/sys/netgraph/ng_cisco.c b/sys/netgraph/ng_cisco.c index 7183369ee38a..f937557fa798 100644 --- a/sys/netgraph/ng_cisco.c +++ b/sys/netgraph/ng_cisco.c @@ -360,7 +360,7 @@ cisco_rcvdata(hook_p hook, item_p item) /* OK so it came from a protocol, heading out. Prepend general data packet header. For now, IP,IPX only */ NGI_GET_M(item, m); - M_PREPEND(m, CISCO_HEADER_LEN, M_DONTWAIT); + M_PREPEND(m, CISCO_HEADER_LEN, M_NOWAIT); if (!m) { error = ENOBUFS; goto out; @@ -608,7 +608,7 @@ cisco_send(sc_p sc, int type, long par1, long par2) getmicrouptime(&time); - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (!m) return (ENOBUFS); diff --git a/sys/netgraph/ng_deflate.c b/sys/netgraph/ng_deflate.c index 5fa6363e8313..da68e49d24a8 100644 --- a/sys/netgraph/ng_deflate.c +++ b/sys/netgraph/ng_deflate.c @@ -462,7 +462,7 @@ ng_deflate_compress(node_p node, struct mbuf *m, struct mbuf **resultp) } /* We must own the mbuf chain exclusively to modify it. */ - m = m_unshare(m, M_DONTWAIT); + m = m_unshare(m, M_NOWAIT); if (m == NULL) { priv->stats.Errors++; return (ENOMEM); @@ -556,7 +556,7 @@ ng_deflate_decompress(node_p node, struct mbuf *m, struct mbuf **resultp) } /* We must own the mbuf chain exclusively to modify it. */ - m = m_unshare(m, M_DONTWAIT); + m = m_unshare(m, M_NOWAIT); if (m == NULL) { priv->stats.Errors++; return (ENOMEM); diff --git a/sys/netgraph/ng_device.c b/sys/netgraph/ng_device.c index f6e60879e351..723fbca8379e 100644 --- a/sys/netgraph/ng_device.c +++ b/sys/netgraph/ng_device.c @@ -465,7 +465,7 @@ ngdwrite(struct cdev *dev, struct uio *uio, int flag) if (uio->uio_resid < 0 || uio->uio_resid > IP_MAXPACKET) return (EIO); - if ((m = m_uiotombuf(uio, M_DONTWAIT, 0, 0, M_PKTHDR)) == NULL) + if ((m = m_uiotombuf(uio, M_NOWAIT, 0, 0, M_PKTHDR)) == NULL) return (ENOBUFS); NG_SEND_DATA_ONLY(error, priv->hook, m); diff --git a/sys/netgraph/ng_frame_relay.c b/sys/netgraph/ng_frame_relay.c index 05c311d8d7b6..4d39d11e1b63 100644 --- a/sys/netgraph/ng_frame_relay.c +++ b/sys/netgraph/ng_frame_relay.c @@ -360,7 +360,7 @@ ngfrm_rcvdata(hook_p hook, item_p item) alen = sc->addrlen; if (alen == 0) alen = 2; /* default value for transmit */ - M_PREPEND(m, alen, M_DONTWAIT); + M_PREPEND(m, alen, M_NOWAIT); if (m == NULL) { error = ENOBUFS; goto bad; diff --git a/sys/netgraph/ng_gif.c b/sys/netgraph/ng_gif.c index d362152323ae..580b8b13bd85 100644 --- a/sys/netgraph/ng_gif.c +++ b/sys/netgraph/ng_gif.c @@ -303,7 +303,7 @@ ng_gif_glue_af(struct mbuf **mp, int af) * hopefully everything after that will not * need one. So let's just use M_PREPEND. */ - M_PREPEND(m, sizeof (tmp_af), M_DONTWAIT); + M_PREPEND(m, sizeof (tmp_af), M_NOWAIT); if (m == NULL) { error = ENOBUFS; goto done; diff --git a/sys/netgraph/ng_gif_demux.c b/sys/netgraph/ng_gif_demux.c index 646e37dd5d49..ce0fba01893e 100644 --- a/sys/netgraph/ng_gif_demux.c +++ b/sys/netgraph/ng_gif_demux.c @@ -341,7 +341,7 @@ ng_gif_demux_rcvdata(hook_p hook, item_p item) * Add address family header and set the output hook. */ iffam = get_iffam_from_hook(priv, hook); - M_PREPEND(m, sizeof (iffam->family), M_DONTWAIT); + M_PREPEND(m, sizeof (iffam->family), M_NOWAIT); if (m == NULL) { NG_FREE_M(m); NG_FREE_ITEM(item); diff --git a/sys/netgraph/ng_hub.c b/sys/netgraph/ng_hub.c index 2a8c2d2a6923..9348b27c9fac 100644 --- a/sys/netgraph/ng_hub.c +++ b/sys/netgraph/ng_hub.c @@ -133,7 +133,7 @@ ng_hub_rcvdata(hook_p hook, item_p item) if (--nhooks == 1) NG_FWD_ITEM_HOOK(error, item, hook2); else { - if ((m2 = m_dup(m, M_DONTWAIT)) == NULL) { + if ((m2 = m_dup(m, M_NOWAIT)) == NULL) { NG_FREE_ITEM(item); return (ENOBUFS); } diff --git a/sys/netgraph/ng_iface.c b/sys/netgraph/ng_iface.c index 3ce0261287cc..5e6f12fb4b5d 100644 --- a/sys/netgraph/ng_iface.c +++ b/sys/netgraph/ng_iface.c @@ -394,7 +394,7 @@ ng_iface_output(struct ifnet *ifp, struct mbuf *m, ng_iface_bpftap(ifp, m, dst->sa_family); if (ALTQ_IS_ENABLED(&ifp->if_snd)) { - M_PREPEND(m, sizeof(sa_family_t), M_DONTWAIT); + M_PREPEND(m, sizeof(sa_family_t), M_NOWAIT); if (m == NULL) { IFQ_LOCK(&ifp->if_snd); IFQ_INC_DROPS(&ifp->if_snd); diff --git a/sys/netgraph/ng_ipfw.c b/sys/netgraph/ng_ipfw.c index 82a7238a8380..8c777980d3c2 100644 --- a/sys/netgraph/ng_ipfw.c +++ b/sys/netgraph/ng_ipfw.c @@ -320,7 +320,7 @@ ng_ipfw_input(struct mbuf **m0, int dir, struct ip_fw_args *fwa, int tee) m_tag_prepend(m, tag); } else - if ((m = m_dup(*m0, M_DONTWAIT)) == NULL) + if ((m = m_dup(*m0, M_NOWAIT)) == NULL) return (ENOMEM); /* which is ignored */ if (m->m_len < sizeof(struct ip) && diff --git a/sys/netgraph/ng_l2tp.c b/sys/netgraph/ng_l2tp.c index 3b91b84d04f4..bd98e6ce3b58 100644 --- a/sys/netgraph/ng_l2tp.c +++ b/sys/netgraph/ng_l2tp.c @@ -934,7 +934,7 @@ ng_l2tp_rcvdata_lower(hook_p h, item_p item) mtx_unlock(&seq->mtx); /* Prepend session ID to packet. */ - M_PREPEND(m, 2, M_DONTWAIT); + M_PREPEND(m, 2, M_NOWAIT); if (m == NULL) { seq->inproc = 0; priv->stats.memoryFailures++; @@ -1071,7 +1071,7 @@ ng_l2tp_rcvdata_ctrl(hook_p hook, item_p item) mtx_unlock(&seq->mtx); /* Copy packet */ - if ((m = L2TP_COPY_MBUF(m, M_DONTWAIT)) == NULL) { + if ((m = L2TP_COPY_MBUF(m, M_NOWAIT)) == NULL) { priv->stats.memoryFailures++; ERROUT(ENOBUFS); } @@ -1122,7 +1122,7 @@ ng_l2tp_rcvdata(hook_p hook, item_p item) M_PREPEND(m, 6 + (2 * (hpriv->conf.include_length != 0)) + (4 * (hpriv->conf.enable_dseq != 0)), - M_DONTWAIT); + M_NOWAIT); if (m == NULL) { priv->stats.memoryFailures++; NG_FREE_ITEM(item); @@ -1406,7 +1406,7 @@ ng_l2tp_seq_recv_nr(priv_p priv, u_int16_t nr) */ for (i = 0; i < j; i++) { struct mbuf *m; - if ((m = L2TP_COPY_MBUF(xwin[i], M_DONTWAIT)) == NULL) + if ((m = L2TP_COPY_MBUF(xwin[i], M_NOWAIT)) == NULL) priv->stats.memoryFailures++; else ng_l2tp_xmit_ctrl(priv, m, ns); @@ -1482,7 +1482,7 @@ ng_l2tp_seq_rack_timeout(node_p node, hook_p hook, void *arg1, int arg2) seq->acks = 0; /* Retransmit oldest unack'd packet */ - if ((m = L2TP_COPY_MBUF(seq->xwin[0], M_DONTWAIT)) == NULL) + if ((m = L2TP_COPY_MBUF(seq->xwin[0], M_NOWAIT)) == NULL) priv->stats.memoryFailures++; else ng_l2tp_xmit_ctrl(priv, m, seq->ns++); @@ -1521,7 +1521,7 @@ ng_l2tp_xmit_ctrl(priv_p priv, struct mbuf *m, u_int16_t ns) if (m == NULL) { /* Create a new mbuf for ZLB packet */ - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) { priv->stats.memoryFailures++; return (ENOBUFS); @@ -1539,7 +1539,7 @@ ng_l2tp_xmit_ctrl(priv_p priv, struct mbuf *m, u_int16_t ns) session_id = (mtod(m, u_int8_t *)[0] << 8) + mtod(m, u_int8_t *)[1]; /* Make room for L2TP header */ - M_PREPEND(m, 10, M_DONTWAIT); /* - 2 + 12 = 10 */ + M_PREPEND(m, 10, M_NOWAIT); /* - 2 + 12 = 10 */ if (m == NULL) { priv->stats.memoryFailures++; return (ENOBUFS); diff --git a/sys/netgraph/ng_lmi.c b/sys/netgraph/ng_lmi.c index 2624e06d95c0..6d3fb208b19f 100644 --- a/sys/netgraph/ng_lmi.c +++ b/sys/netgraph/ng_lmi.c @@ -317,7 +317,7 @@ nglmi_inquire(sc_p sc, int full) if (sc->lmi_channel == NULL) return; - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) { log(LOG_ERR, "nglmi: unable to start up LMI processing\n"); return; diff --git a/sys/netgraph/ng_mppc.c b/sys/netgraph/ng_mppc.c index 6754be79c08e..ddf97d19da6f 100644 --- a/sys/netgraph/ng_mppc.c +++ b/sys/netgraph/ng_mppc.c @@ -467,7 +467,7 @@ ng_mppc_compress(node_p node, struct mbuf **datap) struct mbuf *m = *datap; /* We must own the mbuf chain exclusively to modify it. */ - m = m_unshare(m, M_DONTWAIT); + m = m_unshare(m, M_NOWAIT); if (m == NULL) return (ENOMEM); @@ -595,7 +595,7 @@ ng_mppc_compress(node_p node, struct mbuf **datap) MPPC_CCOUNT_INC(d->cc); /* Install header */ - M_PREPEND(m, MPPC_HDRLEN, M_DONTWAIT); + M_PREPEND(m, MPPC_HDRLEN, M_NOWAIT); if (m != NULL) be16enc(mtod(m, void *), header); @@ -617,7 +617,7 @@ ng_mppc_decompress(node_p node, struct mbuf **datap) struct mbuf *m = *datap; /* We must own the mbuf chain exclusively to modify it. */ - m = m_unshare(m, M_DONTWAIT); + m = m_unshare(m, M_NOWAIT); if (m == NULL) return (ENOMEM); diff --git a/sys/netgraph/ng_one2many.c b/sys/netgraph/ng_one2many.c index 5984279120a9..8171005efa80 100644 --- a/sys/netgraph/ng_one2many.c +++ b/sys/netgraph/ng_one2many.c @@ -459,7 +459,7 @@ ng_one2many_rcvdata(hook_p hook, item_p item) struct ng_one2many_link *mdst; mdst = &priv->many[priv->activeMany[i]]; - m2 = m_dup(m, M_DONTWAIT); /* XXX m_copypacket() */ + m2 = m_dup(m, M_NOWAIT); /* XXX m_copypacket() */ if (m2 == NULL) { mdst->stats.memoryFailures++; NG_FREE_ITEM(item); diff --git a/sys/netgraph/ng_ppp.c b/sys/netgraph/ng_ppp.c index b26163af9d73..9db1a2fb1eb5 100644 --- a/sys/netgraph/ng_ppp.c +++ b/sys/netgraph/ng_ppp.c @@ -2095,7 +2095,7 @@ ng_ppp_mp_xmit(node_p node, item_p item, uint16_t proto) /* Split off next fragment as "m2" */ m2 = m; if (!lastFragment) { - struct mbuf *n = m_split(m, len, M_DONTWAIT); + struct mbuf *n = m_split(m, len, M_NOWAIT); if (n == NULL) { NG_FREE_M(m); @@ -2103,7 +2103,7 @@ ng_ppp_mp_xmit(node_p node, item_p item, uint16_t proto) NG_FREE_ITEM(item); return (ENOMEM); } - m_tag_copy_chain(n, m, M_DONTWAIT); + m_tag_copy_chain(n, m, M_NOWAIT); m = n; } @@ -2445,7 +2445,7 @@ ng_ppp_cutproto(struct mbuf *m, uint16_t *proto) static struct mbuf * ng_ppp_prepend(struct mbuf *m, const void *buf, int len) { - M_PREPEND(m, len, M_DONTWAIT); + M_PREPEND(m, len, M_NOWAIT); if (m == NULL || (m->m_len < len && (m = m_pullup(m, len)) == NULL)) return (NULL); bcopy(buf, mtod(m, uint8_t *), len); diff --git a/sys/netgraph/ng_pppoe.c b/sys/netgraph/ng_pppoe.c index 3b953b3201fe..818bd7ac7f27 100644 --- a/sys/netgraph/ng_pppoe.c +++ b/sys/netgraph/ng_pppoe.c @@ -460,7 +460,7 @@ pppoe_broadcast_padi(node_p node, struct mbuf *m0) LIST_FOREACH(sp, &privp->listeners, sessions) { struct mbuf *m; - m = m_dup(m0, M_DONTWAIT); + m = m_dup(m0, M_NOWAIT); if (m == NULL) return (ENOMEM); NG_SEND_DATA_ONLY(error, sp->hook, m); @@ -801,7 +801,7 @@ ng_pppoe_rcvmsg(node_p node, item_p item, hook_p lasthook) if (neg == NULL) LEAVE(ENOMEM); - neg->m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + neg->m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (neg->m == NULL) { free(neg, M_NETGRAPH_PPPOE); LEAVE(ENOBUFS); @@ -1078,7 +1078,7 @@ pppoe_start(sessp sp) ng_callout(&neg->handle, node, hook, PPPOE_INITIAL_TIMEOUT * hz, pppoe_ticker, NULL, 0); neg->timeout = PPPOE_INITIAL_TIMEOUT * 2; - m0 = m_copypacket(neg->m, M_DONTWAIT); + m0 = m_copypacket(neg->m, M_NOWAIT); NG_SEND_DATA_ONLY(error, privp->ethernet_hook, m0); } @@ -1161,7 +1161,7 @@ ng_pppoe_rcvdata(hook_p hook, item_p item) * Bang in a pre-made header, and set the length up * to be correct. Then send it to the ethernet driver. */ - M_PREPEND(m, sizeof(*wh), M_DONTWAIT); + M_PREPEND(m, sizeof(*wh), M_NOWAIT); if (m == NULL) LEAVE(ENOBUFS); @@ -1251,7 +1251,7 @@ ng_pppoe_rcvdata(hook_p hook, item_p item) */ ng_callout(&neg->handle, node, hook, PPPOE_OFFER_TIMEOUT * hz, pppoe_ticker, NULL, 0); - m0 = m_copypacket(sp->neg->m, M_DONTWAIT); + m0 = m_copypacket(sp->neg->m, M_NOWAIT); NG_FWD_NEW_DATA(error, item, privp->ethernet_hook, m0); privp->packets_out++; break; @@ -1338,7 +1338,7 @@ ng_pppoe_rcvdata_ether(hook_p hook, item_p item) * Put it into a cluster. */ struct mbuf *n; - n = m_dup(m, M_DONTWAIT); + n = m_dup(m, M_NOWAIT); m_freem(m); m = n; if (m) { @@ -1472,7 +1472,7 @@ ng_pppoe_rcvdata_ether(hook_p hook, item_p item) PPPOE_INITIAL_TIMEOUT * hz, pppoe_ticker, NULL, 0); neg->timeout = PPPOE_INITIAL_TIMEOUT * 2; - m0 = m_copypacket(neg->m, M_DONTWAIT); + m0 = m_copypacket(neg->m, M_NOWAIT); NG_FWD_NEW_DATA(error, item, privp->ethernet_hook, m0); break; case PADR_CODE: @@ -1530,7 +1530,7 @@ ng_pppoe_rcvdata_ether(hook_p hook, item_p item) sp->state = PPPOE_NEWCONNECTED; /* Send the PADS without a timeout - we're now connected. */ - m0 = m_copypacket(sp->neg->m, M_DONTWAIT); + m0 = m_copypacket(sp->neg->m, M_NOWAIT); NG_FWD_NEW_DATA(error, item, privp->ethernet_hook, m0); /* @@ -1736,7 +1736,7 @@ ng_pppoe_disconnect(hook_p hook) struct mbuf *m; /* Generate a packet of that type. */ - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) log(LOG_NOTICE, "ng_pppoe[%x]: session out of " "mbufs\n", node->nd_ID); @@ -1823,7 +1823,7 @@ pppoe_ticker(node_p node, hook_p hook, void *arg1, int arg2) case PPPOE_SINIT: case PPPOE_SREQ: /* Timeouts on these produce resends. */ - m0 = m_copypacket(sp->neg->m, M_DONTWAIT); + m0 = m_copypacket(sp->neg->m, M_NOWAIT); NG_SEND_DATA_ONLY( error, privp->ethernet_hook, m0); ng_callout(&neg->handle, node, hook, neg->timeout * hz, pppoe_ticker, NULL, 0); diff --git a/sys/netgraph/ng_pptpgre.c b/sys/netgraph/ng_pptpgre.c index f48b80c384fa..83d3e0a4c10c 100644 --- a/sys/netgraph/ng_pptpgre.c +++ b/sys/netgraph/ng_pptpgre.c @@ -598,7 +598,7 @@ ng_pptpgre_xmit(hpriv_p hpriv, item_p item) /* Prepend GRE header to outgoing frame */ grelen = sizeof(*gre) + sizeof(u_int32_t) * (gre->hasSeq + gre->hasAck); if (m == NULL) { - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) { priv->stats.memoryFailures++; ERROUT(ENOBUFS); @@ -606,7 +606,7 @@ ng_pptpgre_xmit(hpriv_p hpriv, item_p item) m->m_len = m->m_pkthdr.len = grelen; m->m_pkthdr.rcvif = NULL; } else { - M_PREPEND(m, grelen, M_DONTWAIT); + M_PREPEND(m, grelen, M_NOWAIT); if (m == NULL || (m->m_len < grelen && (m = m_pullup(m, grelen)) == NULL)) { priv->stats.memoryFailures++; diff --git a/sys/netgraph/ng_pred1.c b/sys/netgraph/ng_pred1.c index 52efe633e1b7..4792b7a459f9 100644 --- a/sys/netgraph/ng_pred1.c +++ b/sys/netgraph/ng_pred1.c @@ -401,7 +401,7 @@ ng_pred1_compress(node_p node, struct mbuf *m, struct mbuf **resultp) } /* We must own the mbuf chain exclusively to modify it. */ - m = m_unshare(m, M_DONTWAIT); + m = m_unshare(m, M_NOWAIT); if (m == NULL) { priv->stats.Errors++; return (ENOMEM); @@ -479,7 +479,7 @@ ng_pred1_decompress(node_p node, struct mbuf *m, struct mbuf **resultp) } /* We must own the mbuf chain exclusively to modify it. */ - m = m_unshare(m, M_DONTWAIT); + m = m_unshare(m, M_NOWAIT); if (m == NULL) { priv->stats.Errors++; return (ENOMEM); diff --git a/sys/netgraph/ng_rfc1490.c b/sys/netgraph/ng_rfc1490.c index 2dc512390068..061faa29fdef 100644 --- a/sys/netgraph/ng_rfc1490.c +++ b/sys/netgraph/ng_rfc1490.c @@ -385,7 +385,7 @@ switch_on_etype: etype = ntohs(*((const u_int16_t *)ptr)); break; } } else if (hook == priv->ppp) { - M_PREPEND(m, 2, M_DONTWAIT); /* Prepend PPP NLPID */ + M_PREPEND(m, 2, M_NOWAIT); /* Prepend PPP NLPID */ if (!m) ERROUT(ENOBUFS); mtod(m, u_char *)[0] = HDLC_UI; @@ -394,7 +394,7 @@ switch_on_etype: etype = ntohs(*((const u_int16_t *)ptr)); } else if (hook == priv->inet) { switch (priv->enc->method) { case NG_RFC1490_ENCAP_IETF_IP: - M_PREPEND(m, 2, M_DONTWAIT); /* Prepend IP NLPID */ + M_PREPEND(m, 2, M_NOWAIT); /* Prepend IP NLPID */ if (!m) ERROUT(ENOBUFS); mtod(m, u_char *)[0] = HDLC_UI; @@ -406,7 +406,7 @@ switch_on_etype: etype = ntohs(*((const u_int16_t *)ptr)); * HDLC_UI PAD NLIPID OUI PID * 03 00 80 00 00 00 08 00 */ - M_PREPEND(m, 8, M_DONTWAIT); + M_PREPEND(m, 8, M_NOWAIT); if (!m) ERROUT(ENOBUFS); mtod(m, u_char *)[0] = HDLC_UI; @@ -417,7 +417,7 @@ switch_on_etype: etype = ntohs(*((const u_int16_t *)ptr)); = htons(ETHERTYPE_IP); /* PID */ break; case NG_RFC1490_ENCAP_CISCO: - M_PREPEND(m, 2, M_DONTWAIT); /* Prepend IP ethertype */ + M_PREPEND(m, 2, M_NOWAIT); /* Prepend IP ethertype */ if (!m) ERROUT(ENOBUFS); *((u_int16_t *)mtod(m, u_int16_t *)) = htons(ETHERTYPE_IP); @@ -425,7 +425,7 @@ switch_on_etype: etype = ntohs(*((const u_int16_t *)ptr)); } NG_FWD_NEW_DATA(error, item, priv->downlink, m); } else if (hook == priv->ethernet) { - M_PREPEND(m, 8, M_DONTWAIT); /* Prepend NLPID, OUI, PID */ + M_PREPEND(m, 8, M_NOWAIT); /* Prepend NLPID, OUI, PID */ if (!m) ERROUT(ENOBUFS); mtod(m, u_char *)[0] = HDLC_UI; diff --git a/sys/netgraph/ng_source.c b/sys/netgraph/ng_source.c index 83473f9927cc..1883ec021ac3 100644 --- a/sys/netgraph/ng_source.c +++ b/sys/netgraph/ng_source.c @@ -445,7 +445,7 @@ ng_source_rcvmsg(node_p node, item_p item, hook_p lasthook) { struct ng_source_embed_info *embed; - NG_MKRESPONSE(resp, msg, sizeof(*embed), M_DONTWAIT); + NG_MKRESPONSE(resp, msg, sizeof(*embed), M_NOWAIT); if (resp == NULL) { error = ENOMEM; goto done; @@ -484,7 +484,7 @@ ng_source_rcvmsg(node_p node, item_p item, hook_p lasthook) error = EINVAL; goto done; } - NG_MKRESPONSE(resp, msg, sizeof(*embed), M_DONTWAIT); + NG_MKRESPONSE(resp, msg, sizeof(*embed), M_NOWAIT); if (resp == NULL) { error = ENOMEM; goto done; @@ -873,9 +873,9 @@ ng_source_dup_mod(sc_p sc, struct mbuf *m0, struct mbuf **m_ptr) /* Duplicate the packet. */ if (modify) - m = m_dup(m0, M_DONTWAIT); + m = m_dup(m0, M_NOWAIT); else - m = m_copypacket(m0, M_DONTWAIT); + m = m_copypacket(m0, M_NOWAIT); if (m == NULL) { error = ENOBUFS; goto done; diff --git a/sys/netgraph/ng_tee.c b/sys/netgraph/ng_tee.c index 4d8566612e83..c6a517e0498e 100644 --- a/sys/netgraph/ng_tee.c +++ b/sys/netgraph/ng_tee.c @@ -305,7 +305,7 @@ ng_tee_rcvdata(hook_p hook, item_p item) struct mbuf *m2; /* Copy packet (failure will not stop the original)*/ - m2 = m_dup(m, M_DONTWAIT); + m2 = m_dup(m, M_NOWAIT); if (m2) { /* Deliver duplicate */ h = hinfo->dup; diff --git a/sys/netgraph/ng_tty.c b/sys/netgraph/ng_tty.c index 34105b2e950c..35e17344825f 100644 --- a/sys/netgraph/ng_tty.c +++ b/sys/netgraph/ng_tty.c @@ -418,7 +418,7 @@ ngt_rint_bypass(struct tty *tp, const void *buf, size_t len) if (sc->hook == NULL) return (0); - m = m_getm2(NULL, len, M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getm2(NULL, len, M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) { if (sc->flags & FLG_DEBUG) log(LOG_ERR, @@ -476,7 +476,7 @@ ngt_rint(struct tty *tp, char c, int flags) /* Get a new header mbuf if we need one */ if (!(m = sc->m)) { - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (!m) { if (sc->flags & FLG_DEBUG) log(LOG_ERR, diff --git a/sys/netgraph/ng_vjc.c b/sys/netgraph/ng_vjc.c index 97801f24f855..e1b76b5b9e62 100644 --- a/sys/netgraph/ng_vjc.c +++ b/sys/netgraph/ng_vjc.c @@ -474,7 +474,7 @@ ng_vjc_rcvdata(hook_p hook, item_p item) m_adj(m, vjlen); /* Copy the reconstructed TCP/IP headers into a new mbuf */ - MGETHDR(hm, M_DONTWAIT, MT_DATA); + MGETHDR(hm, M_NOWAIT, MT_DATA); if (hm == NULL) { priv->slc.sls_errorin++; NG_FREE_M(m); @@ -484,7 +484,7 @@ ng_vjc_rcvdata(hook_p hook, item_p item) hm->m_len = 0; hm->m_pkthdr.rcvif = NULL; if (hlen > MHLEN) { /* unlikely, but can happen */ - MCLGET(hm, M_DONTWAIT); + MCLGET(hm, M_NOWAIT); if ((hm->m_flags & M_EXT) == 0) { m_freem(hm); priv->slc.sls_errorin++; diff --git a/sys/netgraph/ng_vlan.c b/sys/netgraph/ng_vlan.c index b07a603a1b08..1c10a0e1eb07 100644 --- a/sys/netgraph/ng_vlan.c +++ b/sys/netgraph/ng_vlan.c @@ -648,7 +648,7 @@ ng_vlan_rcvdata(hook_p hook, item_p item) * [dmac] [smac] [TPID] [PCP/CFI/VID] [ether_type] [payload] * |-----------| |-- inserted tag --| |--------------------| */ - M_PREPEND(m, ETHER_VLAN_ENCAP_LEN, M_DONTWAIT); + M_PREPEND(m, ETHER_VLAN_ENCAP_LEN, M_NOWAIT); if (m == NULL) error = ENOMEM; else diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index 52d7db228dcf..2d92815ca41c 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -249,7 +249,7 @@ arprequest(struct ifnet *ifp, struct in_addr *sip, struct in_addr *tip, if (enaddr == NULL) enaddr = carpaddr ? carpaddr : (u_char *)IF_LLADDR(ifp); - if ((m = m_gethdr(M_DONTWAIT, MT_DATA)) == NULL) + if ((m = m_gethdr(M_NOWAIT, MT_DATA)) == NULL) return; m->m_len = sizeof(*ah) + 2*sizeof(struct in_addr) + 2*ifp->if_data.ifi_addrlen; diff --git a/sys/netinet/igmp.c b/sys/netinet/igmp.c index 63b96a85761c..e87da5e93d44 100644 --- a/sys/netinet/igmp.c +++ b/sys/netinet/igmp.c @@ -523,7 +523,7 @@ igmp_ra_alloc(void) struct mbuf *m; struct ipoption *p; - MGET(m, M_DONTWAIT, MT_DATA); + MGET(m, M_NOWAIT, MT_DATA); p = mtod(m, struct ipoption *); p->ipopt_dst.s_addr = INADDR_ANY; p->ipopt_list[0] = IPOPT_RA; /* Router Alert Option */ @@ -2203,7 +2203,7 @@ igmp_v1v2_queue_report(struct in_multi *inm, const int type) ifp = inm->inm_ifp; - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) return (ENOMEM); MH_ALIGN(m, sizeof(struct ip) + sizeof(struct igmp)); @@ -2780,12 +2780,12 @@ igmp_v3_enqueue_group_record(struct ifqueue *ifq, struct in_multi *inm, m0srcs = (ifp->if_mtu - IGMP_LEADINGSPACE - sizeof(struct igmp_grouprec)) / sizeof(in_addr_t); if (!is_state_change && !is_group_query) { - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m) m->m_data += IGMP_LEADINGSPACE; } if (m == NULL) { - m = m_gethdr(M_DONTWAIT, MT_DATA); + m = m_gethdr(M_NOWAIT, MT_DATA); if (m) MH_ALIGN(m, IGMP_LEADINGSPACE); } @@ -2905,11 +2905,11 @@ igmp_v3_enqueue_group_record(struct ifqueue *ifq, struct in_multi *inm, CTR1(KTR_IGMPV3, "%s: outbound queue full", __func__); return (-ENOMEM); } - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m) m->m_data += IGMP_LEADINGSPACE; if (m == NULL) { - m = m_gethdr(M_DONTWAIT, MT_DATA); + m = m_gethdr(M_NOWAIT, MT_DATA); if (m) MH_ALIGN(m, IGMP_LEADINGSPACE); } @@ -3061,11 +3061,11 @@ igmp_v3_enqueue_filter_change(struct ifqueue *ifq, struct in_multi *inm) CTR1(KTR_IGMPV3, "%s: use previous packet", __func__); } else { - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m) m->m_data += IGMP_LEADINGSPACE; if (m == NULL) { - m = m_gethdr(M_DONTWAIT, MT_DATA); + m = m_gethdr(M_NOWAIT, MT_DATA); if (m) MH_ALIGN(m, IGMP_LEADINGSPACE); } @@ -3497,7 +3497,7 @@ igmp_v3_encap_report(struct ifnet *ifp, struct mbuf *m) if (m->m_flags & M_IGMPV3_HDR) { igmpreclen -= hdrlen; } else { - M_PREPEND(m, hdrlen, M_DONTWAIT); + M_PREPEND(m, hdrlen, M_NOWAIT); if (m == NULL) return (NULL); m->m_flags |= M_IGMPV3_HDR; diff --git a/sys/netinet/in_gif.c b/sys/netinet/in_gif.c index 6ccd17f41b6e..45c86190107d 100644 --- a/sys/netinet/in_gif.c +++ b/sys/netinet/in_gif.c @@ -162,7 +162,7 @@ in_gif_output(struct ifnet *ifp, int family, struct mbuf *m) eiphdr.eip_resvh = 0; } /* prepend Ethernet-in-IP header */ - M_PREPEND(m, sizeof(struct etherip_header), M_DONTWAIT); + M_PREPEND(m, sizeof(struct etherip_header), M_NOWAIT); if (m && m->m_len < sizeof(struct etherip_header)) m = m_pullup(m, sizeof(struct etherip_header)); if (m == NULL) @@ -202,7 +202,7 @@ in_gif_output(struct ifnet *ifp, int family, struct mbuf *m) if (family == AF_LINK) len += ETHERIP_ALIGN; #endif - M_PREPEND(m, len, M_DONTWAIT); + M_PREPEND(m, len, M_NOWAIT); if (m != NULL && m->m_len < len) m = m_pullup(m, len); if (m == NULL) { diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c index d6fd5bafc9b3..39d6f7ea0049 100644 --- a/sys/netinet/ip_icmp.c +++ b/sys/netinet/ip_icmp.c @@ -280,9 +280,9 @@ stdreply: icmpelen = max(8, min(V_icmp_quotelen, ntohs(oip->ip_len) - oiphlen)); goto freeit; if (MHLEN > sizeof(struct ip) + ICMP_MINLEN + icmplen) - m = m_gethdr(M_DONTWAIT, MT_DATA); + m = m_gethdr(M_NOWAIT, MT_DATA); else - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) goto freeit; #ifdef MAC @@ -809,7 +809,7 @@ icmp_reflect(struct mbuf *m) */ cp = (u_char *) (ip + 1); if ((opts = ip_srcroute(m)) == 0 && - (opts = m_gethdr(M_DONTWAIT, MT_DATA))) { + (opts = m_gethdr(M_NOWAIT, MT_DATA))) { opts->m_len = sizeof(struct in_addr); mtod(opts, struct in_addr *)->s_addr = 0; } diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index 033c03da9709..0e559a652b89 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -1406,8 +1406,8 @@ ip_forward(struct mbuf *m, int srcrt) * assume exclusive access to the IP header in `m', so any * data in a cluster may change before we reach icmp_error(). */ - MGETHDR(mcopy, M_DONTWAIT, m->m_type); - if (mcopy != NULL && !m_dup_pkthdr(mcopy, m, M_DONTWAIT)) { + MGETHDR(mcopy, M_NOWAIT, m->m_type); + if (mcopy != NULL && !m_dup_pkthdr(mcopy, m, M_NOWAIT)) { /* * It's probably ok if the pkthdr dup fails (because * the deep copy of the tag chain failed), but for now diff --git a/sys/netinet/ip_mroute.c b/sys/netinet/ip_mroute.c index 5b3350473ca3..622893320a80 100644 --- a/sys/netinet/ip_mroute.c +++ b/sys/netinet/ip_mroute.c @@ -1306,7 +1306,7 @@ X_ip_mforward(struct ip *ip, struct ifnet *ifp, struct mbuf *m, return ENOBUFS; } - mb0 = m_copypacket(m, M_DONTWAIT); + mb0 = m_copypacket(m, M_NOWAIT); if (mb0 && (M_HASCL(mb0) || mb0->m_len < hlen)) mb0 = m_pullup(mb0, hlen); if (mb0 == NULL) { @@ -1669,7 +1669,7 @@ phyint_send(struct ip *ip, struct vif *vifp, struct mbuf *m) * the IP header is actually copied, not just referenced, * so that ip_output() only scribbles on the copy. */ - mb_copy = m_copypacket(m, M_DONTWAIT); + mb_copy = m_copypacket(m, M_NOWAIT); if (mb_copy && (M_HASCL(mb_copy) || mb_copy->m_len < hlen)) mb_copy = m_pullup(mb_copy, hlen); if (mb_copy == NULL) @@ -2083,7 +2083,7 @@ bw_upcalls_send(void) * Allocate a new mbuf, initialize it with the header and * the payload for the pending calls. */ - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) { log(LOG_WARNING, "bw_upcalls_send: cannot allocate mbuf\n"); return; @@ -2384,7 +2384,7 @@ pim_register_prepare(struct ip *ip, struct mbuf *m) * Copy the old packet & pullup its IP header into the * new mbuf so we can modify it. */ - mb_copy = m_copypacket(m, M_DONTWAIT); + mb_copy = m_copypacket(m, M_NOWAIT); if (mb_copy == NULL) return NULL; mb_copy = m_pullup(mb_copy, ip->ip_hl << 2); @@ -2430,7 +2430,7 @@ pim_register_send_upcall(struct ip *ip, struct vif *vifp, /* * Add a new mbuf with an upcall header */ - MGETHDR(mb_first, M_DONTWAIT, MT_DATA); + MGETHDR(mb_first, M_NOWAIT, MT_DATA); if (mb_first == NULL) { m_freem(mb_copy); return ENOBUFS; @@ -2488,7 +2488,7 @@ pim_register_send_rp(struct ip *ip, struct vif *vifp, struct mbuf *mb_copy, /* * Add a new mbuf with the encapsulating header */ - MGETHDR(mb_first, M_DONTWAIT, MT_DATA); + MGETHDR(mb_first, M_NOWAIT, MT_DATA); if (mb_first == NULL) { m_freem(mb_copy); return ENOBUFS; diff --git a/sys/netinet/ip_options.c b/sys/netinet/ip_options.c index df320271cc77..239c69974f7e 100644 --- a/sys/netinet/ip_options.c +++ b/sys/netinet/ip_options.c @@ -411,7 +411,7 @@ ip_srcroute(struct mbuf *m0) if (opts->ip_nhops == 0) return (NULL); - m = m_get(M_DONTWAIT, MT_DATA); + m = m_get(M_NOWAIT, MT_DATA); if (m == NULL) return (NULL); @@ -495,7 +495,7 @@ ip_insertoptions(struct mbuf *m, struct mbuf *opt, int *phlen) if (p->ipopt_dst.s_addr) ip->ip_dst = p->ipopt_dst; if (m->m_flags & M_EXT || m->m_data - optlen < m->m_pktdat) { - MGETHDR(n, M_DONTWAIT, MT_DATA); + MGETHDR(n, M_NOWAIT, MT_DATA); if (n == NULL) { *phlen = 0; return (m); diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index ad709a51c959..166bef5173f5 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -621,7 +621,7 @@ ip_output(struct mbuf *m, struct mbuf *opt, struct route *ro, int flags, } #ifdef MBUF_STRESS_TEST if (mbuf_frag_size && m->m_pkthdr.len > mbuf_frag_size) - m = m_fragment(m, M_DONTWAIT, mbuf_frag_size); + m = m_fragment(m, M_NOWAIT, mbuf_frag_size); #endif /* * Reset layer specific mbuf flags @@ -784,7 +784,7 @@ ip_fragment(struct ip *ip, struct mbuf **m_frag, int mtu, struct mbuf *m; int mhlen = sizeof (struct ip); - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) { error = ENOBUFS; IPSTAT_INC(ips_odropped); @@ -813,7 +813,7 @@ ip_fragment(struct ip *ip, struct mbuf **m_frag, int mtu, } else mhip->ip_off |= IP_MF; mhip->ip_len = htons((u_short)(len + mhlen)); - m->m_next = m_copym(m0, off, len, M_DONTWAIT); + m->m_next = m_copym(m0, off, len, M_NOWAIT); if (m->m_next == NULL) { /* copy failed */ m_free(m); error = ENOBUFS; /* ??? */ @@ -951,7 +951,7 @@ ip_ctloutput(struct socket *so, struct sockopt *sopt) error = EMSGSIZE; break; } - MGET(m, sopt->sopt_td ? M_WAIT : M_DONTWAIT, MT_DATA); + MGET(m, sopt->sopt_td ? M_WAITOK : M_NOWAIT, MT_DATA); if (m == NULL) { error = ENOBUFS; break; @@ -1289,7 +1289,7 @@ ip_mloopback(struct ifnet *ifp, struct mbuf *m, struct sockaddr_in *dst, * Make a deep copy of the packet because we're going to * modify the pack in order to generate checksums. */ - copym = m_dup(m, M_DONTWAIT); + copym = m_dup(m, M_NOWAIT); if (copym != NULL && (copym->m_flags & M_EXT || copym->m_len < hlen)) copym = m_pullup(copym, hlen); if (copym != NULL) { diff --git a/sys/netinet/libalias/alias.c b/sys/netinet/libalias/alias.c index 876e95844ded..da28b2297ecf 100644 --- a/sys/netinet/libalias/alias.c +++ b/sys/netinet/libalias/alias.c @@ -1761,7 +1761,7 @@ m_megapullup(struct mbuf *m, int len) { return (m); if (len <= MCLBYTES - RESERVE) { - mcl = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + mcl = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); } else if (len < MJUM16BYTES) { int size; if (len <= MJUMPAGESIZE - RESERVE) { @@ -1771,7 +1771,7 @@ m_megapullup(struct mbuf *m, int len) { } else { size = MJUM16BYTES; }; - mcl = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, size); + mcl = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, size); } else { goto bad; } diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c index 7d070fdae3a6..eddc69e21f65 100644 --- a/sys/netinet/raw_ip.c +++ b/sys/netinet/raw_ip.c @@ -439,7 +439,7 @@ rip_output(struct mbuf *m, struct socket *so, u_long dst) m_freem(m); return(EMSGSIZE); } - M_PREPEND(m, sizeof(struct ip), M_DONTWAIT); + M_PREPEND(m, sizeof(struct ip), M_NOWAIT); if (m == NULL) return(ENOBUFS); diff --git a/sys/netinet/sctp_asconf.c b/sys/netinet/sctp_asconf.c index b9ed52feff77..0b15cd49ab8b 100644 --- a/sys/netinet/sctp_asconf.c +++ b/sys/netinet/sctp_asconf.c @@ -80,7 +80,7 @@ sctp_asconf_success_response(uint32_t id) struct sctp_asconf_paramhdr *aph; m_reply = sctp_get_mbuf_for_msg(sizeof(struct sctp_asconf_paramhdr), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (m_reply == NULL) { SCTPDBG(SCTP_DEBUG_ASCONF1, "asconf_success_response: couldn't get mbuf!\n"); @@ -108,7 +108,7 @@ sctp_asconf_error_response(uint32_t id, uint16_t cause, uint8_t * error_tlv, m_reply = sctp_get_mbuf_for_msg((sizeof(struct sctp_asconf_paramhdr) + tlv_length + sizeof(struct sctp_error_cause)), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (m_reply == NULL) { SCTPDBG(SCTP_DEBUG_ASCONF1, "asconf_error_response: couldn't get mbuf!\n"); @@ -633,7 +633,7 @@ sctp_handle_asconf(struct mbuf *m, unsigned int offset, } } m_ack = sctp_get_mbuf_for_msg(sizeof(struct sctp_asconf_ack_chunk), 0, - M_DONTWAIT, 1, MT_DATA); + M_NOWAIT, 1, MT_DATA); if (m_ack == NULL) { SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf: couldn't get mbuf!\n"); @@ -2569,14 +2569,14 @@ sctp_compose_asconf(struct sctp_tcb *stcb, int *retlen, int addr_locked) * it's simpler to fill in the asconf chunk header lookup address on * the fly */ - m_asconf_chk = sctp_get_mbuf_for_msg(sizeof(struct sctp_asconf_chunk), 0, M_DONTWAIT, 1, MT_DATA); + m_asconf_chk = sctp_get_mbuf_for_msg(sizeof(struct sctp_asconf_chunk), 0, M_NOWAIT, 1, MT_DATA); if (m_asconf_chk == NULL) { /* no mbuf's */ SCTPDBG(SCTP_DEBUG_ASCONF1, "compose_asconf: couldn't get chunk mbuf!\n"); return (NULL); } - m_asconf = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_DONTWAIT, 1, MT_DATA); + m_asconf = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_NOWAIT, 1, MT_DATA); if (m_asconf == NULL) { /* no mbuf's */ SCTPDBG(SCTP_DEBUG_ASCONF1, diff --git a/sys/netinet/sctp_auth.c b/sys/netinet/sctp_auth.c index a5d5f71f3858..42e263650f05 100644 --- a/sys/netinet/sctp_auth.c +++ b/sys/netinet/sctp_auth.c @@ -1763,7 +1763,7 @@ sctp_handle_auth(struct sctp_tcb *stcb, struct sctp_auth_chunk *auth, * report this in an Error Chunk: Unsupported HMAC * Identifier */ - m_err = sctp_get_mbuf_for_msg(sizeof(*err), 0, M_DONTWAIT, + m_err = sctp_get_mbuf_for_msg(sizeof(*err), 0, M_NOWAIT, 1, MT_HEADER); if (m_err != NULL) { /* pre-reserve some space */ @@ -1869,7 +1869,7 @@ sctp_notify_authentication(struct sctp_tcb *stcb, uint32_t indication, return; m_notify = sctp_get_mbuf_for_msg(sizeof(struct sctp_authkey_event), - 0, M_DONTWAIT, 1, MT_HEADER); + 0, M_NOWAIT, 1, MT_HEADER); if (m_notify == NULL) /* no space left */ return; diff --git a/sys/netinet/sctp_indata.c b/sys/netinet/sctp_indata.c index a394de5d68fb..112920b920f8 100644 --- a/sys/netinet/sctp_indata.c +++ b/sys/netinet/sctp_indata.c @@ -241,7 +241,7 @@ sctp_build_ctl_nchunk(struct sctp_inpcb *inp, struct sctp_sndrcvinfo *sinfo) use_extended = 0; } - ret = sctp_get_mbuf_for_msg(len, 0, M_DONTWAIT, 1, MT_DATA); + ret = sctp_get_mbuf_for_msg(len, 0, M_NOWAIT, 1, MT_DATA); if (ret == NULL) { /* No space */ return (ret); @@ -587,7 +587,7 @@ sctp_queue_data_to_stream(struct sctp_tcb *stcb, struct sctp_association *asoc, */ TAILQ_INSERT_HEAD(&strm->inqueue, control, next); oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (oper) { struct sctp_paramhdr *ph; uint32_t *ippp; @@ -866,7 +866,7 @@ sctp_queue_data_for_reasm(struct sctp_tcb *stcb, struct sctp_association *asoc, */ SCTPDBG(SCTP_DEBUG_INDATA1, "Gak, Evil plot, its not first, no fragmented delivery in progress\n"); oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (oper) { struct sctp_paramhdr *ph; @@ -899,7 +899,7 @@ sctp_queue_data_for_reasm(struct sctp_tcb *stcb, struct sctp_association *asoc, */ SCTPDBG(SCTP_DEBUG_INDATA1, "Gak, Evil plot, it IS a first and fragmented delivery in progress\n"); oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (oper) { struct sctp_paramhdr *ph; uint32_t *ippp; @@ -933,7 +933,7 @@ sctp_queue_data_for_reasm(struct sctp_tcb *stcb, struct sctp_association *asoc, chk->rec.data.stream_number, asoc->str_of_pdapi); oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (oper) { struct sctp_paramhdr *ph; uint32_t *ippp; @@ -965,7 +965,7 @@ sctp_queue_data_for_reasm(struct sctp_tcb *stcb, struct sctp_association *asoc, chk->rec.data.stream_seq, asoc->ssn_of_pdapi); oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (oper) { struct sctp_paramhdr *ph; uint32_t *ippp; @@ -1059,7 +1059,7 @@ sctp_queue_data_for_reasm(struct sctp_tcb *stcb, struct sctp_association *asoc, SCTPDBG(SCTP_DEBUG_INDATA1, "Prev check - It can be a midlle or last but not a first\n"); SCTPDBG(SCTP_DEBUG_INDATA1, "Gak, Evil plot, it's a FIRST!\n"); oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (oper) { struct sctp_paramhdr *ph; uint32_t *ippp; @@ -1096,7 +1096,7 @@ sctp_queue_data_for_reasm(struct sctp_tcb *stcb, struct sctp_association *asoc, chk->rec.data.stream_number, prev->rec.data.stream_number); oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (oper) { struct sctp_paramhdr *ph; uint32_t *ippp; @@ -1133,7 +1133,7 @@ sctp_queue_data_for_reasm(struct sctp_tcb *stcb, struct sctp_association *asoc, chk->rec.data.stream_seq, prev->rec.data.stream_seq); oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (oper) { struct sctp_paramhdr *ph; uint32_t *ippp; @@ -1166,7 +1166,7 @@ sctp_queue_data_for_reasm(struct sctp_tcb *stcb, struct sctp_association *asoc, SCTP_DATA_FIRST_FRAG) { SCTPDBG(SCTP_DEBUG_INDATA1, "Prev check - Gak, evil plot, its not FIRST and it must be!\n"); oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (oper) { struct sctp_paramhdr *ph; uint32_t *ippp; @@ -1210,7 +1210,7 @@ sctp_queue_data_for_reasm(struct sctp_tcb *stcb, struct sctp_association *asoc, SCTPDBG(SCTP_DEBUG_INDATA1, "Next chk - Next is FIRST, we must be LAST\n"); SCTPDBG(SCTP_DEBUG_INDATA1, "Gak, Evil plot, its not a last!\n"); oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (oper) { struct sctp_paramhdr *ph; uint32_t *ippp; @@ -1249,7 +1249,7 @@ sctp_queue_data_for_reasm(struct sctp_tcb *stcb, struct sctp_association *asoc, SCTPDBG(SCTP_DEBUG_INDATA1, "Next chk - Next is a MIDDLE/LAST\n"); SCTPDBG(SCTP_DEBUG_INDATA1, "Gak, Evil plot, new prev chunk is a LAST\n"); oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (oper) { struct sctp_paramhdr *ph; uint32_t *ippp; @@ -1286,7 +1286,7 @@ sctp_queue_data_for_reasm(struct sctp_tcb *stcb, struct sctp_association *asoc, chk->rec.data.stream_number, next->rec.data.stream_number); oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (oper) { struct sctp_paramhdr *ph; uint32_t *ippp; @@ -1324,7 +1324,7 @@ sctp_queue_data_for_reasm(struct sctp_tcb *stcb, struct sctp_association *asoc, chk->rec.data.stream_seq, next->rec.data.stream_seq); oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (oper) { struct sctp_paramhdr *ph; uint32_t *ippp; @@ -1571,7 +1571,7 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struct sctp_association *asoc, struct mbuf *mb; mb = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) * 2), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (mb != NULL) { /* add some space up front so prepend will work well */ SCTP_BUF_RESV_UF(mb, sizeof(struct sctp_chunkhdr)); @@ -1636,7 +1636,7 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struct sctp_association *asoc, SCTPDBG(SCTP_DEBUG_INDATA1, "EVIL/Broken-Dup S-SEQ:%d delivered:%d from peer, Abort!\n", strmseq, asoc->strmin[strmno].last_sequence_delivered); oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (oper) { struct sctp_paramhdr *ph; uint32_t *ippp; @@ -1668,7 +1668,7 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struct sctp_association *asoc, if (last_chunk == 0) { dmbuf = SCTP_M_COPYM(*m, (offset + sizeof(struct sctp_data_chunk)), - the_len, M_DONTWAIT); + the_len, M_NOWAIT); #ifdef SCTP_MBUF_LOGGING if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MBUF_LOGGING_ENABLE) { struct mbuf *mat; @@ -1898,7 +1898,7 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struct sctp_association *asoc, } sctp_free_a_readq(stcb, control); oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (oper) { struct sctp_paramhdr *ph; uint32_t *ippp; @@ -1932,7 +1932,7 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struct sctp_association *asoc, sctp_free_a_readq(stcb, control); oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (oper) { struct sctp_paramhdr *ph; uint32_t *ippp; @@ -1977,7 +1977,7 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struct sctp_association *asoc, } sctp_free_a_readq(stcb, control); oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (oper) { struct sctp_paramhdr *ph; uint32_t *ippp; @@ -2560,7 +2560,7 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *offset, int length, */ if (SCTP_BUF_LEN(m) < (long)MLEN && SCTP_BUF_NEXT(m) == NULL) { /* we only handle mbufs that are singletons.. not chains */ - m = sctp_get_mbuf_for_msg(SCTP_BUF_LEN(m), 0, M_DONTWAIT, 1, MT_DATA); + m = sctp_get_mbuf_for_msg(SCTP_BUF_LEN(m), 0, M_NOWAIT, 1, MT_DATA); if (m) { /* ok lets see if we can copy the data up */ caddr_t *from, *to; @@ -2608,7 +2608,7 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *offset, int length, struct mbuf *op_err; op_err = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 2 * sizeof(uint32_t)), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (op_err) { struct sctp_paramhdr *ph; @@ -2710,7 +2710,7 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *offset, int length, struct mbuf *merr; struct sctp_paramhdr *phd; - merr = sctp_get_mbuf_for_msg(sizeof(*phd), 0, M_DONTWAIT, 1, MT_DATA); + merr = sctp_get_mbuf_for_msg(sizeof(*phd), 0, M_NOWAIT, 1, MT_DATA); if (merr) { phd = mtod(merr, struct sctp_paramhdr *); /* @@ -2726,7 +2726,7 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *offset, int length, phd->param_length = htons(chk_length + sizeof(*phd)); SCTP_BUF_LEN(merr) = sizeof(*phd); - SCTP_BUF_NEXT(merr) = SCTP_M_COPYM(m, *offset, chk_length, M_DONTWAIT); + SCTP_BUF_NEXT(merr) = SCTP_M_COPYM(m, *offset, chk_length, M_NOWAIT); if (SCTP_BUF_NEXT(merr)) { if (sctp_pad_lastmbuf(SCTP_BUF_NEXT(merr), SCTP_SIZE32(chk_length) - chk_length, NULL)) { sctp_m_freem(merr); @@ -3852,7 +3852,7 @@ sctp_express_handle_sack(struct sctp_tcb *stcb, uint32_t cumack, *abort_now = 1; /* XXX */ oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + sizeof(uint32_t)), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (oper) { struct sctp_paramhdr *ph; uint32_t *ippp; @@ -4222,7 +4222,7 @@ sctp_express_handle_sack(struct sctp_tcb *stcb, uint32_t cumack, *abort_now = 1; /* XXX */ oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + sizeof(uint32_t)), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (oper) { struct sctp_paramhdr *ph; uint32_t *ippp; @@ -4445,7 +4445,7 @@ sctp_handle_sack(struct mbuf *m, int offset_seg, int offset_dup, *abort_now = 1; /* XXX */ oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + sizeof(uint32_t)), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (oper) { struct sctp_paramhdr *ph; uint32_t *ippp; @@ -4954,7 +4954,7 @@ sctp_handle_sack(struct mbuf *m, int offset_seg, int offset_dup, *abort_now = 1; /* XXX */ oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + sizeof(uint32_t)), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (oper) { struct sctp_paramhdr *ph; uint32_t *ippp; @@ -5405,7 +5405,7 @@ sctp_handle_forward_tsn(struct sctp_tcb *stcb, */ *abort_flag = 1; oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (oper) { struct sctp_paramhdr *ph; uint32_t *ippp; diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c index eb4be5651c2b..c70bc033dd97 100644 --- a/sys/netinet/sctp_input.c +++ b/sys/netinet/sctp_input.c @@ -1481,7 +1481,7 @@ sctp_process_cookie_existing(struct mbuf *m, int iphlen, int offset, /* SHUTDOWN came in after sending INIT-ACK */ sctp_send_shutdown_ack(stcb, stcb->asoc.primary_destination); op_err = sctp_get_mbuf_for_msg(sizeof(struct sctp_paramhdr), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (op_err == NULL) { /* FOOBAR */ return (NULL); @@ -1699,7 +1699,7 @@ sctp_process_cookie_existing(struct mbuf *m, int iphlen, int offset, * with colliding state indication. */ op_err = sctp_get_mbuf_for_msg(sizeof(struct sctp_paramhdr), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (op_err == NULL) { /* FOOBAR */ return (NULL); @@ -2461,7 +2461,7 @@ sctp_handle_cookie_echo(struct mbuf *m, int iphlen, int offset, * calculated in the sctp_hmac_m() call). */ sig_offset = offset + cookie_len - SCTP_SIGNATURE_SIZE; - m_sig = m_split(m, sig_offset, M_DONTWAIT); + m_sig = m_split(m, sig_offset, M_NOWAIT); if (m_sig == NULL) { /* out of memory or ?? */ return (NULL); @@ -2567,7 +2567,7 @@ sctp_handle_cookie_echo(struct mbuf *m, int iphlen, int offset, uint32_t tim; op_err = sctp_get_mbuf_for_msg(sizeof(struct sctp_stale_cookie_msg), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (op_err == NULL) { /* FOOBAR */ return (NULL); @@ -4094,7 +4094,7 @@ __attribute__((noinline)) chk->no_fr_allowed = 0; chk->book_size = chk->send_size = sizeof(struct sctp_chunkhdr); chk->book_size_scale = 0; - chk->data = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_DONTWAIT, 1, MT_DATA); + chk->data = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_NOWAIT, 1, MT_DATA); if (chk->data == NULL) { strres_nochunk: if (chk->data) { @@ -5477,7 +5477,7 @@ __attribute__((noinline)) struct sctp_paramhdr *phd; mm = sctp_get_mbuf_for_msg(sizeof(struct sctp_paramhdr), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (mm) { phd = mtod(mm, struct sctp_paramhdr *); /* @@ -5490,7 +5490,7 @@ __attribute__((noinline)) phd->param_type = htons(SCTP_CAUSE_UNRECOG_CHUNK); phd->param_length = htons(chk_length + sizeof(*phd)); SCTP_BUF_LEN(mm) = sizeof(*phd); - SCTP_BUF_NEXT(mm) = SCTP_M_COPYM(m, *offset, chk_length, M_DONTWAIT); + SCTP_BUF_NEXT(mm) = SCTP_M_COPYM(m, *offset, chk_length, M_NOWAIT); if (SCTP_BUF_NEXT(mm)) { if (sctp_pad_lastmbuf(SCTP_BUF_NEXT(mm), SCTP_SIZE32(chk_length) - chk_length, NULL)) { sctp_m_freem(mm); diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c index aecf035d8f3a..68d3d8b042d6 100644 --- a/sys/netinet/sctp_output.c +++ b/sys/netinet/sctp_output.c @@ -1970,7 +1970,7 @@ sctp_add_addr_to_mbuf(struct mbuf *m, struct sctp_ifa *ifa) while (SCTP_BUF_NEXT(mret) != NULL) { mret = SCTP_BUF_NEXT(mret); } - SCTP_BUF_NEXT(mret) = sctp_get_mbuf_for_msg(len, 0, M_DONTWAIT, 1, MT_DATA); + SCTP_BUF_NEXT(mret) = sctp_get_mbuf_for_msg(len, 0, M_NOWAIT, 1, MT_DATA); if (SCTP_BUF_NEXT(mret) == NULL) { /* We are hosed, can't add more addresses */ return (m); @@ -3700,11 +3700,11 @@ sctp_add_cookie(struct mbuf *init, int init_offset, mret = NULL; mret = sctp_get_mbuf_for_msg((sizeof(struct sctp_state_cookie) + sizeof(struct sctp_paramhdr)), 0, - M_DONTWAIT, 1, MT_DATA); + M_NOWAIT, 1, MT_DATA); if (mret == NULL) { return (NULL); } - copy_init = SCTP_M_COPYM(init, init_offset, M_COPYALL, M_DONTWAIT); + copy_init = SCTP_M_COPYM(init, init_offset, M_COPYALL, M_NOWAIT); if (copy_init == NULL) { sctp_m_freem(mret); return (NULL); @@ -3721,7 +3721,7 @@ sctp_add_cookie(struct mbuf *init, int init_offset, } #endif copy_initack = SCTP_M_COPYM(initack, initack_offset, M_COPYALL, - M_DONTWAIT); + M_NOWAIT); if (copy_initack == NULL) { sctp_m_freem(mret); sctp_m_freem(copy_init); @@ -3771,7 +3771,7 @@ sctp_add_cookie(struct mbuf *init, int init_offset, break; } } - sig = sctp_get_mbuf_for_msg(SCTP_SECRET_SIZE, 0, M_DONTWAIT, 1, MT_DATA); + sig = sctp_get_mbuf_for_msg(SCTP_SECRET_SIZE, 0, M_NOWAIT, 1, MT_DATA); if (sig == NULL) { /* no space, so free the entire chain */ sctp_m_freem(mret); @@ -3940,7 +3940,7 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp, if (port) { len += sizeof(struct udphdr); } - newm = sctp_get_mbuf_for_msg(len, 1, M_DONTWAIT, 1, MT_DATA); + newm = sctp_get_mbuf_for_msg(len, 1, M_NOWAIT, 1, MT_DATA); if (newm == NULL) { sctp_m_freem(m); SCTP_LTRACE_ERR_RET(inp, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, ENOMEM); @@ -4229,7 +4229,7 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp, if (port) { len += sizeof(struct udphdr); } - newm = sctp_get_mbuf_for_msg(len, 1, M_DONTWAIT, 1, MT_DATA); + newm = sctp_get_mbuf_for_msg(len, 1, M_NOWAIT, 1, MT_DATA); if (newm == NULL) { sctp_m_freem(m); SCTP_LTRACE_ERR_RET(inp, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, ENOMEM); @@ -4626,7 +4626,7 @@ sctp_send_initiate(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int so_locked /* start the INIT timer */ sctp_timer_start(SCTP_TIMER_TYPE_INIT, inp, stcb, net); - m = sctp_get_mbuf_for_msg(MCLBYTES, 1, M_DONTWAIT, 1, MT_DATA); + m = sctp_get_mbuf_for_msg(MCLBYTES, 1, M_NOWAIT, 1, MT_DATA); if (m == NULL) { /* No memory, INIT timer will re-attempt. */ SCTPDBG(SCTP_DEBUG_OUTPUT4, "Sending INIT - mbuf?\n"); @@ -5015,7 +5015,7 @@ sctp_arethere_unrecognized_parameters(struct mbuf *in_initpkt, #endif l_len += plen; l_len += sizeof(struct sctp_paramhdr); - op_err = sctp_get_mbuf_for_msg(l_len, 0, M_DONTWAIT, 1, MT_DATA); + op_err = sctp_get_mbuf_for_msg(l_len, 0, M_NOWAIT, 1, MT_DATA); if (op_err) { SCTP_BUF_LEN(op_err) = 0; /* @@ -5084,7 +5084,7 @@ sctp_arethere_unrecognized_parameters(struct mbuf *in_initpkt, #endif l_len += plen; l_len += sizeof(struct sctp_paramhdr); - op_err = sctp_get_mbuf_for_msg(l_len, 0, M_DONTWAIT, 1, MT_DATA); + op_err = sctp_get_mbuf_for_msg(l_len, 0, M_NOWAIT, 1, MT_DATA); if (op_err) { SCTP_BUF_LEN(op_err) = 0; #ifdef INET6 @@ -5158,7 +5158,7 @@ sctp_arethere_unrecognized_parameters(struct mbuf *in_initpkt, l_len = sizeof(struct ip) + sizeof(struct sctphdr) + sizeof(struct sctp_chunkhdr); #endif l_len += (2 * sizeof(struct sctp_paramhdr)); - op_err = sctp_get_mbuf_for_msg(l_len, 0, M_DONTWAIT, 1, MT_DATA); + op_err = sctp_get_mbuf_for_msg(l_len, 0, M_NOWAIT, 1, MT_DATA); if (op_err) { SCTP_BUF_LEN(op_err) = 0; #ifdef INET6 @@ -5428,7 +5428,7 @@ sctp_send_initiate_ack(struct sctp_inpcb *inp, struct sctp_tcb *stcb, vrf_id, port); return; } - m = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_DONTWAIT, 1, MT_DATA); + m = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_NOWAIT, 1, MT_DATA); if (m == NULL) { /* No memory, INIT timer will re-attempt. */ if (op_err) @@ -6280,7 +6280,7 @@ sctp_copy_mbufchain(struct mbuf *clonechain, if (outchain == NULL) { /* This is the general case */ new_mbuf: - outchain = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_DONTWAIT, 1, MT_HEADER); + outchain = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_NOWAIT, 1, MT_HEADER); if (outchain == NULL) { goto error_out; } @@ -6334,7 +6334,7 @@ sctp_copy_mbufchain(struct mbuf *clonechain, /* now we need another one */ sizeofcpy -= len; } - m = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_DONTWAIT, 1, MT_HEADER); + m = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_NOWAIT, 1, MT_HEADER); if (m == NULL) { /* We failed */ goto error_out; @@ -6348,7 +6348,7 @@ sctp_copy_mbufchain(struct mbuf *clonechain, return (outchain); } else { /* copy the old fashion way */ - appendchain = SCTP_M_COPYM(clonechain, 0, M_COPYALL, M_DONTWAIT); + appendchain = SCTP_M_COPYM(clonechain, 0, M_COPYALL, M_NOWAIT); #ifdef SCTP_MBUF_LOGGING if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MBUF_LOGGING_ENABLE) { struct mbuf *mat; @@ -6442,7 +6442,7 @@ sctp_sendall_iterator(struct sctp_inpcb *inp, struct sctp_tcb *stcb, void *ptr, return; } if ((ca->m) && ca->sndlen) { - m = SCTP_M_COPYM(ca->m, 0, M_COPYALL, M_DONTWAIT); + m = SCTP_M_COPYM(ca->m, 0, M_COPYALL, M_NOWAIT); if (m == NULL) { /* can't copy so we are done */ ca->cnt_failed++; @@ -6473,7 +6473,7 @@ sctp_sendall_iterator(struct sctp_inpcb *inp, struct sctp_tcb *stcb, void *ptr, if (m) { struct sctp_paramhdr *ph; - SCTP_BUF_PREPEND(m, sizeof(struct sctp_paramhdr), M_DONTWAIT); + SCTP_BUF_PREPEND(m, sizeof(struct sctp_paramhdr), M_NOWAIT); if (m) { ph = mtod(m, struct sctp_paramhdr *); ph->param_type = htons(SCTP_CAUSE_USER_INITIATED_ABT); @@ -6650,7 +6650,7 @@ sctp_copy_out_all(struct uio *uio, int len) struct mbuf *ret, *at; int left, willcpy, cancpy, error; - ret = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_WAIT, 1, MT_DATA); + ret = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_WAITOK, 1, MT_DATA); if (ret == NULL) { /* TSNH */ return (NULL); @@ -6673,7 +6673,7 @@ sctp_copy_out_all(struct uio *uio, int len) SCTP_BUF_NEXT_PKT(at) = SCTP_BUF_NEXT(at) = 0; left -= willcpy; if (left > 0) { - SCTP_BUF_NEXT(at) = sctp_get_mbuf_for_msg(left, 0, M_WAIT, 1, MT_DATA); + SCTP_BUF_NEXT(at) = sctp_get_mbuf_for_msg(left, 0, M_WAITOK, 1, MT_DATA); if (SCTP_BUF_NEXT(at) == NULL) { goto err_out_now; } @@ -7237,7 +7237,7 @@ sctp_move_to_outqueue(struct sctp_tcb *stcb, struct mbuf *m; dont_do_it: - chk->data = SCTP_M_COPYM(sp->data, 0, to_move, M_DONTWAIT); + chk->data = SCTP_M_COPYM(sp->data, 0, to_move, M_NOWAIT); chk->last_mbuf = NULL; if (chk->data == NULL) { sp->some_taken = some_taken; @@ -7316,7 +7316,7 @@ sctp_move_to_outqueue(struct sctp_tcb *stcb, /* Not enough room for a chunk header, get some */ struct mbuf *m; - m = sctp_get_mbuf_for_msg(1, 0, M_DONTWAIT, 0, MT_DATA); + m = sctp_get_mbuf_for_msg(1, 0, M_NOWAIT, 0, MT_DATA); if (m == NULL) { /* * we're in trouble here. _PREPEND below will free @@ -7353,7 +7353,7 @@ sctp_move_to_outqueue(struct sctp_tcb *stcb, M_ALIGN(chk->data, 4); } } - SCTP_BUF_PREPEND(chk->data, sizeof(struct sctp_data_chunk), M_DONTWAIT); + SCTP_BUF_PREPEND(chk->data, sizeof(struct sctp_data_chunk), M_NOWAIT); if (chk->data == NULL) { /* HELP, TSNH since we assured it would not above? */ #ifdef INVARIANTS @@ -8789,7 +8789,7 @@ sctp_queue_op_err(struct sctp_tcb *stcb, struct mbuf *op_err) return; } chk->copy_by_ref = 0; - SCTP_BUF_PREPEND(op_err, sizeof(struct sctp_chunkhdr), M_DONTWAIT); + SCTP_BUF_PREPEND(op_err, sizeof(struct sctp_chunkhdr), M_NOWAIT); if (op_err == NULL) { sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); return; @@ -8854,7 +8854,7 @@ sctp_send_cookie_echo(struct mbuf *m, if ((pad = (plen % 4))) { plen += 4 - pad; } - cookie = SCTP_M_COPYM(m, at, plen, M_DONTWAIT); + cookie = SCTP_M_COPYM(m, at, plen, M_NOWAIT); if (cookie == NULL) { /* No memory */ return (-2); @@ -8926,7 +8926,7 @@ sctp_send_heartbeat_ack(struct sctp_tcb *stcb, /* must have a net pointer */ return; - outchain = SCTP_M_COPYM(m, offset, chk_length, M_DONTWAIT); + outchain = SCTP_M_COPYM(m, offset, chk_length, M_NOWAIT); if (outchain == NULL) { /* gak out of memory */ return; @@ -8985,7 +8985,7 @@ sctp_send_cookie_ack(struct sctp_tcb *stcb) cookie_ack = NULL; SCTP_TCB_LOCK_ASSERT(stcb); - cookie_ack = sctp_get_mbuf_for_msg(sizeof(struct sctp_chunkhdr), 0, M_DONTWAIT, 1, MT_HEADER); + cookie_ack = sctp_get_mbuf_for_msg(sizeof(struct sctp_chunkhdr), 0, M_NOWAIT, 1, MT_HEADER); if (cookie_ack == NULL) { /* no mbuf's */ return; @@ -9031,7 +9031,7 @@ sctp_send_shutdown_ack(struct sctp_tcb *stcb, struct sctp_nets *net) struct sctp_shutdown_ack_chunk *ack_cp; struct sctp_tmit_chunk *chk; - m_shutdown_ack = sctp_get_mbuf_for_msg(sizeof(struct sctp_shutdown_ack_chunk), 0, M_DONTWAIT, 1, MT_HEADER); + m_shutdown_ack = sctp_get_mbuf_for_msg(sizeof(struct sctp_shutdown_ack_chunk), 0, M_NOWAIT, 1, MT_HEADER); if (m_shutdown_ack == NULL) { /* no mbuf's */ return; @@ -9074,7 +9074,7 @@ sctp_send_shutdown(struct sctp_tcb *stcb, struct sctp_nets *net) struct sctp_shutdown_chunk *shutdown_cp; struct sctp_tmit_chunk *chk; - m_shutdown = sctp_get_mbuf_for_msg(sizeof(struct sctp_shutdown_chunk), 0, M_DONTWAIT, 1, MT_HEADER); + m_shutdown = sctp_get_mbuf_for_msg(sizeof(struct sctp_shutdown_chunk), 0, M_NOWAIT, 1, MT_HEADER); if (m_shutdown == NULL) { /* no mbuf's */ return; @@ -9210,7 +9210,7 @@ sctp_send_asconf_ack(struct sctp_tcb *stcb) continue; } /* copy the asconf_ack */ - m_ack = SCTP_M_COPYM(ack->data, 0, M_COPYALL, M_DONTWAIT); + m_ack = SCTP_M_COPYM(ack->data, 0, M_COPYALL, M_NOWAIT); if (m_ack == NULL) { /* couldn't copy it */ return; @@ -10130,7 +10130,7 @@ send_forward_tsn(struct sctp_tcb *stcb, chk->rec.chunk_id.can_take_data = 0; chk->asoc = asoc; chk->whoTo = NULL; - chk->data = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_DONTWAIT, 1, MT_DATA); + chk->data = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_NOWAIT, 1, MT_DATA); if (chk->data == NULL) { sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); return; @@ -10416,7 +10416,7 @@ sctp_send_sack(struct sctp_tcb *stcb, int so_locked space_req = MCLBYTES; } /* Ok now lets formulate a MBUF with our sack */ - a_chk->data = sctp_get_mbuf_for_msg(space_req, 0, M_DONTWAIT, 1, MT_DATA); + a_chk->data = sctp_get_mbuf_for_msg(space_req, 0, M_NOWAIT, 1, MT_DATA); if ((a_chk->data == NULL) || (a_chk->whoTo == NULL)) { /* rats, no mbuf memory */ @@ -10713,7 +10713,7 @@ sctp_send_abort_tcb(struct sctp_tcb *stcb, struct mbuf *operr, int so_locked SCTP_STAT_INCR_COUNTER64(sctps_outcontrolchunks); } SCTP_TCB_LOCK_ASSERT(stcb); - m_abort = sctp_get_mbuf_for_msg(sizeof(struct sctp_abort_chunk), 0, M_DONTWAIT, 1, MT_HEADER); + m_abort = sctp_get_mbuf_for_msg(sizeof(struct sctp_abort_chunk), 0, M_NOWAIT, 1, MT_HEADER); if (m_abort == NULL) { /* no mbuf's */ if (m_out) @@ -10773,7 +10773,7 @@ sctp_send_shutdown_complete(struct sctp_tcb *stcb, uint32_t vtag; uint8_t flags; - m_shutdown_comp = sctp_get_mbuf_for_msg(sizeof(struct sctp_chunkhdr), 0, M_DONTWAIT, 1, MT_HEADER); + m_shutdown_comp = sctp_get_mbuf_for_msg(sizeof(struct sctp_chunkhdr), 0, M_NOWAIT, 1, MT_HEADER); if (m_shutdown_comp == NULL) { /* no mbuf's */ return; @@ -10869,7 +10869,7 @@ sctp_send_resp_msg(struct sockaddr *src, struct sockaddr *dst, if (port) { len += sizeof(struct udphdr); } - mout = sctp_get_mbuf_for_msg(len + max_linkhdr, 1, M_DONTWAIT, 1, MT_DATA); + mout = sctp_get_mbuf_for_msg(len + max_linkhdr, 1, M_NOWAIT, 1, MT_DATA); if (mout == NULL) { if (cause) { sctp_m_freem(cause); @@ -11113,7 +11113,7 @@ sctp_send_hb(struct sctp_tcb *stcb, struct sctp_nets *net, int so_locked chk->asoc = &stcb->asoc; chk->send_size = sizeof(struct sctp_heartbeat_chunk); - chk->data = sctp_get_mbuf_for_msg(chk->send_size, 0, M_DONTWAIT, 1, MT_HEADER); + chk->data = sctp_get_mbuf_for_msg(chk->send_size, 0, M_NOWAIT, 1, MT_HEADER); if (chk->data == NULL) { sctp_free_a_chunk(stcb, chk, so_locked); return; @@ -11217,7 +11217,7 @@ sctp_send_ecn_echo(struct sctp_tcb *stcb, struct sctp_nets *net, chk->rec.chunk_id.can_take_data = 0; chk->asoc = &stcb->asoc; chk->send_size = sizeof(struct sctp_ecne_chunk); - chk->data = sctp_get_mbuf_for_msg(chk->send_size, 0, M_DONTWAIT, 1, MT_HEADER); + chk->data = sctp_get_mbuf_for_msg(chk->send_size, 0, M_NOWAIT, 1, MT_HEADER); if (chk->data == NULL) { sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); return; @@ -11316,7 +11316,7 @@ sctp_send_packet_dropped(struct sctp_tcb *stcb, struct sctp_nets *net, was_trunc = 1; } chk->asoc = &stcb->asoc; - chk->data = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_DONTWAIT, 1, MT_DATA); + chk->data = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_NOWAIT, 1, MT_DATA); if (chk->data == NULL) { jump_out: sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); @@ -11429,7 +11429,7 @@ sctp_send_cwr(struct sctp_tcb *stcb, struct sctp_nets *net, uint32_t high_tsn, u chk->rec.chunk_id.can_take_data = 1; chk->asoc = &stcb->asoc; chk->send_size = sizeof(struct sctp_cwr_chunk); - chk->data = sctp_get_mbuf_for_msg(chk->send_size, 0, M_DONTWAIT, 1, MT_HEADER); + chk->data = sctp_get_mbuf_for_msg(chk->send_size, 0, M_NOWAIT, 1, MT_HEADER); if (chk->data == NULL) { sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); return; @@ -11735,7 +11735,7 @@ sctp_send_str_reset_req(struct sctp_tcb *stcb, chk->send_size = SCTP_SIZE32(chk->book_size); chk->book_size_scale = 0; - chk->data = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_DONTWAIT, 1, MT_DATA); + chk->data = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_NOWAIT, 1, MT_DATA); if (chk->data == NULL) { sctp_free_a_chunk(stcb, chk, SCTP_SO_LOCKED); SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, ENOMEM); @@ -12487,7 +12487,7 @@ sctp_lower_sosend(struct socket *so, if (top) { struct mbuf *cntm = NULL; - mm = sctp_get_mbuf_for_msg(sizeof(struct sctp_paramhdr), 0, M_WAIT, 1, MT_DATA); + mm = sctp_get_mbuf_for_msg(sizeof(struct sctp_paramhdr), 0, M_WAITOK, 1, MT_DATA); if (sndlen != 0) { for (cntm = top; cntm; cntm = SCTP_BUF_NEXT(cntm)) { tot_out += SCTP_BUF_LEN(cntm); @@ -12503,7 +12503,7 @@ sctp_lower_sosend(struct socket *so, error = EMSGSIZE; goto out; } - mm = sctp_get_mbuf_for_msg(tot_demand, 0, M_WAIT, 1, MT_DATA); + mm = sctp_get_mbuf_for_msg(tot_demand, 0, M_WAITOK, 1, MT_DATA); } if (mm == NULL) { SCTP_LTRACE_ERR_RET(NULL, stcb, net, SCTP_FROM_SCTP_OUTPUT, ENOMEM); @@ -13279,7 +13279,7 @@ sctp_add_auth_chunk(struct mbuf *m, struct mbuf **m_end, if (!sctp_auth_is_required_chunk(chunk, stcb->asoc.peer_auth_chunks)) { return (m); } - m_auth = sctp_get_mbuf_for_msg(sizeof(*auth), 0, M_DONTWAIT, 1, MT_HEADER); + m_auth = sctp_get_mbuf_for_msg(sizeof(*auth), 0, M_NOWAIT, 1, MT_HEADER); if (m_auth == NULL) { /* no mbuf's */ return (m); diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index b2703cdd68eb..04ac4b597aea 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -3294,7 +3294,7 @@ sctp_inpcb_free(struct sctp_inpcb *inp, int immediate, int from) struct mbuf *op_err; op_err = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + sizeof(uint32_t)), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (op_err) { /* Fill in the user initiated abort */ struct sctp_paramhdr *ph; @@ -3380,7 +3380,7 @@ sctp_inpcb_free(struct sctp_inpcb *inp, int immediate, int from) abort_anyway: op_err = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + sizeof(uint32_t)), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (op_err) { /* * Fill in the user @@ -3465,7 +3465,7 @@ sctp_inpcb_free(struct sctp_inpcb *inp, int immediate, int from) uint32_t *ippp; op_err = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + sizeof(uint32_t)), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (op_err) { /* Fill in the user initiated abort */ struct sctp_paramhdr *ph; diff --git a/sys/netinet/sctp_timer.c b/sys/netinet/sctp_timer.c index 3444923da62b..69505c39514b 100644 --- a/sys/netinet/sctp_timer.c +++ b/sys/netinet/sctp_timer.c @@ -150,7 +150,7 @@ sctp_threshold_management(struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct mbuf *oper; oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + sizeof(uint32_t)), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (oper) { struct sctp_paramhdr *ph; uint32_t *ippp; @@ -1054,7 +1054,7 @@ sctp_cookie_timer(struct sctp_inpcb *inp, struct mbuf *oper; oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + sizeof(uint32_t)), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (oper) { struct sctp_paramhdr *ph; uint32_t *ippp; diff --git a/sys/netinet/sctp_usrreq.c b/sys/netinet/sctp_usrreq.c index 9c4a8b2003c9..3d1e31ddac86 100644 --- a/sys/netinet/sctp_usrreq.c +++ b/sys/netinet/sctp_usrreq.c @@ -763,7 +763,7 @@ sctp_disconnect(struct socket *so) /* Left with Data unread */ struct mbuf *err; - err = sctp_get_mbuf_for_msg(sizeof(struct sctp_paramhdr), 0, M_DONTWAIT, 1, MT_DATA); + err = sctp_get_mbuf_for_msg(sizeof(struct sctp_paramhdr), 0, M_NOWAIT, 1, MT_DATA); if (err) { /* * Fill in the user @@ -862,7 +862,7 @@ sctp_disconnect(struct socket *so) abort_anyway: op_err = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + sizeof(uint32_t)), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (op_err) { /* * Fill in the user @@ -1077,7 +1077,7 @@ sctp_shutdown(struct socket *so) abort_anyway: op_err = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + sizeof(uint32_t)), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (op_err) { /* Fill in the user initiated abort */ struct sctp_paramhdr *ph; diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c index f31a55736f6e..2f1678250909 100644 --- a/sys/netinet/sctputil.c +++ b/sys/netinet/sctputil.c @@ -2548,7 +2548,7 @@ sctp_add_pad_tombuf(struct mbuf *m, int padlen) /* Hard way we must grow the mbuf */ struct mbuf *tmp; - tmp = sctp_get_mbuf_for_msg(padlen, 0, M_DONTWAIT, 1, MT_DATA); + tmp = sctp_get_mbuf_for_msg(padlen, 0, M_NOWAIT, 1, MT_DATA); if (tmp == NULL) { /* Out of space GAK! we are in big trouble. */ SCTP_LTRACE_ERR_RET_PKT(m, NULL, NULL, NULL, SCTP_FROM_SCTPUTIL, ENOBUFS); @@ -2618,11 +2618,11 @@ sctp_notify_assoc_change(uint16_t state, struct sctp_tcb *stcb, } else if ((state == SCTP_COMM_LOST) || (state == SCTP_CANT_STR_ASSOC)) { notif_len += abort_len; } - m_notify = sctp_get_mbuf_for_msg(notif_len, 0, M_DONTWAIT, 1, MT_DATA); + m_notify = sctp_get_mbuf_for_msg(notif_len, 0, M_NOWAIT, 1, MT_DATA); if (m_notify == NULL) { /* Retry with smaller value. */ notif_len = sizeof(struct sctp_assoc_change); - m_notify = sctp_get_mbuf_for_msg(notif_len, 0, M_DONTWAIT, 1, MT_DATA); + m_notify = sctp_get_mbuf_for_msg(notif_len, 0, M_NOWAIT, 1, MT_DATA); if (m_notify == NULL) { goto set_error; } @@ -2740,7 +2740,7 @@ sctp_notify_peer_addr_change(struct sctp_tcb *stcb, uint32_t state, /* event not enabled */ return; } - m_notify = sctp_get_mbuf_for_msg(sizeof(struct sctp_paddr_change), 0, M_DONTWAIT, 1, MT_DATA); + m_notify = sctp_get_mbuf_for_msg(sizeof(struct sctp_paddr_change), 0, M_NOWAIT, 1, MT_DATA); if (m_notify == NULL) return; SCTP_BUF_LEN(m_notify) = 0; @@ -2831,7 +2831,7 @@ sctp_notify_send_failed(struct sctp_tcb *stcb, uint8_t sent, uint32_t error, } else { length = sizeof(struct sctp_send_failed); } - m_notify = sctp_get_mbuf_for_msg(length, 0, M_DONTWAIT, 1, MT_DATA); + m_notify = sctp_get_mbuf_for_msg(length, 0, M_NOWAIT, 1, MT_DATA); if (m_notify == NULL) /* no space left */ return; @@ -2943,7 +2943,7 @@ sctp_notify_send_failed2(struct sctp_tcb *stcb, uint32_t error, } else { length = sizeof(struct sctp_send_failed); } - m_notify = sctp_get_mbuf_for_msg(length, 0, M_DONTWAIT, 1, MT_DATA); + m_notify = sctp_get_mbuf_for_msg(length, 0, M_NOWAIT, 1, MT_DATA); if (m_notify == NULL) { /* no space left */ return; @@ -3032,7 +3032,7 @@ sctp_notify_adaptation_layer(struct sctp_tcb *stcb) /* event not enabled */ return; } - m_notify = sctp_get_mbuf_for_msg(sizeof(struct sctp_adaption_event), 0, M_DONTWAIT, 1, MT_DATA); + m_notify = sctp_get_mbuf_for_msg(sizeof(struct sctp_adaption_event), 0, M_NOWAIT, 1, MT_DATA); if (m_notify == NULL) /* no space left */ return; @@ -3087,7 +3087,7 @@ sctp_notify_partial_delivery_indication(struct sctp_tcb *stcb, uint32_t error, if (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_SOCKET_CANT_READ) { return; } - m_notify = sctp_get_mbuf_for_msg(sizeof(struct sctp_pdapi_event), 0, M_DONTWAIT, 1, MT_DATA); + m_notify = sctp_get_mbuf_for_msg(sizeof(struct sctp_pdapi_event), 0, M_NOWAIT, 1, MT_DATA); if (m_notify == NULL) /* no space left */ return; @@ -3197,7 +3197,7 @@ sctp_notify_shutdown_event(struct sctp_tcb *stcb) /* event not enabled */ return; } - m_notify = sctp_get_mbuf_for_msg(sizeof(struct sctp_shutdown_event), 0, M_DONTWAIT, 1, MT_DATA); + m_notify = sctp_get_mbuf_for_msg(sizeof(struct sctp_shutdown_event), 0, M_NOWAIT, 1, MT_DATA); if (m_notify == NULL) /* no space left */ return; @@ -3245,7 +3245,7 @@ sctp_notify_sender_dry_event(struct sctp_tcb *stcb, /* event not enabled */ return; } - m_notify = sctp_get_mbuf_for_msg(sizeof(struct sctp_sender_dry_event), 0, M_DONTWAIT, 1, MT_DATA); + m_notify = sctp_get_mbuf_for_msg(sizeof(struct sctp_sender_dry_event), 0, M_NOWAIT, 1, MT_DATA); if (m_notify == NULL) { /* no space left */ return; @@ -3297,7 +3297,7 @@ sctp_notify_stream_reset_add(struct sctp_tcb *stcb, uint16_t numberin, uint16_t return; } stcb->asoc.peer_req_out = 0; - m_notify = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_DONTWAIT, 1, MT_DATA); + m_notify = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_NOWAIT, 1, MT_DATA); if (m_notify == NULL) /* no space left */ return; @@ -3353,7 +3353,7 @@ sctp_notify_stream_reset_tsn(struct sctp_tcb *stcb, uint32_t sending_tsn, uint32 /* event not enabled */ return; } - m_notify = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_DONTWAIT, 1, MT_DATA); + m_notify = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_NOWAIT, 1, MT_DATA); if (m_notify == NULL) /* no space left */ return; @@ -3412,7 +3412,7 @@ sctp_notify_stream_reset(struct sctp_tcb *stcb, /* event not enabled */ return; } - m_notify = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_DONTWAIT, 1, MT_DATA); + m_notify = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_NOWAIT, 1, MT_DATA); if (m_notify == NULL) /* no space left */ return; @@ -3479,11 +3479,11 @@ sctp_notify_remote_error(struct sctp_tcb *stcb, uint16_t error, struct sctp_erro chunk_len = 0; } notif_len = sizeof(struct sctp_remote_error) + chunk_len; - m_notify = sctp_get_mbuf_for_msg(notif_len, 0, M_DONTWAIT, 1, MT_DATA); + m_notify = sctp_get_mbuf_for_msg(notif_len, 0, M_NOWAIT, 1, MT_DATA); if (m_notify == NULL) { /* Retry with smaller value. */ notif_len = sizeof(struct sctp_remote_error); - m_notify = sctp_get_mbuf_for_msg(notif_len, 0, M_DONTWAIT, 1, MT_DATA); + m_notify = sctp_get_mbuf_for_msg(notif_len, 0, M_NOWAIT, 1, MT_DATA); if (m_notify == NULL) { return; } @@ -4636,7 +4636,7 @@ sctp_generate_invmanparam(int err) /* Return a MBUF with a invalid mandatory parameter */ struct mbuf *m; - m = sctp_get_mbuf_for_msg(sizeof(struct sctp_paramhdr), 0, M_DONTWAIT, 1, MT_DATA); + m = sctp_get_mbuf_for_msg(sizeof(struct sctp_paramhdr), 0, M_NOWAIT, 1, MT_DATA); if (m) { struct sctp_paramhdr *ph; @@ -6798,7 +6798,7 @@ sctp_recv_udp_tunneled_packet(struct mbuf *m, int off, struct inpcb *ignored) * Split out the mbuf chain. Leave the IP header in m, place the * rest in the sp. */ - sp = m_split(m, off, M_DONTWAIT); + sp = m_split(m, off, M_NOWAIT); if (sp == NULL) { /* Gak, drop packet, we can't do a split */ goto out; diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index b050fcfa7651..ac7ac3185292 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -842,7 +842,7 @@ tcp_output(struct tcpcb *tp) TCPSTAT_INC(tcps_sndpack); TCPSTAT_ADD(tcps_sndbyte, len); } - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) { SOCKBUF_UNLOCK(&so->so_snd); error = ENOBUFS; @@ -850,7 +850,7 @@ tcp_output(struct tcpcb *tp) } #ifdef INET6 if (MHLEN < hdrlen + max_linkhdr) { - MCLGET(m, M_DONTWAIT); + MCLGET(m, M_NOWAIT); if ((m->m_flags & M_EXT) == 0) { SOCKBUF_UNLOCK(&so->so_snd); m_freem(m); @@ -902,7 +902,7 @@ tcp_output(struct tcpcb *tp) else TCPSTAT_INC(tcps_sndwinup); - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) { error = ENOBUFS; goto out; diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index a24e16af3277..e74d0aadc288 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -573,7 +573,7 @@ tcp_respond(struct tcpcb *tp, void *ipgen, struct tcphdr *th, struct mbuf *m, } } if (m == NULL) { - m = m_gethdr(M_DONTWAIT, MT_DATA); + m = m_gethdr(M_NOWAIT, MT_DATA); if (m == NULL) return; tlen = 0; @@ -1859,7 +1859,7 @@ ipsec_hdrsiz_tcp(struct tcpcb *tp) if ((tp == NULL) || ((inp = tp->t_inpcb) == NULL)) return (0); - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (!m) return (0); diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index c83945ac9d32..99116521b3c8 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -1369,7 +1369,7 @@ syncache_respond(struct syncache *sc) ("syncache: mbuf too small")); /* Create the IP+TCP header from scratch. */ - m = m_gethdr(M_DONTWAIT, MT_DATA); + m = m_gethdr(M_NOWAIT, MT_DATA); if (m == NULL) return (ENOBUFS); #ifdef MAC diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c index c7076d7f7d4e..7e6128b46fdb 100644 --- a/sys/netinet/tcp_timewait.c +++ b/sys/netinet/tcp_timewait.c @@ -523,7 +523,7 @@ tcp_twrespond(struct tcptw *tw, int flags) INP_WLOCK_ASSERT(inp); - m = m_gethdr(M_DONTWAIT, MT_DATA); + m = m_gethdr(M_NOWAIT, MT_DATA); if (m == NULL) return (ENOBUFS); m->m_data += max_linkhdr; diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index 45e2693623fa..3b93b260ab30 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -1174,7 +1174,7 @@ udp_output(struct inpcb *inp, struct mbuf *m, struct sockaddr *addr, * link-layer headers. Immediate slide the data pointer back forward * since we won't use that space at this layer. */ - M_PREPEND(m, sizeof(struct udpiphdr) + max_linkhdr, M_DONTWAIT); + M_PREPEND(m, sizeof(struct udpiphdr) + max_linkhdr, M_NOWAIT); if (m == NULL) { error = ENOBUFS; goto release; diff --git a/sys/netinet6/frag6.c b/sys/netinet6/frag6.c index b2e8e047bd50..c4d4e3b03898 100644 --- a/sys/netinet6/frag6.c +++ b/sys/netinet6/frag6.c @@ -565,7 +565,7 @@ frag6_input(struct mbuf **mp, int *offp, int proto) m->m_len -= sizeof(struct ip6_frag); } else { /* this comes with no copy if the boundary is on cluster */ - if ((t = m_split(m, offset, M_DONTWAIT)) == NULL) { + if ((t = m_split(m, offset, M_NOWAIT)) == NULL) { frag6_remque(q6); V_frag6_nfrags -= q6->ip6q_nfrag; #ifdef MAC diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c index d9ea93e20a82..0cd6e5aaed95 100644 --- a/sys/netinet6/icmp6.c +++ b/sys/netinet6/icmp6.c @@ -360,7 +360,7 @@ icmp6_error(struct mbuf *m, int type, int code, int param) m_adj(m, ICMPV6_PLD_MAXLEN - m->m_pkthdr.len); preplen = sizeof(struct ip6_hdr) + sizeof(struct icmp6_hdr); - M_PREPEND(m, preplen, M_DONTWAIT); /* FIB is also copied over. */ + M_PREPEND(m, preplen, M_NOWAIT); /* FIB is also copied over. */ if (m && m->m_len < preplen) m = m_pullup(m, preplen); if (m == NULL) { @@ -581,12 +581,12 @@ icmp6_input(struct mbuf **mp, int *offp, int proto) const int maxlen = sizeof(*nip6) + sizeof(*nicmp6); int n0len; - MGETHDR(n, M_DONTWAIT, n0->m_type); + MGETHDR(n, M_NOWAIT, n0->m_type); n0len = n0->m_pkthdr.len; /* save for use below */ if (n) M_MOVE_PKTHDR(n, n0); /* FIB copied. */ if (n && maxlen >= MHLEN) { - MCLGET(n, M_DONTWAIT); + MCLGET(n, M_NOWAIT); if ((n->m_flags & M_EXT) == 0) { m_free(n); n = NULL; @@ -699,15 +699,15 @@ icmp6_input(struct mbuf **mp, int *offp, int proto) /* Give up remote */ break; } - MGETHDR(n, M_DONTWAIT, m->m_type); + MGETHDR(n, M_NOWAIT, m->m_type); if (n && maxlen > MHLEN) { - MCLGET(n, M_DONTWAIT); + MCLGET(n, M_NOWAIT); if ((n->m_flags & M_EXT) == 0) { m_free(n); n = NULL; } } - if (n && !m_dup_pkthdr(n, m, M_DONTWAIT)) { + if (n && !m_dup_pkthdr(n, m, M_NOWAIT)) { /* * Previous code did a blind M_COPY_PKTHDR * and said "just for rcvif". If true, then @@ -767,7 +767,7 @@ icmp6_input(struct mbuf **mp, int *offp, int proto) goto badcode; if (icmp6len < sizeof(struct nd_router_solicit)) goto badlen; - if ((n = m_copym(m, 0, M_COPYALL, M_DONTWAIT)) == NULL) { + if ((n = m_copym(m, 0, M_COPYALL, M_NOWAIT)) == NULL) { /* give up local */ /* Send incoming SeND packet to user space. */ @@ -805,7 +805,7 @@ icmp6_input(struct mbuf **mp, int *offp, int proto) goto badcode; if (icmp6len < sizeof(struct nd_router_advert)) goto badlen; - if ((n = m_copym(m, 0, M_COPYALL, M_DONTWAIT)) == NULL) { + if ((n = m_copym(m, 0, M_COPYALL, M_NOWAIT)) == NULL) { /* Send incoming SeND-protected/ND packet to user space. */ if (send_sendso_input_hook != NULL) { @@ -836,7 +836,7 @@ icmp6_input(struct mbuf **mp, int *offp, int proto) goto badcode; if (icmp6len < sizeof(struct nd_neighbor_solicit)) goto badlen; - if ((n = m_copym(m, 0, M_COPYALL, M_DONTWAIT)) == NULL) { + if ((n = m_copym(m, 0, M_COPYALL, M_NOWAIT)) == NULL) { if (send_sendso_input_hook != NULL) { error = send_sendso_input_hook(m, ifp, SND_IN, ip6len); @@ -865,7 +865,7 @@ icmp6_input(struct mbuf **mp, int *offp, int proto) goto badcode; if (icmp6len < sizeof(struct nd_neighbor_advert)) goto badlen; - if ((n = m_copym(m, 0, M_COPYALL, M_DONTWAIT)) == NULL) { + if ((n = m_copym(m, 0, M_COPYALL, M_NOWAIT)) == NULL) { /* Send incoming SeND-protected/ND packet to user space. */ if (send_sendso_input_hook != NULL) { @@ -896,7 +896,7 @@ icmp6_input(struct mbuf **mp, int *offp, int proto) goto badcode; if (icmp6len < sizeof(struct nd_redirect)) goto badlen; - if ((n = m_copym(m, 0, M_COPYALL, M_DONTWAIT)) == NULL) { + if ((n = m_copym(m, 0, M_COPYALL, M_NOWAIT)) == NULL) { if (send_sendso_input_hook != NULL) { error = send_sendso_input_hook(m, ifp, SND_IN, ip6len); @@ -1495,7 +1495,7 @@ ni6_input(struct mbuf *m, int off) } /* allocate an mbuf to reply. */ - MGETHDR(n, M_DONTWAIT, m->m_type); + MGETHDR(n, M_NOWAIT, m->m_type); if (n == NULL) { m_freem(m); return (NULL); @@ -1509,7 +1509,7 @@ ni6_input(struct mbuf *m, int off) */ goto bad; } - MCLGET(n, M_DONTWAIT); + MCLGET(n, M_NOWAIT); if ((n->m_flags & M_EXT) == 0) { goto bad; } @@ -1609,9 +1609,9 @@ ni6_nametodns(const char *name, int namelen, int old) len = MCLBYTES; /* because MAXHOSTNAMELEN is usually 256, we use cluster mbuf */ - MGET(m, M_DONTWAIT, MT_DATA); + MGET(m, M_NOWAIT, MT_DATA); if (m && len > MLEN) { - MCLGET(m, M_DONTWAIT); + MCLGET(m, M_NOWAIT); if ((m->m_flags & M_EXT) == 0) goto fail; } @@ -2063,7 +2063,7 @@ icmp6_rip6_input(struct mbuf **mp, int off) */ if ((m->m_flags & M_EXT) && m->m_next == NULL && m->m_len <= MHLEN) { - MGET(n, M_DONTWAIT, m->m_type); + MGET(n, M_NOWAIT, m->m_type); if (n != NULL) { if (m_dup_pkthdr(n, m, M_NOWAIT)) { bcopy(m->m_data, n->m_data, @@ -2113,7 +2113,7 @@ icmp6_rip6_input(struct mbuf **mp, int off) m->m_len <= MHLEN) { struct mbuf *n; - MGET(n, M_DONTWAIT, m->m_type); + MGET(n, M_NOWAIT, m->m_type); if (n != NULL) { if (m_dup_pkthdr(n, m, M_NOWAIT)) { bcopy(m->m_data, n->m_data, m->m_len); @@ -2592,9 +2592,9 @@ icmp6_redirect_output(struct mbuf *m0, struct rtentry *rt) #if IPV6_MMTU >= MCLBYTES # error assumption failed about IPV6_MMTU and MCLBYTES #endif - MGETHDR(m, M_DONTWAIT, MT_HEADER); + MGETHDR(m, M_NOWAIT, MT_HEADER); if (m && IPV6_MMTU >= MHLEN) - MCLGET(m, M_DONTWAIT); + MCLGET(m, M_NOWAIT); if (!m) goto fail; M_SETFIB(m, rt->rt_fibnum); diff --git a/sys/netinet6/in6_gif.c b/sys/netinet6/in6_gif.c index 573287caa4c3..9da5917aa497 100644 --- a/sys/netinet6/in6_gif.c +++ b/sys/netinet6/in6_gif.c @@ -167,7 +167,7 @@ in6_gif_output(struct ifnet *ifp, eiphdr.eip_resvh = 0; } /* prepend Ethernet-in-IP header */ - M_PREPEND(m, sizeof(struct etherip_header), M_DONTWAIT); + M_PREPEND(m, sizeof(struct etherip_header), M_NOWAIT); if (m && m->m_len < sizeof(struct etherip_header)) m = m_pullup(m, sizeof(struct etherip_header)); if (m == NULL) @@ -191,7 +191,7 @@ in6_gif_output(struct ifnet *ifp, if (family == AF_LINK) len += ETHERIP_ALIGN; #endif - M_PREPEND(m, len, M_DONTWAIT); + M_PREPEND(m, len, M_NOWAIT); if (m != NULL && m->m_len < len) m = m_pullup(m, len); if (m == NULL) { diff --git a/sys/netinet6/ip6_input.c b/sys/netinet6/ip6_input.c index 1b90c75dc29c..f75a11f07e34 100644 --- a/sys/netinet6/ip6_input.c +++ b/sys/netinet6/ip6_input.c @@ -492,11 +492,11 @@ ip6_input(struct mbuf *m) if (m && m->m_next != NULL && m->m_pkthdr.len < MCLBYTES) { struct mbuf *n; - MGETHDR(n, M_DONTWAIT, MT_HEADER); + MGETHDR(n, M_NOWAIT, MT_HEADER); if (n) M_MOVE_PKTHDR(n, m); if (n && n->m_pkthdr.len > MHLEN) { - MCLGET(n, M_DONTWAIT); + MCLGET(n, M_NOWAIT); if ((n->m_flags & M_EXT) == 0) { m_freem(n); n = NULL; @@ -1662,9 +1662,9 @@ ip6_pullexthdr(struct mbuf *m, size_t off, int nxt) else elen = (ip6e.ip6e_len + 1) << 3; - MGET(n, M_DONTWAIT, MT_DATA); + MGET(n, M_NOWAIT, MT_DATA); if (n && elen >= MLEN) { - MCLGET(n, M_DONTWAIT); + MCLGET(n, M_NOWAIT); if ((n->m_flags & M_EXT) == 0) { m_free(n); n = NULL; diff --git a/sys/netinet6/ip6_mroute.c b/sys/netinet6/ip6_mroute.c index 5e72b2be47f6..a22111010db3 100644 --- a/sys/netinet6/ip6_mroute.c +++ b/sys/netinet6/ip6_mroute.c @@ -1699,7 +1699,7 @@ register_send(struct ip6_hdr *ip6, struct mif6 *mif, struct mbuf *m) ++pim6stat.pim6s_snd_registers; /* Make a copy of the packet to send to the user level process */ - MGETHDR(mm, M_DONTWAIT, MT_HEADER); + MGETHDR(mm, M_NOWAIT, MT_HEADER); if (mm == NULL) return (ENOBUFS); mm->m_pkthdr.rcvif = NULL; diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c index 0d762e9d7d25..f4a0d782c8ca 100644 --- a/sys/netinet6/ip6_output.c +++ b/sys/netinet6/ip6_output.c @@ -1125,7 +1125,7 @@ skip_ipsec2:; */ m0 = m; for (off = hlen; off < tlen; off += len) { - MGETHDR(m, M_DONTWAIT, MT_HEADER); + MGETHDR(m, M_NOWAIT, MT_HEADER); if (!m) { error = ENOBUFS; V_ip6stat.ip6s_odropped++; @@ -1225,12 +1225,12 @@ ip6_copyexthdr(struct mbuf **mp, caddr_t hdr, int hlen) if (hlen > MCLBYTES) return (ENOBUFS); /* XXX */ - MGET(m, M_DONTWAIT, MT_DATA); + MGET(m, M_NOWAIT, MT_DATA); if (!m) return (ENOBUFS); if (hlen > MLEN) { - MCLGET(m, M_DONTWAIT); + MCLGET(m, M_NOWAIT); if ((m->m_flags & M_EXT) == 0) { m_free(m); return (ENOBUFS); @@ -1263,7 +1263,7 @@ ip6_insert_jumboopt(struct ip6_exthdrs *exthdrs, u_int32_t plen) * Otherwise, use it to store the options. */ if (exthdrs->ip6e_hbh == 0) { - MGET(mopt, M_DONTWAIT, MT_DATA); + MGET(mopt, M_NOWAIT, MT_DATA); if (mopt == 0) return (ENOBUFS); mopt->m_len = JUMBOOPTLEN; @@ -1295,9 +1295,9 @@ ip6_insert_jumboopt(struct ip6_exthdrs *exthdrs, u_int32_t plen) * As a consequence, we must always prepare a cluster * at this point. */ - MGET(n, M_DONTWAIT, MT_DATA); + MGET(n, M_NOWAIT, MT_DATA); if (n) { - MCLGET(n, M_DONTWAIT); + MCLGET(n, M_NOWAIT); if ((n->m_flags & M_EXT) == 0) { m_freem(n); n = NULL; @@ -1350,7 +1350,7 @@ ip6_insertfraghdr(struct mbuf *m0, struct mbuf *m, int hlen, if (hlen > sizeof(struct ip6_hdr)) { n = m_copym(m0, sizeof(struct ip6_hdr), - hlen - sizeof(struct ip6_hdr), M_DONTWAIT); + hlen - sizeof(struct ip6_hdr), M_NOWAIT); if (n == 0) return (ENOBUFS); m->m_next = n; @@ -1372,7 +1372,7 @@ ip6_insertfraghdr(struct mbuf *m0, struct mbuf *m, int hlen, /* allocate a new mbuf for the fragment header */ struct mbuf *mfrg; - MGET(mfrg, M_DONTWAIT, MT_DATA); + MGET(mfrg, M_NOWAIT, MT_DATA); if (mfrg == 0) return (ENOBUFS); mfrg->m_len = sizeof(struct ip6_frag); @@ -3048,7 +3048,7 @@ ip6_splithdr(struct mbuf *m, struct ip6_exthdrs *exthdrs) ip6 = mtod(m, struct ip6_hdr *); if (m->m_len > sizeof(*ip6)) { - MGETHDR(mh, M_DONTWAIT, MT_HEADER); + MGETHDR(mh, M_NOWAIT, MT_HEADER); if (mh == 0) { m_freem(m); return ENOBUFS; diff --git a/sys/netinet6/mld6.c b/sys/netinet6/mld6.c index ba850b2a38b2..0d9e30026ebc 100644 --- a/sys/netinet6/mld6.c +++ b/sys/netinet6/mld6.c @@ -1799,13 +1799,13 @@ mld_v1_transmit_report(struct in6_multi *in6m, const int type) ia = in6ifa_ifpforlinklocal(ifp, IN6_IFF_NOTREADY|IN6_IFF_ANYCAST); /* ia may be NULL if link-local address is tentative. */ - MGETHDR(mh, M_DONTWAIT, MT_HEADER); + MGETHDR(mh, M_NOWAIT, MT_HEADER); if (mh == NULL) { if (ia != NULL) ifa_free(&ia->ia_ifa); return (ENOMEM); } - MGET(md, M_DONTWAIT, MT_DATA); + MGET(md, M_NOWAIT, MT_DATA); if (md == NULL) { m_free(mh); if (ia != NULL) @@ -2447,9 +2447,9 @@ mld_v2_enqueue_group_record(struct ifqueue *ifq, struct in6_multi *inm, m0srcs = (ifp->if_mtu - MLD_MTUSPACE - sizeof(struct mldv2_record)) / sizeof(struct in6_addr); if (!is_state_change && !is_group_query) - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) - m = m_gethdr(M_DONTWAIT, MT_DATA); + m = m_gethdr(M_NOWAIT, MT_DATA); if (m == NULL) return (-ENOMEM); @@ -2572,9 +2572,9 @@ mld_v2_enqueue_group_record(struct ifqueue *ifq, struct in6_multi *inm, CTR1(KTR_MLD, "%s: outbound queue full", __func__); return (-ENOMEM); } - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) - m = m_gethdr(M_DONTWAIT, MT_DATA); + m = m_gethdr(M_NOWAIT, MT_DATA); if (m == NULL) return (-ENOMEM); mld_save_context(m, ifp); @@ -2726,9 +2726,9 @@ mld_v2_enqueue_filter_change(struct ifqueue *ifq, struct in6_multi *inm) CTR1(KTR_MLD, "%s: use previous packet", __func__); } else { - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) - m = m_gethdr(M_DONTWAIT, MT_DATA); + m = m_gethdr(M_NOWAIT, MT_DATA); if (m == NULL) { CTR1(KTR_MLD, "%s: m_get*() failed", __func__); @@ -3173,7 +3173,7 @@ mld_v2_encap_report(struct ifnet *ifp, struct mbuf *m) if (ia == NULL) CTR1(KTR_MLD, "%s: warning: ia is NULL", __func__); - MGETHDR(mh, M_DONTWAIT, MT_HEADER); + MGETHDR(mh, M_NOWAIT, MT_HEADER); if (mh == NULL) { if (ia != NULL) ifa_free(&ia->ia_ifa); diff --git a/sys/netinet6/nd6_nbr.c b/sys/netinet6/nd6_nbr.c index 42b4ad22eb5b..31d0ccba6b04 100644 --- a/sys/netinet6/nd6_nbr.c +++ b/sys/netinet6/nd6_nbr.c @@ -419,9 +419,9 @@ nd6_ns_output(struct ifnet *ifp, const struct in6_addr *daddr6, return; } - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m && max_linkhdr + maxlen >= MHLEN) { - MCLGET(m, M_DONTWAIT); + MCLGET(m, M_NOWAIT); if ((m->m_flags & M_EXT) == 0) { m_free(m); m = NULL; @@ -994,9 +994,9 @@ nd6_na_output_fib(struct ifnet *ifp, const struct in6_addr *daddr6_0, return; } - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m && max_linkhdr + maxlen >= MHLEN) { - MCLGET(m, M_DONTWAIT); + MCLGET(m, M_NOWAIT); if ((m->m_flags & M_EXT) == 0) { m_free(m); m = NULL; diff --git a/sys/netinet6/raw_ip6.c b/sys/netinet6/raw_ip6.c index d78bf8ef1afd..e6350413d678 100644 --- a/sys/netinet6/raw_ip6.c +++ b/sys/netinet6/raw_ip6.c @@ -459,7 +459,7 @@ rip6_output(m, va_alist) code = icmp6->icmp6_code; } - M_PREPEND(m, sizeof(*ip6), M_DONTWAIT); + M_PREPEND(m, sizeof(*ip6), M_NOWAIT); if (m == NULL) { error = ENOBUFS; goto bad; diff --git a/sys/netinet6/udp6_usrreq.c b/sys/netinet6/udp6_usrreq.c index 952905a2bd02..200fd68d44c4 100644 --- a/sys/netinet6/udp6_usrreq.c +++ b/sys/netinet6/udp6_usrreq.c @@ -747,7 +747,7 @@ udp6_output(struct inpcb *inp, struct mbuf *m, struct sockaddr *addr6, * Calculate data length and get a mbuf * for UDP and IP6 headers. */ - M_PREPEND(m, hlen + sizeof(struct udphdr), M_DONTWAIT); + M_PREPEND(m, hlen + sizeof(struct udphdr), M_NOWAIT); if (m == 0) { error = ENOBUFS; goto release; diff --git a/sys/netipsec/ipsec_mbuf.c b/sys/netipsec/ipsec_mbuf.c index ffbe6649b340..bc87409be511 100644 --- a/sys/netipsec/ipsec_mbuf.c +++ b/sys/netipsec/ipsec_mbuf.c @@ -85,11 +85,11 @@ m_makespace(struct mbuf *m0, int skip, int hlen, int *off) todo = remain; while (todo > 0) { if (todo > MHLEN) { - n = m_getcl(M_DONTWAIT, m->m_type, 0); + n = m_getcl(M_NOWAIT, m->m_type, 0); len = MCLBYTES; } else { - n = m_get(M_DONTWAIT, m->m_type); + n = m_get(M_NOWAIT, m->m_type); len = MHLEN; } if (n == NULL) { @@ -115,7 +115,7 @@ m_makespace(struct mbuf *m0, int skip, int hlen, int *off) } } else { - n = m_get(M_DONTWAIT, m->m_type); + n = m_get(M_NOWAIT, m->m_type); if (n == NULL) { m_freem(n0); return NULL; @@ -203,7 +203,7 @@ m_pad(struct mbuf *m, int n) if (pad > M_TRAILINGSPACE(m0)) { /* Add an mbuf to the chain. */ - MGET(m1, M_DONTWAIT, MT_DATA); + MGET(m1, M_NOWAIT, MT_DATA); if (m1 == 0) { m_freem(m0); DPRINTF(("%s: unable to get extra mbuf\n", __func__)); diff --git a/sys/netipsec/ipsec_output.c b/sys/netipsec/ipsec_output.c index 681dc15d8d0d..f263139e6e15 100644 --- a/sys/netipsec/ipsec_output.c +++ b/sys/netipsec/ipsec_output.c @@ -601,7 +601,7 @@ ipsec6_splithdr(struct mbuf *m) ip6 = mtod(m, struct ip6_hdr *); hlen = sizeof(struct ip6_hdr); if (m->m_len > hlen) { - MGETHDR(mh, M_DONTWAIT, MT_DATA); + MGETHDR(mh, M_NOWAIT, MT_DATA); if (!mh) { m_freem(m); return NULL; @@ -721,7 +721,7 @@ ipsec6_encapsulate(struct mbuf *m, struct secasvar *sav) plen = m->m_pkthdr.len; if (M_LEADINGSPACE(m->m_next) < sizeof(struct ip6_hdr)) { struct mbuf *n; - MGET(n, M_DONTWAIT, MT_DATA); + MGET(n, M_NOWAIT, MT_DATA); if (!n) { m_freem(m); return ENOBUFS; diff --git a/sys/netipsec/key.c b/sys/netipsec/key.c index 2d6443db5afb..a4b7ecba0d98 100644 --- a/sys/netipsec/key.c +++ b/sys/netipsec/key.c @@ -1723,7 +1723,7 @@ key_gather_mbuf(m, mhp, ndeep, nitem, va_alist) IPSEC_ASSERT(len <= MHLEN, ("header too big %u", len)); - MGETHDR(n, M_DONTWAIT, MT_DATA); + MGETHDR(n, M_NOWAIT, MT_DATA); if (!n) goto fail; n->m_len = len; @@ -1742,7 +1742,7 @@ key_gather_mbuf(m, mhp, ndeep, nitem, va_alist) mtod(n, caddr_t)); } else { n = m_copym(m, mhp->extoff[idx], mhp->extlen[idx], - M_DONTWAIT); + M_NOWAIT); } if (n == NULL) goto fail; @@ -2200,9 +2200,9 @@ key_spddelete2(so, m, mhp) /* create new sadb_msg to reply. */ len = PFKEY_ALIGN8(sizeof(struct sadb_msg)); - MGETHDR(n, M_DONTWAIT, MT_DATA); + MGETHDR(n, M_NOWAIT, MT_DATA); if (n && len > MHLEN) { - MCLGET(n, M_DONTWAIT); + MCLGET(n, M_NOWAIT); if ((n->m_flags & M_EXT) == 0) { m_freem(n); n = NULL; @@ -2222,7 +2222,7 @@ key_spddelete2(so, m, mhp) off, len)); n->m_next = m_copym(m, mhp->extoff[SADB_X_EXT_POLICY], - mhp->extlen[SADB_X_EXT_POLICY], M_DONTWAIT); + mhp->extlen[SADB_X_EXT_POLICY], M_NOWAIT); if (!n->m_next) { m_freem(n); return key_senderror(so, m, ENOBUFS); @@ -3562,9 +3562,9 @@ key_setsadbmsg(u_int8_t type, u_int16_t tlen, u_int8_t satype, u_int32_t seq, len = PFKEY_ALIGN8(sizeof(struct sadb_msg)); if (len > MCLBYTES) return NULL; - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m && len > MHLEN) { - MCLGET(m, M_DONTWAIT); + MCLGET(m, M_NOWAIT); if ((m->m_flags & M_EXT) == 0) { m_freem(m); m = NULL; @@ -4823,9 +4823,9 @@ key_getspi(so, m, mhp) len = PFKEY_ALIGN8(sizeof(struct sadb_msg)) + PFKEY_ALIGN8(sizeof(struct sadb_sa)); - MGETHDR(n, M_DONTWAIT, MT_DATA); + MGETHDR(n, M_NOWAIT, MT_DATA); if (len > MHLEN) { - MCLGET(n, M_DONTWAIT); + MCLGET(n, M_NOWAIT); if ((n->m_flags & M_EXT) == 0) { m_freem(n); n = NULL; @@ -6033,7 +6033,7 @@ key_getcomb_esp() else { IPSEC_ASSERT(l <= MLEN, ("l=%u > MLEN=%lu", l, (u_long) MLEN)); - MGET(m, M_DONTWAIT, MT_DATA); + MGET(m, M_NOWAIT, MT_DATA); if (m) { M_ALIGN(m, l); m->m_len = l; @@ -6141,14 +6141,14 @@ key_getcomb_ah() if (!m) { IPSEC_ASSERT(l <= MLEN, ("l=%u > MLEN=%lu", l, (u_long) MLEN)); - MGET(m, M_DONTWAIT, MT_DATA); + MGET(m, M_NOWAIT, MT_DATA); if (m) { M_ALIGN(m, l); m->m_len = l; m->m_next = NULL; } } else - M_PREPEND(m, l, M_DONTWAIT); + M_PREPEND(m, l, M_NOWAIT); if (!m) return NULL; @@ -6185,14 +6185,14 @@ key_getcomb_ipcomp() if (!m) { IPSEC_ASSERT(l <= MLEN, ("l=%u > MLEN=%lu", l, (u_long) MLEN)); - MGET(m, M_DONTWAIT, MT_DATA); + MGET(m, M_NOWAIT, MT_DATA); if (m) { M_ALIGN(m, l); m->m_len = l; m->m_next = NULL; } } else - M_PREPEND(m, l, M_DONTWAIT); + M_PREPEND(m, l, M_NOWAIT); if (!m) return NULL; @@ -6236,7 +6236,7 @@ key_getprop(saidx) if (!m) return NULL; - M_PREPEND(m, l, M_DONTWAIT); + M_PREPEND(m, l, M_NOWAIT); if (!m) return NULL; @@ -6794,9 +6794,9 @@ key_register(so, m, mhp) if (len > MCLBYTES) return key_senderror(so, m, ENOBUFS); - MGETHDR(n, M_DONTWAIT, MT_DATA); + MGETHDR(n, M_NOWAIT, MT_DATA); if (len > MHLEN) { - MCLGET(n, M_DONTWAIT); + MCLGET(n, M_NOWAIT); if ((n->m_flags & M_EXT) == 0) { m_freem(n); n = NULL; @@ -7364,9 +7364,9 @@ key_parse(m, so) if (m->m_next) { struct mbuf *n; - MGETHDR(n, M_DONTWAIT, MT_DATA); + MGETHDR(n, M_NOWAIT, MT_DATA); if (n && m->m_pkthdr.len > MHLEN) { - MCLGET(n, M_DONTWAIT); + MCLGET(n, M_NOWAIT); if ((n->m_flags & M_EXT) == 0) { m_free(n); n = NULL; @@ -7969,9 +7969,9 @@ key_alloc_mbuf(l) len = l; while (len > 0) { - MGET(n, M_DONTWAIT, MT_DATA); + MGET(n, M_NOWAIT, MT_DATA); if (n && len > MLEN) - MCLGET(n, M_DONTWAIT); + MCLGET(n, M_NOWAIT); if (!n) { m_freem(m); return NULL; diff --git a/sys/netipsec/keysock.c b/sys/netipsec/keysock.c index 143b600bb4f7..475befaf10b1 100644 --- a/sys/netipsec/keysock.c +++ b/sys/netipsec/keysock.c @@ -143,7 +143,7 @@ key_sendup0(rp, m, promisc) if (promisc) { struct sadb_msg *pmsg; - M_PREPEND(m, sizeof(struct sadb_msg), M_DONTWAIT); + M_PREPEND(m, sizeof(struct sadb_msg), M_NOWAIT); if (m && m->m_len < sizeof(struct sadb_msg)) m = m_pullup(m, sizeof(struct sadb_msg)); if (!m) { @@ -214,14 +214,14 @@ key_sendup(so, msg, len, target) m = mprev = NULL; while (tlen > 0) { if (tlen == len) { - MGETHDR(n, M_DONTWAIT, MT_DATA); + MGETHDR(n, M_NOWAIT, MT_DATA); if (n == NULL) { V_pfkeystat.in_nomem++; return ENOBUFS; } n->m_len = MHLEN; } else { - MGET(n, M_DONTWAIT, MT_DATA); + MGET(n, M_NOWAIT, MT_DATA); if (n == NULL) { V_pfkeystat.in_nomem++; return ENOBUFS; @@ -229,7 +229,7 @@ key_sendup(so, msg, len, target) n->m_len = MLEN; } if (tlen >= MCLBYTES) { /*XXX better threshold? */ - MCLGET(n, M_DONTWAIT); + MCLGET(n, M_NOWAIT); if ((n->m_flags & M_EXT) == 0) { m_free(n); m_freem(m); diff --git a/sys/netipsec/xform_ipip.c b/sys/netipsec/xform_ipip.c index bde2d2c5e829..fc3b1d29859d 100644 --- a/sys/netipsec/xform_ipip.c +++ b/sys/netipsec/xform_ipip.c @@ -447,7 +447,7 @@ ipip_output( goto bad; } - M_PREPEND(m, sizeof(struct ip), M_DONTWAIT); + M_PREPEND(m, sizeof(struct ip), M_NOWAIT); if (m == 0) { DPRINTF(("%s: M_PREPEND failed\n", __func__)); V_ipipstat.ipips_hdrops++; @@ -534,7 +534,7 @@ ipip_output( if (IN6_IS_SCOPE_LINKLOCAL(&ip6->ip6_dst)) ip6->ip6_dst.s6_addr16[1] = 0; - M_PREPEND(m, sizeof(struct ip6_hdr), M_DONTWAIT); + M_PREPEND(m, sizeof(struct ip6_hdr), M_NOWAIT); if (m == 0) { DPRINTF(("%s: M_PREPEND failed\n", __func__)); V_ipipstat.ipips_hdrops++; diff --git a/sys/netipx/ipx_outputfl.c b/sys/netipx/ipx_outputfl.c index 3fbda88b8b19..25bbedf40bbc 100644 --- a/sys/netipx/ipx_outputfl.c +++ b/sys/netipx/ipx_outputfl.c @@ -270,7 +270,7 @@ ipx_output_type20(struct mbuf *m) if(ipx->ipx_sum != 0xffff) ipx->ipx_sum = ipx_cksum(m, ntohs(ipx->ipx_len)); - m1 = m_copym(m, 0, M_COPYALL, M_DONTWAIT); + m1 = m_copym(m, 0, M_COPYALL, M_NOWAIT); if(m1) { error = (*ifp->if_output)(ifp, m1, (struct sockaddr *)&dst, NULL); diff --git a/sys/netipx/ipx_usrreq.c b/sys/netipx/ipx_usrreq.c index 5fcfa3645c4b..31b781c9f65f 100644 --- a/sys/netipx/ipx_usrreq.c +++ b/sys/netipx/ipx_usrreq.c @@ -257,7 +257,7 @@ ipx_output(struct ipxpcb *ipxp, struct mbuf *m0) (m->m_len + m->m_data < &m->m_dat[MLEN])) { mtod(m, char*)[m->m_len++] = 0; } else { - struct mbuf *m1 = m_get(M_DONTWAIT, MT_DATA); + struct mbuf *m1 = m_get(M_NOWAIT, MT_DATA); if (m1 == NULL) { m_freem(m0); @@ -278,7 +278,7 @@ ipx_output(struct ipxpcb *ipxp, struct mbuf *m0) if (ipxp->ipxp_flags & IPXP_RAWOUT) { ipx = mtod(m, struct ipx *); } else { - M_PREPEND(m, sizeof(struct ipx), M_DONTWAIT); + M_PREPEND(m, sizeof(struct ipx), M_NOWAIT); if (m == NULL) return (ENOBUFS); ipx = mtod(m, struct ipx *); diff --git a/sys/netipx/spx_reass.c b/sys/netipx/spx_reass.c index fea031fdc493..2479ae13ec87 100644 --- a/sys/netipx/spx_reass.c +++ b/sys/netipx/spx_reass.c @@ -399,7 +399,7 @@ spx_reass(struct spxpcb *cb, struct mbuf *msi, struct spx *si) spx_newchecks[4]++; if (dt != cb->s_rhdr.spx_dt) { struct mbuf *mm = - m_getclr(M_DONTWAIT, MT_CONTROL); + m_getclr(M_NOWAIT, MT_CONTROL); spx_newchecks[0]++; if (mm != NULL) { u_short *s = diff --git a/sys/netipx/spx_usrreq.c b/sys/netipx/spx_usrreq.c index 2b1828855bcc..9d00d10533f5 100644 --- a/sys/netipx/spx_usrreq.c +++ b/sys/netipx/spx_usrreq.c @@ -473,7 +473,7 @@ spx_output(struct spxpcb *cb, struct mbuf *m0) cb->s_cc &= ~SPX_EM; while (len > mtu) { - m = m_copym(m0, 0, mtu, M_DONTWAIT); + m = m_copym(m0, 0, mtu, M_NOWAIT); if (m == NULL) { cb->s_cc |= oldEM; m_freem(m0); @@ -509,7 +509,7 @@ spx_output(struct spxpcb *cb, struct mbuf *m0) if (M_TRAILINGSPACE(m) >= 1) m->m_len++; else { - struct mbuf *m1 = m_get(M_DONTWAIT, MT_DATA); + struct mbuf *m1 = m_get(M_NOWAIT, MT_DATA); if (m1 == NULL) { m_freem(m0); @@ -520,7 +520,7 @@ spx_output(struct spxpcb *cb, struct mbuf *m0) m->m_next = m1; } } - m = m_gethdr(M_DONTWAIT, MT_DATA); + m = m_gethdr(M_NOWAIT, MT_DATA); if (m == NULL) { m_freem(m0); return (ENOBUFS); @@ -734,7 +734,7 @@ spx_output(struct spxpcb *cb, struct mbuf *m0) spxstat.spxs_sndprobe++; if (cb->s_flags & SF_ACKNOW) spxstat.spxs_sndacks++; - m = m_gethdr(M_DONTWAIT, MT_DATA); + m = m_gethdr(M_NOWAIT, MT_DATA); if (m == NULL) return (ENOBUFS); @@ -1091,7 +1091,7 @@ spx_attach(struct socket *so, int proto, struct thread *td) cb = malloc(sizeof *cb, M_PCB, M_NOWAIT | M_ZERO); if (cb == NULL) return (ENOBUFS); - mm = m_getclr(M_DONTWAIT, MT_DATA); + mm = m_getclr(M_NOWAIT, MT_DATA); if (mm == NULL) { free(cb, M_PCB); return (ENOBUFS); diff --git a/sys/netnatm/natm.c b/sys/netnatm/natm.c index cfcbaa786c73..681da9cd0595 100644 --- a/sys/netnatm/natm.c +++ b/sys/netnatm/natm.c @@ -292,7 +292,7 @@ natm_usr_send(struct socket *so, int flags, struct mbuf *m, /* * Send the data. We must put an atm_pseudohdr on first. */ - M_PREPEND(m, sizeof(*aph), M_DONTWAIT); + M_PREPEND(m, sizeof(*aph), M_NOWAIT); if (m == NULL) { NATM_UNLOCK(); m_freem(control); diff --git a/sys/netncp/ncp_sock.c b/sys/netncp/ncp_sock.c index 4be432ed3cf0..24557bef0add 100644 --- a/sys/netncp/ncp_sock.c +++ b/sys/netncp/ncp_sock.c @@ -157,7 +157,7 @@ ncp_sock_send(struct socket *so, struct mbuf *top, struct ncp_rq *rqp) int error, flags=0; for (;;) { - m = m_copym(top, 0, M_COPYALL, M_WAIT); + m = m_copym(top, 0, M_COPYALL, M_WAITOK); /* NCPDDEBUG(m);*/ error = sosend(so, to, 0, m, 0, flags, td); if (error == 0 || error == EINTR || error == ENETDOWN) diff --git a/sys/netpfil/ipfw/ip_dn_glue.c b/sys/netpfil/ipfw/ip_dn_glue.c index 54eed7500cc0..7d7e69547dd8 100644 --- a/sys/netpfil/ipfw/ip_dn_glue.c +++ b/sys/netpfil/ipfw/ip_dn_glue.c @@ -513,7 +513,7 @@ dn_compat_configure(void *v) lmax += sizeof(struct dn_sch) + sizeof(struct dn_link) + sizeof(struct dn_fs) + sizeof(struct dn_profile); - base = buf = malloc(lmax, M_DUMMYNET, M_WAIT|M_ZERO); + base = buf = malloc(lmax, M_DUMMYNET, M_WAITOK|M_ZERO); o_next(&buf, sizeof(struct dn_id), DN_CMD_CONFIG); base->id = DN_API_VERSION; diff --git a/sys/netpfil/ipfw/ip_fw_dynamic.c b/sys/netpfil/ipfw/ip_fw_dynamic.c index d58bc90bd155..5cccce9dc1c1 100644 --- a/sys/netpfil/ipfw/ip_fw_dynamic.c +++ b/sys/netpfil/ipfw/ip_fw_dynamic.c @@ -810,7 +810,7 @@ ipfw_send_pkt(struct mbuf *replyto, struct ipfw_flow_id *id, u_int32_t seq, #endif struct tcphdr *th = NULL; - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) return (NULL); diff --git a/sys/netpfil/ipfw/ip_fw_pfil.c b/sys/netpfil/ipfw/ip_fw_pfil.c index 5d6c1bdae01d..79973b1f05c7 100644 --- a/sys/netpfil/ipfw/ip_fw_pfil.c +++ b/sys/netpfil/ipfw/ip_fw_pfil.c @@ -346,7 +346,7 @@ ipfw_check_frame(void *arg, struct mbuf **m0, struct ifnet *dst, int dir, * Restore Ethernet header, as needed, in case the * mbuf chain was replaced by ipfw. */ - M_PREPEND(m, ETHER_HDR_LEN, M_DONTWAIT); + M_PREPEND(m, ETHER_HDR_LEN, M_NOWAIT); if (m == NULL) { *m0 = NULL; return (0); @@ -411,7 +411,7 @@ ipfw_divert(struct mbuf **m0, int incoming, struct ipfw_rule_ref *rule, clone = *m0; /* use the original mbuf */ *m0 = NULL; } else { - clone = m_dup(*m0, M_DONTWAIT); + clone = m_dup(*m0, M_NOWAIT); /* If we cannot duplicate the mbuf, we sacrifice the divert * chain and continue with the tee-ed packet. */ diff --git a/sys/netsmb/smb_iod.c b/sys/netsmb/smb_iod.c index 78def4739f1f..e4c805a33698 100644 --- a/sys/netsmb/smb_iod.c +++ b/sys/netsmb/smb_iod.c @@ -255,7 +255,7 @@ smb_iod_sendrq(struct smbiod *iod, struct smb_rq *rqp) } SMBSDEBUG("M:%04x, P:%04x, U:%04x, T:%04x\n", rqp->sr_mid, 0, 0, 0); m_dumpm(rqp->sr_rq.mb_top); - m = m_copym(rqp->sr_rq.mb_top, 0, M_COPYALL, M_WAIT); + m = m_copym(rqp->sr_rq.mb_top, 0, M_COPYALL, M_WAITOK); error = rqp->sr_lerror = SMB_TRAN_SEND(vcp, m, td); if (error == 0) { getnanotime(&rqp->sr_timesent); diff --git a/sys/netsmb/smb_rq.c b/sys/netsmb/smb_rq.c index 566a25211558..957102901cf4 100644 --- a/sys/netsmb/smb_rq.c +++ b/sys/netsmb/smb_rq.c @@ -427,7 +427,7 @@ smb_t2_placedata(struct mbuf *mtop, u_int16_t offset, u_int16_t count, struct mbuf *m, *m0; int len; - m0 = m_split(mtop, offset, M_WAIT); + m0 = m_split(mtop, offset, M_WAITOK); len = m_length(m0, &m); m->m_len -= len - count; if (mdp->md_top == NULL) { diff --git a/sys/netsmb/smb_trantcp.c b/sys/netsmb/smb_trantcp.c index a7c7e05b351d..dd39ac5fed8c 100644 --- a/sys/netsmb/smb_trantcp.c +++ b/sys/netsmb/smb_trantcp.c @@ -580,7 +580,7 @@ smb_nbst_send(struct smb_vc *vcp, struct mbuf *m0, struct thread *td) error = ENOTCONN; goto abort; } - M_PREPEND(m0, 4, M_WAIT); + M_PREPEND(m0, 4, M_WAITOK); nb_sethdr(m0, NB_SSN_MESSAGE, m_fixhdr(m0) - 4); error = nb_sosend(nbp->nbp_tso, m0, 0, td); return error; diff --git a/sys/nfs/krpc_subr.c b/sys/nfs/krpc_subr.c index 18e0f9b67609..6caafcf8f910 100644 --- a/sys/nfs/krpc_subr.c +++ b/sys/nfs/krpc_subr.c @@ -154,7 +154,7 @@ krpc_portmap(struct sockaddr_in *sin, u_int prog, u_int vers, u_int16_t *portp, return 0; } - m = m_get(M_WAIT, MT_DATA); + m = m_get(M_WAITOK, MT_DATA); sdata = mtod(m, struct sdata *); m->m_len = sizeof(*sdata); @@ -275,7 +275,7 @@ krpc_call(struct sockaddr_in *sa, u_int prog, u_int vers, u_int func, /* * Prepend RPC message header. */ - mhead = m_gethdr(M_WAIT, MT_DATA); + mhead = m_gethdr(M_WAITOK, MT_DATA); mhead->m_next = *data; call = mtod(mhead, struct krpc_call *); mhead->m_len = sizeof(*call); @@ -309,7 +309,7 @@ krpc_call(struct sockaddr_in *sa, u_int prog, u_int vers, u_int func, timo = 0; for (;;) { /* Send RPC request (or re-send). */ - m = m_copym(mhead, 0, M_COPYALL, M_WAIT); + m = m_copym(mhead, 0, M_COPYALL, M_WAITOK); error = sosend(so, (struct sockaddr *)sa, NULL, m, NULL, 0, td); if (error) { @@ -459,9 +459,9 @@ xdr_string_encode(char *str, int len) if (mlen > MCLBYTES) /* If too big, we just can't do it. */ return (NULL); - m = m_get(M_WAIT, MT_DATA); + m = m_get(M_WAITOK, MT_DATA); if (mlen > MLEN) - MCLGET(m, M_WAIT); + MCLGET(m, M_WAITOK); xs = mtod(m, struct xdr_string *); m->m_len = mlen; xs->len = txdr_unsigned(len); diff --git a/sys/nfs/nfs_common.c b/sys/nfs/nfs_common.c index 09dbfabed320..6f0394824640 100644 --- a/sys/nfs/nfs_common.c +++ b/sys/nfs/nfs_common.c @@ -275,7 +275,7 @@ nfsm_build_xx(int s, struct mbuf **mb, caddr_t *bpos) void *ret; if (s > M_TRAILINGSPACE(*mb)) { - MGET(mb2, M_WAIT, MT_DATA); + MGET(mb2, M_WAITOK, MT_DATA); if (s > MLEN) panic("build > MLEN"); (*mb)->m_next = mb2; @@ -293,14 +293,14 @@ void * nfsm_dissect_xx(int s, struct mbuf **md, caddr_t *dpos) { - return (nfsm_dissect_xx_sub(s, md, dpos, M_WAIT)); + return (nfsm_dissect_xx_sub(s, md, dpos, M_WAITOK)); } void * nfsm_dissect_xx_nonblock(int s, struct mbuf **md, caddr_t *dpos) { - return (nfsm_dissect_xx_sub(s, md, dpos, M_DONTWAIT)); + return (nfsm_dissect_xx_sub(s, md, dpos, M_NOWAIT)); } static void * diff --git a/sys/nfsclient/nfs_krpc.c b/sys/nfsclient/nfs_krpc.c index 6dfd46d8d61f..0e4a83ec438c 100644 --- a/sys/nfsclient/nfs_krpc.c +++ b/sys/nfsclient/nfs_krpc.c @@ -568,7 +568,7 @@ nfs_request(struct vnode *vp, struct mbuf *mreq, int procnum, * These could cause pointer alignment problems, so copy them to * well aligned mbufs. */ - error = nfs_realign(&mrep, M_DONTWAIT); + error = nfs_realign(&mrep, M_NOWAIT); if (error == ENOMEM) { m_freem(mrep); AUTH_DESTROY(auth); diff --git a/sys/nfsclient/nfs_subs.c b/sys/nfsclient/nfs_subs.c index fb6cbe81ce7e..fd83794152ba 100644 --- a/sys/nfsclient/nfs_subs.c +++ b/sys/nfsclient/nfs_subs.c @@ -181,9 +181,9 @@ nfsm_reqhead(struct vnode *vp, u_long procid, int hsiz) { struct mbuf *mb; - MGET(mb, M_WAIT, MT_DATA); + MGET(mb, M_WAITOK, MT_DATA); if (hsiz >= MINCLSIZE) - MCLGET(mb, M_WAIT); + MCLGET(mb, M_WAITOK); mb->m_len = 0; return (mb); } @@ -218,9 +218,9 @@ nfsm_uiotombuf(struct uio *uiop, struct mbuf **mq, int siz, caddr_t *bpos) while (left > 0) { mlen = M_TRAILINGSPACE(mp); if (mlen == 0) { - MGET(mp, M_WAIT, MT_DATA); + MGET(mp, M_WAITOK, MT_DATA); if (clflg) - MCLGET(mp, M_WAIT); + MCLGET(mp, M_WAITOK); mp->m_len = 0; mp2->m_next = mp; mp2 = mp; @@ -251,7 +251,7 @@ nfsm_uiotombuf(struct uio *uiop, struct mbuf **mq, int siz, caddr_t *bpos) } if (rem > 0) { if (rem > M_TRAILINGSPACE(mp)) { - MGET(mp, M_WAIT, MT_DATA); + MGET(mp, M_WAITOK, MT_DATA); mp->m_len = 0; mp2->m_next = mp; } @@ -296,9 +296,9 @@ nfsm_strtmbuf(struct mbuf **mb, char **bpos, const char *cp, long siz) } /* Loop around adding mbufs */ while (siz > 0) { - MGET(m1, M_WAIT, MT_DATA); + MGET(m1, M_WAITOK, MT_DATA); if (siz > MLEN) - MCLGET(m1, M_WAIT); + MCLGET(m1, M_WAITOK); m1->m_len = NFSMSIZ(m1); m2->m_next = m1; m2 = m1; @@ -481,7 +481,7 @@ nfs_loadattrcache(struct vnode **vpp, struct mbuf **mdp, caddr_t *dposp, md = *mdp; t1 = (mtod(md, caddr_t) + md->m_len) - *dposp; - cp2 = nfsm_disct(mdp, dposp, NFSX_FATTR(v3), t1, M_WAIT); + cp2 = nfsm_disct(mdp, dposp, NFSX_FATTR(v3), t1, M_WAITOK); if (cp2 == NULL) { error = EBADRPC; goto out; diff --git a/sys/nfsserver/nfs_fha.c b/sys/nfsserver/nfs_fha.c index 76537d7ef94d..2dd20c131cd6 100644 --- a/sys/nfsserver/nfs_fha.c +++ b/sys/nfsserver/nfs_fha.c @@ -202,7 +202,7 @@ fha_extract_info(struct svc_req *req, struct fha_info *i) procnum == NFSPROC_NULL) goto out; - error = nfs_realign(&req->rq_args, M_DONTWAIT); + error = nfs_realign(&req->rq_args, M_NOWAIT); if (error) goto out; md = req->rq_args; diff --git a/sys/nfsserver/nfs_serv.c b/sys/nfsserver/nfs_serv.c index f0da468927eb..bef72afea337 100644 --- a/sys/nfsserver/nfs_serv.c +++ b/sys/nfsserver/nfs_serv.c @@ -693,8 +693,8 @@ nfsrv_readlink(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, len = 0; i = 0; while (len < NFS_MAXPATHLEN) { - MGET(nmp, M_WAIT, MT_DATA); - MCLGET(nmp, M_WAIT); + MGET(nmp, M_WAITOK, MT_DATA); + MCLGET(nmp, M_WAITOK); nmp->m_len = NFSMSIZ(nmp); if (len == 0) mp3 = mp = nmp; @@ -878,8 +878,8 @@ nfsrv_read(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, i++; } if (left > 0) { - MGET(m, M_WAIT, MT_DATA); - MCLGET(m, M_WAIT); + MGET(m, M_WAITOK, MT_DATA); + MCLGET(m, M_WAITOK); m->m_len = 0; m2->m_next = m; m2 = m; diff --git a/sys/nfsserver/nfs_srvkrpc.c b/sys/nfsserver/nfs_srvkrpc.c index 2581092eafe0..64f2aaad1ef8 100644 --- a/sys/nfsserver/nfs_srvkrpc.c +++ b/sys/nfsserver/nfs_srvkrpc.c @@ -217,14 +217,14 @@ nfs_rephead(int siz, struct nfsrv_descript *nd, int err, if (err && (nd->nd_flag & ND_NFSV3) == 0) /* XXX recheck */ siz = 0; - MGET(mreq, M_WAIT, MT_DATA); + MGET(mreq, M_WAITOK, MT_DATA); /* * If this is a big reply, use a cluster */ mreq->m_len = 0; if (siz >= MINCLSIZE) { - MCLGET(mreq, M_WAIT); + MCLGET(mreq, M_WAITOK); } mb = mreq; bpos = mtod(mb, caddr_t); @@ -278,7 +278,7 @@ nfssvc_program(struct svc_req *rqst, SVCXPRT *xprt) mreq = mrep = NULL; mreq = rqst->rq_args; rqst->rq_args = NULL; - (void)nfs_realign(&mreq, M_WAIT); + (void)nfs_realign(&mreq, M_WAITOK); /* * Note: we want rq_addr, not svc_getrpccaller for nd_nam2 - diff --git a/sys/nfsserver/nfs_srvsubs.c b/sys/nfsserver/nfs_srvsubs.c index ba3a9fe4775b..eedac6c01138 100644 --- a/sys/nfsserver/nfs_srvsubs.c +++ b/sys/nfsserver/nfs_srvsubs.c @@ -1301,8 +1301,8 @@ nfsm_clget_xx(u_int32_t **tl, struct mbuf *mb, struct mbuf **mp, if (*bp >= *be) { if (*mp == mb) (*mp)->m_len += *bp - bpos; - MGET(nmp, M_WAIT, MT_DATA); - MCLGET(nmp, M_WAIT); + MGET(nmp, M_WAITOK, MT_DATA); + MCLGET(nmp, M_WAITOK); nmp->m_len = NFSMSIZ(nmp); (*mp)->m_next = nmp; *mp = nmp; diff --git a/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c index 1afb80e23efe..339e30500786 100644 --- a/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c +++ b/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c @@ -287,7 +287,7 @@ int ipoib_dma_map_tx(struct ib_device *ca, struct ipoib_tx_buf *tx_req, int max) } i--; if (i >= max) { - tx_req->mb = mb = m_defrag(mb, M_DONTWAIT); + tx_req->mb = mb = m_defrag(mb, M_NOWAIT); if (mb == NULL) return -EIO; for (m = mb, i = 0; m != NULL; m = m->m_next, i++); diff --git a/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c b/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c index 380ee8c2c015..22b0fb923b92 100644 --- a/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c @@ -1346,7 +1346,7 @@ ipoib_output(struct ifnet *ifp, struct mbuf *m, * Add local net header. If no space in first mbuf, * allocate another. */ - M_PREPEND(m, IPOIB_HEADER_LEN, M_DONTWAIT); + M_PREPEND(m, IPOIB_HEADER_LEN, M_NOWAIT); if (m == NULL) { error = ENOBUFS; goto bad; diff --git a/sys/ofed/drivers/infiniband/ulp/sdp/sdp_bcopy.c b/sys/ofed/drivers/infiniband/ulp/sdp/sdp_bcopy.c index d0688528f1ff..327d7bef73f5 100644 --- a/sys/ofed/drivers/infiniband/ulp/sdp/sdp_bcopy.c +++ b/sys/ofed/drivers/infiniband/ulp/sdp/sdp_bcopy.c @@ -151,7 +151,7 @@ sdp_nagle_timeout(void *data) if (ssk->state == TCPS_CLOSED) return; ssk->nagle_last_unacked = 0; - sdp_post_sends(ssk, M_DONTWAIT); + sdp_post_sends(ssk, M_NOWAIT); sowwakeup(ssk->socket); out: diff --git a/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c b/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c index 2b15f31b67f4..c915fb3c92ea 100644 --- a/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c +++ b/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c @@ -928,12 +928,12 @@ sdp_send(struct socket *so, int flags, struct mbuf *m, ssk = sdp_sk(so); KASSERT(m->m_flags & M_PKTHDR, ("sdp_send: %p no packet header", m)); - M_PREPEND(m, SDP_HEAD_SIZE, M_WAIT); + M_PREPEND(m, SDP_HEAD_SIZE, M_WAITOK); mtod(m, struct sdp_bsdh *)->mid = SDP_MID_DATA; for (n = m, cnt = 0; n->m_next; n = n->m_next) cnt++; if (cnt > SDP_MAX_SEND_SGES) { - n = m_collapse(m, M_WAIT, SDP_MAX_SEND_SGES); + n = m_collapse(m, M_WAITOK, SDP_MAX_SEND_SGES); if (n == NULL) { m_freem(m); return (EMSGSIZE); @@ -1196,7 +1196,7 @@ soreceive_rcvoob(struct socket *so, struct uio *uio, int flags) KASSERT(flags & MSG_OOB, ("soreceive_rcvoob: (flags & MSG_OOB) == 0")); - m = m_get(M_WAIT, MT_DATA); + m = m_get(M_WAITOK, MT_DATA); error = (*pr->pr_usrreqs->pru_rcvoob)(so, m, flags & MSG_PEEK); if (error) goto bad; @@ -1351,7 +1351,7 @@ sdp_sorecv(struct socket *so, struct sockaddr **psa, struct uio *uio, KASSERT(sb->sb_mb != NULL, ("%s: len > 0 && sb->sb_mb empty", __func__)); - m = m_copym(sb->sb_mb, 0, len, M_DONTWAIT); + m = m_copym(sb->sb_mb, 0, len, M_NOWAIT); if (m == NULL) len = 0; /* Don't flush data from sockbuf. */ else diff --git a/sys/ofed/drivers/infiniband/ulp/sdp/sdp_tx.c b/sys/ofed/drivers/infiniband/ulp/sdp/sdp_tx.c index b0c37e554e13..f7d84be1b988 100644 --- a/sys/ofed/drivers/infiniband/ulp/sdp/sdp_tx.c +++ b/sys/ofed/drivers/infiniband/ulp/sdp/sdp_tx.c @@ -297,7 +297,7 @@ sdp_process_tx_cq(struct sdp_sock *ssk) } while (n == SDP_NUM_WC); if (wc_processed) { - sdp_post_sends(ssk, M_DONTWAIT); + sdp_post_sends(ssk, M_NOWAIT); sdp_prf1(sk, NULL, "Waking sendmsg. inflight=%d", (u32) tx_ring_posted(ssk)); sowwakeup(ssk->socket); diff --git a/sys/ofed/drivers/net/mlx4/en_tx.c b/sys/ofed/drivers/net/mlx4/en_tx.c index 4d1690f8da0e..e2e13c2fdcc4 100644 --- a/sys/ofed/drivers/net/mlx4/en_tx.c +++ b/sys/ofed/drivers/net/mlx4/en_tx.c @@ -725,7 +725,7 @@ static int mlx4_en_xmit(struct net_device *dev, int tx_ind, struct mbuf **mbp) nr_txbb = desc_size / TXBB_SIZE; if (unlikely(nr_txbb > MAX_DESC_TXBBS)) { if (defrag) { - mb = m_defrag(*mbp, M_DONTWAIT); + mb = m_defrag(*mbp, M_NOWAIT); if (mb == NULL) { mb = *mbp; goto tx_drop; diff --git a/sys/pci/if_rl.c b/sys/pci/if_rl.c index 11c20a3e2d18..98e3352c0298 100644 --- a/sys/pci/if_rl.c +++ b/sys/pci/if_rl.c @@ -1565,7 +1565,7 @@ rl_encap(struct rl_softc *sc, struct mbuf **m_head) */ if (m->m_next != NULL || (mtod(m, uintptr_t) & 3) != 0 || (padlen > 0 && M_TRAILINGSPACE(m) < padlen)) { - m = m_defrag(*m_head, M_DONTWAIT); + m = m_defrag(*m_head, M_NOWAIT); if (m == NULL) { m_freem(*m_head); *m_head = NULL; diff --git a/sys/powerpc/ps3/if_glc.c b/sys/powerpc/ps3/if_glc.c index ab5c17279923..178821221c84 100644 --- a/sys/powerpc/ps3/if_glc.c +++ b/sys/powerpc/ps3/if_glc.c @@ -555,7 +555,7 @@ glc_add_rxbuf(struct glc_softc *sc, int idx) bus_dma_segment_t segs[1]; int error, nsegs; - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) return (ENOBUFS); m->m_len = m->m_pkthdr.len = m->m_ext.ext_size; @@ -630,7 +630,7 @@ glc_encap(struct glc_softc *sc, struct mbuf **m_head, bus_addr_t *pktdesc) nsegs++; if (nsegs > nsegs_max) { - m = m_collapse(*m_head, M_DONTWAIT, nsegs_max); + m = m_collapse(*m_head, M_NOWAIT, nsegs_max); if (m == NULL) { m_freem(*m_head); *m_head = NULL; diff --git a/sys/rpc/clnt_dg.c b/sys/rpc/clnt_dg.c index c86b18a904d0..86a8d01ee63e 100644 --- a/sys/rpc/clnt_dg.c +++ b/sys/rpc/clnt_dg.c @@ -431,7 +431,7 @@ clnt_dg_call( send_again: mtx_unlock(&cs->cs_lock); - MGETHDR(mreq, M_WAIT, MT_DATA); + MGETHDR(mreq, 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; diff --git a/sys/rpc/clnt_vc.c b/sys/rpc/clnt_vc.c index 26f23fa1c864..6655e6e7da95 100644 --- a/sys/rpc/clnt_vc.c +++ b/sys/rpc/clnt_vc.c @@ -386,7 +386,7 @@ clnt_vc_call( /* * Leave space to pre-pend the record mark. */ - MGETHDR(mreq, M_WAIT, MT_DATA); + MGETHDR(mreq, M_WAITOK, MT_DATA); mreq->m_data += sizeof(uint32_t); KASSERT(ct->ct_mpos + sizeof(uint32_t) <= MHLEN, ("RPC header too big")); @@ -414,7 +414,7 @@ clnt_vc_call( /* * Prepend a record marker containing the packet length. */ - M_PREPEND(mreq, sizeof(uint32_t), M_WAIT); + M_PREPEND(mreq, sizeof(uint32_t), M_WAITOK); *mtod(mreq, uint32_t *) = htonl(0x80000000 | (mreq->m_pkthdr.len - sizeof(uint32_t))); diff --git a/sys/rpc/rpc_generic.c b/sys/rpc/rpc_generic.c index 6adae3839912..65f57cf2e35c 100644 --- a/sys/rpc/rpc_generic.c +++ b/sys/rpc/rpc_generic.c @@ -750,8 +750,8 @@ clnt_call_private( struct mbuf *mrep; enum clnt_stat stat; - MGET(mreq, M_WAIT, MT_DATA); - MCLGET(mreq, M_WAIT); + MGET(mreq, M_WAITOK, MT_DATA); + MCLGET(mreq, M_WAITOK); mreq->m_len = 0; xdrmbuf_create(&xdrs, mreq, XDR_ENCODE); diff --git a/sys/rpc/rpcm_subs.h b/sys/rpc/rpcm_subs.h index ac789f3c593a..f0d60a3d6ebc 100644 --- a/sys/rpc/rpcm_subs.h +++ b/sys/rpc/rpcm_subs.h @@ -80,7 +80,7 @@ #define rpcm_build(a,c,s) \ { if ((s) > M_TRAILINGSPACE(mb)) { \ - MGET(mb2, M_WAIT, MT_DATA); \ + MGET(mb2, M_WAITOK, MT_DATA); \ if ((s) > MLEN) \ panic("build > MLEN"); \ mb->m_next = mb2; \ diff --git a/sys/rpc/rpcsec_gss/rpcsec_gss_prot.c b/sys/rpc/rpcsec_gss/rpcsec_gss_prot.c index 91112a1aa675..a50c4fa98d18 100644 --- a/sys/rpc/rpcsec_gss/rpcsec_gss_prot.c +++ b/sys/rpc/rpcsec_gss/rpcsec_gss_prot.c @@ -107,7 +107,7 @@ put_uint32(struct mbuf **mp, uint32_t v) struct mbuf *m = *mp; uint32_t n; - M_PREPEND(m, sizeof(uint32_t), M_WAIT); + M_PREPEND(m, sizeof(uint32_t), M_WAITOK); n = htonl(v); bcopy(&n, mtod(m, uint32_t *), sizeof(uint32_t)); *mp = m; @@ -241,7 +241,7 @@ xdr_rpc_gss_unwrap_data(struct mbuf **resultsp, */ len = get_uint32(&results); message = results; - results = m_split(results, len, M_WAIT); + results = m_split(results, len, M_WAITOK); if (!results) { m_freem(message); return (FALSE); diff --git a/sys/rpc/svc.c b/sys/rpc/svc.c index 16e911aba62b..f038e783c04e 100644 --- a/sys/rpc/svc.c +++ b/sys/rpc/svc.c @@ -563,8 +563,8 @@ 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_WAIT, MT_DATA); - MCLGET(m, M_WAIT); + MGET(m, M_WAITOK, MT_DATA); + MCLGET(m, M_WAITOK); m->m_len = 0; xdrmbuf_create(&xdrs, m, XDR_ENCODE); ok = xdr_results(&xdrs, xdr_location); diff --git a/sys/rpc/svc_dg.c b/sys/rpc/svc_dg.c index adfe2b51f87c..ba6a56e1c700 100644 --- a/sys/rpc/svc_dg.c +++ b/sys/rpc/svc_dg.c @@ -238,7 +238,7 @@ svc_dg_reply(SVCXPRT *xprt, struct rpc_msg *msg, bool_t stat = TRUE; int error; - MGETHDR(mrep, M_WAIT, MT_DATA); + MGETHDR(mrep, M_WAITOK, MT_DATA); mrep->m_len = 0; xdrmbuf_create(&xdrs, mrep, XDR_ENCODE); diff --git a/sys/rpc/svc_vc.c b/sys/rpc/svc_vc.c index fddcf586a08e..ca8239bae6ea 100644 --- a/sys/rpc/svc_vc.c +++ b/sys/rpc/svc_vc.c @@ -572,7 +572,7 @@ svc_vc_recv(SVCXPRT *xprt, struct rpc_msg *msg, if (cd->mpending->m_next || cd->mpending->m_len > cd->resid) cd->mpending = m_split(cd->mpending, - cd->resid, M_WAIT); + cd->resid, M_WAITOK); else cd->mpending = NULL; if (cd->mreq) @@ -691,7 +691,7 @@ svc_vc_reply(SVCXPRT *xprt, struct rpc_msg *msg, /* * Leave space for record mark. */ - MGETHDR(mrep, M_WAIT, MT_DATA); + MGETHDR(mrep, M_WAITOK, MT_DATA); mrep->m_len = 0; mrep->m_data += sizeof(uint32_t); @@ -713,7 +713,7 @@ svc_vc_reply(SVCXPRT *xprt, struct rpc_msg *msg, /* * Prepend a record marker containing the reply length. */ - M_PREPEND(mrep, sizeof(uint32_t), M_WAIT); + M_PREPEND(mrep, sizeof(uint32_t), M_WAITOK); *mtod(mrep, uint32_t *) = htonl(0x80000000 | (mrep->m_pkthdr.len - sizeof(uint32_t))); diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h index 0d0b0d054919..6444b078bef1 100644 --- a/sys/sys/mbuf.h +++ b/sys/sys/mbuf.h @@ -346,18 +346,7 @@ struct mbstat { }; /* - * Flags specifying how an allocation should be made. - * - * The flag to use is as follows: - * - M_NOWAIT (M_DONTWAIT) from an interrupt handler to not block allocation. - * - M_WAITOK (M_WAIT) from wherever it is safe to block. - * - * M_DONTWAIT/M_NOWAIT means that we will not block the thread explicitly and - * if we cannot allocate immediately we may return NULL, whereas - * M_WAIT/M_WAITOK means that if we cannot allocate resources we - * will block until they are available, and thus never return NULL. - * - * XXX Eventually just phase this out to use M_WAITOK/M_NOWAIT. + * Compatibility with historic mbuf allocator. */ #define MBTOM(how) (how) #define M_DONTWAIT M_NOWAIT @@ -865,7 +854,7 @@ m_last(struct mbuf *m) #define M_COPYALL 1000000000 /* Compatibility with 4.3. */ -#define m_copy(m, o, l) m_copym((m), (o), (l), M_DONTWAIT) +#define m_copy(m, o, l) m_copym((m), (o), (l), M_NOWAIT) extern int max_datalen; /* MHLEN - max_hdr */ extern int max_hdr; /* Largest link + protocol header */