summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorarchie <archie@FreeBSD.org>2000-09-21 18:01:23 +0000
committerarchie <archie@FreeBSD.org>2000-09-21 18:01:23 +0000
commit1023c32e1a3679b96f5d97f326b05c06529b214c (patch)
treed5267989f77e49fdb5fc4a6aa641c0b91e4bf969
parent2ecfa84ffe04f743aceb5489b27662b68b563e18 (diff)
downloadFreeBSD-src-1023c32e1a3679b96f5d97f326b05c06529b214c.zip
FreeBSD-src-1023c32e1a3679b96f5d97f326b05c06529b214c.tar.gz
Allocate all memory (including within node constructors) with M_NOWAIT
instead of M_WAITOK, to allow for maximum flexibility.
-rw-r--r--sys/netgraph/ng_UI.c2
-rw-r--r--sys/netgraph/ng_async.c6
-rw-r--r--sys/netgraph/ng_bpf.c4
-rw-r--r--sys/netgraph/ng_cisco.c2
-rw-r--r--sys/netgraph/ng_iface.c6
-rw-r--r--sys/netgraph/ng_ksocket.c2
-rw-r--r--sys/netgraph/ng_lmi.c2
-rw-r--r--sys/netgraph/ng_mppc.c2
-rw-r--r--sys/netgraph/ng_ppp.c2
-rw-r--r--sys/netgraph/ng_pppoe.c6
-rw-r--r--sys/netgraph/ng_pptpgre.c2
-rw-r--r--sys/netgraph/ng_rfc1490.c2
-rw-r--r--sys/netgraph/ng_sample.c2
-rw-r--r--sys/netgraph/ng_tee.c2
-rw-r--r--sys/netgraph/ng_vjc.c2
15 files changed, 22 insertions, 22 deletions
diff --git a/sys/netgraph/ng_UI.c b/sys/netgraph/ng_UI.c
index 42d2bf7..0e695ac 100644
--- a/sys/netgraph/ng_UI.c
+++ b/sys/netgraph/ng_UI.c
@@ -108,7 +108,7 @@ ng_UI_constructor(node_p *nodep)
int error;
/* Allocate private structure */
- MALLOC(priv, priv_p, sizeof(*priv), M_NETGRAPH, M_WAITOK);
+ MALLOC(priv, priv_p, sizeof(*priv), M_NETGRAPH, M_NOWAIT);
if (priv == NULL)
return (ENOMEM);
bzero(priv, sizeof(*priv));
diff --git a/sys/netgraph/ng_async.c b/sys/netgraph/ng_async.c
index 83f8b27..b3bd9f79 100644
--- a/sys/netgraph/ng_async.c
+++ b/sys/netgraph/ng_async.c
@@ -184,7 +184,7 @@ nga_constructor(node_p *nodep)
if ((error = ng_make_node_common(&typestruct, nodep)))
return (error);
- MALLOC(sc, sc_p, sizeof(*sc), M_NETGRAPH, M_WAITOK);
+ MALLOC(sc, sc_p, sizeof(*sc), M_NETGRAPH, M_NOWAIT);
if (sc == NULL)
return (ENOMEM);
bzero(sc, sizeof(*sc));
@@ -193,11 +193,11 @@ nga_constructor(node_p *nodep)
sc->cfg.amru = NG_ASYNC_DEFAULT_MRU;
sc->cfg.smru = NG_ASYNC_DEFAULT_MRU;
MALLOC(sc->abuf, u_char *,
- ASYNC_BUF_SIZE(sc->cfg.smru), M_NETGRAPH, M_WAITOK);
+ ASYNC_BUF_SIZE(sc->cfg.smru), M_NETGRAPH, M_NOWAIT);
if (sc->abuf == NULL)
goto fail;
MALLOC(sc->sbuf, u_char *,
- SYNC_BUF_SIZE(sc->cfg.amru), M_NETGRAPH, M_WAITOK);
+ SYNC_BUF_SIZE(sc->cfg.amru), M_NETGRAPH, M_NOWAIT);
if (sc->sbuf == NULL) {
FREE(sc->abuf, M_NETGRAPH);
fail:
diff --git a/sys/netgraph/ng_bpf.c b/sys/netgraph/ng_bpf.c
index c198b11..f986e8f 100644
--- a/sys/netgraph/ng_bpf.c
+++ b/sys/netgraph/ng_bpf.c
@@ -237,7 +237,7 @@ ng_bpf_newhook(node_p node, hook_p hook, const char *name)
int error;
/* Create hook private structure */
- MALLOC(hip, hinfo_p, sizeof(*hip), M_NETGRAPH, M_WAITOK);
+ MALLOC(hip, hinfo_p, sizeof(*hip), M_NETGRAPH, M_NOWAIT);
if (hip == NULL)
return (ENOMEM);
bzero(hip, sizeof(*hip));
@@ -489,7 +489,7 @@ ng_bpf_setprog(hook_p hook, const struct ng_bpf_hookprog *hp0)
/* Make a copy of the program */
size = NG_BPF_HOOKPROG_SIZE(hp0->bpf_prog_len);
- MALLOC(hp, struct ng_bpf_hookprog *, size, M_NETGRAPH, M_WAITOK);
+ MALLOC(hp, struct ng_bpf_hookprog *, size, M_NETGRAPH, M_NOWAIT);
if (hp == NULL)
return (ENOMEM);
bcopy(hp0, hp, size);
diff --git a/sys/netgraph/ng_cisco.c b/sys/netgraph/ng_cisco.c
index 0819169..4b62412 100644
--- a/sys/netgraph/ng_cisco.c
+++ b/sys/netgraph/ng_cisco.c
@@ -196,7 +196,7 @@ cisco_constructor(node_p *nodep)
sc_p sc;
int error = 0;
- MALLOC(sc, sc_p, sizeof(*sc), M_NETGRAPH, M_WAITOK);
+ MALLOC(sc, sc_p, sizeof(*sc), M_NETGRAPH, M_NOWAIT);
if (sc == NULL)
return (ENOMEM);
bzero(sc, sizeof(struct cisco_priv));
diff --git a/sys/netgraph/ng_iface.c b/sys/netgraph/ng_iface.c
index f67d431..ecd1749 100644
--- a/sys/netgraph/ng_iface.c
+++ b/sys/netgraph/ng_iface.c
@@ -282,7 +282,7 @@ ng_iface_get_unit(int *unit)
newlen = (2 * ng_iface_units_len) + 4;
MALLOC(newarray, int *, newlen * sizeof(*ng_iface_units),
- M_NETGRAPH, M_WAITOK);
+ M_NETGRAPH, M_NOWAIT);
if (newarray == NULL)
return (ENOMEM);
bcopy(ng_iface_units, newarray,
@@ -531,11 +531,11 @@ ng_iface_constructor(node_p *nodep)
int error = 0;
/* Allocate node and interface private structures */
- MALLOC(priv, priv_p, sizeof(*priv), M_NETGRAPH, M_WAITOK);
+ MALLOC(priv, priv_p, sizeof(*priv), M_NETGRAPH, M_NOWAIT);
if (priv == NULL)
return (ENOMEM);
bzero(priv, sizeof(*priv));
- MALLOC(ifp, struct ifnet *, sizeof(*ifp), M_NETGRAPH, M_WAITOK);
+ MALLOC(ifp, struct ifnet *, sizeof(*ifp), M_NETGRAPH, M_NOWAIT);
if (ifp == NULL) {
FREE(priv, M_NETGRAPH);
return (ENOMEM);
diff --git a/sys/netgraph/ng_ksocket.c b/sys/netgraph/ng_ksocket.c
index 7b2b759..03435b9 100644
--- a/sys/netgraph/ng_ksocket.c
+++ b/sys/netgraph/ng_ksocket.c
@@ -492,7 +492,7 @@ ng_ksocket_constructor(node_p *nodep)
int error;
/* Allocate private structure */
- MALLOC(priv, priv_p, sizeof(*priv), M_NETGRAPH, M_WAITOK);
+ MALLOC(priv, priv_p, sizeof(*priv), M_NETGRAPH, M_NOWAIT);
if (priv == NULL)
return (ENOMEM);
bzero(priv, sizeof(*priv));
diff --git a/sys/netgraph/ng_lmi.c b/sys/netgraph/ng_lmi.c
index 775c3b8..e8c1de1 100644
--- a/sys/netgraph/ng_lmi.c
+++ b/sys/netgraph/ng_lmi.c
@@ -190,7 +190,7 @@ nglmi_constructor(node_p *nodep)
sc_p sc;
int error = 0;
- MALLOC(sc, sc_p, sizeof(*sc), M_NETGRAPH, M_WAITOK);
+ MALLOC(sc, sc_p, sizeof(*sc), M_NETGRAPH, M_NOWAIT);
if (sc == NULL)
return (ENOMEM);
bzero(sc, sizeof(*sc));
diff --git a/sys/netgraph/ng_mppc.c b/sys/netgraph/ng_mppc.c
index 5ab6c90..489ef31 100644
--- a/sys/netgraph/ng_mppc.c
+++ b/sys/netgraph/ng_mppc.c
@@ -179,7 +179,7 @@ ng_mppc_constructor(node_p *nodep)
int error;
/* Allocate private structure */
- MALLOC(priv, priv_p, sizeof(*priv), M_NETGRAPH, M_WAITOK);
+ MALLOC(priv, priv_p, sizeof(*priv), M_NETGRAPH, M_NOWAIT);
if (priv == NULL)
return (ENOMEM);
bzero(priv, sizeof(*priv));
diff --git a/sys/netgraph/ng_ppp.c b/sys/netgraph/ng_ppp.c
index fbd29ec..124572d 100644
--- a/sys/netgraph/ng_ppp.c
+++ b/sys/netgraph/ng_ppp.c
@@ -357,7 +357,7 @@ ng_ppp_constructor(node_p *nodep)
int i, error;
/* Allocate private structure */
- MALLOC(priv, priv_p, sizeof(*priv), M_NETGRAPH, M_WAITOK);
+ MALLOC(priv, priv_p, sizeof(*priv), M_NETGRAPH, M_NOWAIT);
if (priv == NULL)
return (ENOMEM);
bzero(priv, sizeof(*priv));
diff --git a/sys/netgraph/ng_pppoe.c b/sys/netgraph/ng_pppoe.c
index a74db26..0d7f2d3 100644
--- a/sys/netgraph/ng_pppoe.c
+++ b/sys/netgraph/ng_pppoe.c
@@ -472,7 +472,7 @@ ng_pppoe_constructor(node_p *nodep)
AAA
/* Initialize private descriptor */
- MALLOC(privdata, priv_p, sizeof(*privdata), M_NETGRAPH, M_WAITOK);
+ MALLOC(privdata, priv_p, sizeof(*privdata), M_NETGRAPH, M_NOWAIT);
if (privdata == NULL)
return (ENOMEM);
bzero(privdata, sizeof(*privdata));
@@ -516,7 +516,7 @@ AAA
* The infrastructure has already checked that it's unique,
* so just allocate it and hook it in.
*/
- MALLOC(sp, sessp, sizeof(*sp), M_NETGRAPH, M_WAITOK);
+ MALLOC(sp, sessp, sizeof(*sp), M_NETGRAPH, M_NOWAIT);
if (sp == NULL) {
return (ENOMEM);
}
@@ -591,7 +591,7 @@ AAA
/*
* set up prototype header
*/
- MALLOC(neg, negp, sizeof(*neg), M_NETGRAPH, M_WAITOK);
+ MALLOC(neg, negp, sizeof(*neg), M_NETGRAPH, M_NOWAIT);
if (neg == NULL) {
printf("pppoe: Session out of memory\n");
diff --git a/sys/netgraph/ng_pptpgre.c b/sys/netgraph/ng_pptpgre.c
index feee658..689d7ed 100644
--- a/sys/netgraph/ng_pptpgre.c
+++ b/sys/netgraph/ng_pptpgre.c
@@ -280,7 +280,7 @@ ng_pptpgre_constructor(node_p *nodep)
int error;
/* Allocate private structure */
- MALLOC(priv, priv_p, sizeof(*priv), M_NETGRAPH, M_WAITOK);
+ MALLOC(priv, priv_p, sizeof(*priv), M_NETGRAPH, M_NOWAIT);
if (priv == NULL)
return (ENOMEM);
bzero(priv, sizeof(*priv));
diff --git a/sys/netgraph/ng_rfc1490.c b/sys/netgraph/ng_rfc1490.c
index bc7edb8..70e8210 100644
--- a/sys/netgraph/ng_rfc1490.c
+++ b/sys/netgraph/ng_rfc1490.c
@@ -126,7 +126,7 @@ ng_rfc1490_constructor(node_p *nodep)
int error;
/* Allocate private structure */
- MALLOC(priv, priv_p, sizeof(*priv), M_NETGRAPH, M_WAITOK);
+ MALLOC(priv, priv_p, sizeof(*priv), M_NETGRAPH, M_NOWAIT);
if (priv == NULL)
return (ENOMEM);
bzero(priv, sizeof(*priv));
diff --git a/sys/netgraph/ng_sample.c b/sys/netgraph/ng_sample.c
index 9b03060..92d29a0 100644
--- a/sys/netgraph/ng_sample.c
+++ b/sys/netgraph/ng_sample.c
@@ -152,7 +152,7 @@ ng_xxx_constructor(node_p *nodep)
int i, error;
/* Initialize private descriptor */
- MALLOC(privdata, xxx_p, sizeof(*privdata), M_NETGRAPH, M_WAITOK);
+ MALLOC(privdata, xxx_p, sizeof(*privdata), M_NETGRAPH, M_NOWAIT);
if (privdata == NULL)
return (ENOMEM);
bzero(privdata, sizeof(struct XXX));
diff --git a/sys/netgraph/ng_tee.c b/sys/netgraph/ng_tee.c
index 68dd2fe..797ddc9 100644
--- a/sys/netgraph/ng_tee.c
+++ b/sys/netgraph/ng_tee.c
@@ -153,7 +153,7 @@ ngt_constructor(node_p *nodep)
sc_p privdata;
int error = 0;
- MALLOC(privdata, sc_p, sizeof(*privdata), M_NETGRAPH, M_WAITOK);
+ MALLOC(privdata, sc_p, sizeof(*privdata), M_NETGRAPH, M_NOWAIT);
if (privdata == NULL)
return (ENOMEM);
bzero(privdata, sizeof(*privdata));
diff --git a/sys/netgraph/ng_vjc.c b/sys/netgraph/ng_vjc.c
index e3efc17..381203f 100644
--- a/sys/netgraph/ng_vjc.c
+++ b/sys/netgraph/ng_vjc.c
@@ -252,7 +252,7 @@ ng_vjc_constructor(node_p *nodep)
int error;
/* Allocate private structure */
- MALLOC(priv, priv_p, sizeof(*priv), M_NETGRAPH, M_WAITOK);
+ MALLOC(priv, priv_p, sizeof(*priv), M_NETGRAPH, M_NOWAIT);
if (priv == NULL)
return (ENOMEM);
bzero(priv, sizeof(*priv));
OpenPOWER on IntegriCloud