summaryrefslogtreecommitdiffstats
path: root/sys/netatalk
diff options
context:
space:
mode:
authorbmilekic <bmilekic@FreeBSD.org>2000-12-21 21:44:31 +0000
committerbmilekic <bmilekic@FreeBSD.org>2000-12-21 21:44:31 +0000
commit4b6a7bddad70a11b35893cc1825a768e53fb28c7 (patch)
treecb3615d12a5b91954bedb7d2b4481c994b02b3d6 /sys/netatalk
parent37eea88efd33920c8d4ef7e41923db5d5eec76cf (diff)
downloadFreeBSD-src-4b6a7bddad70a11b35893cc1825a768e53fb28c7.zip
FreeBSD-src-4b6a7bddad70a11b35893cc1825a768e53fb28c7.tar.gz
* Rename M_WAIT mbuf subsystem flag to M_TRYWAIT.
This is because calls with M_WAIT (now M_TRYWAIT) may not wait forever when nothing is available for allocation, and may end up returning NULL. Hopefully we now communicate more of the right thing to developers and make it very clear that it's necessary to check whether calls with M_(TRY)WAIT also resulted in a failed allocation. M_TRYWAIT basically means "try harder, block if necessary, but don't necessarily wait forever." The time spent blocking is tunable with the kern.ipc.mbuf_wait sysctl. M_WAIT is now deprecated but still defined for the next little while. * Fix a typo in a comment in mbuf.h * Fix some code that was actually passing the mbuf subsystem's M_WAIT to malloc(). Made it pass M_WAITOK instead. If we were ever to redefine the value of the M_WAIT flag, this could have became a big problem.
Diffstat (limited to 'sys/netatalk')
-rw-r--r--sys/netatalk/aarp.c4
-rw-r--r--sys/netatalk/ddp_output.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/sys/netatalk/aarp.c b/sys/netatalk/aarp.c
index e5aa7c6..0493870 100644
--- a/sys/netatalk/aarp.c
+++ b/sys/netatalk/aarp.c
@@ -161,7 +161,7 @@ aarpwhohas( struct arpcom *ac, struct sockaddr_at *sat )
bcopy((caddr_t)atmulticastaddr, (caddr_t)eh->ether_dhost,
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_TRYWAIT );
llc = mtod( m, struct llc *);
llc->llc_dsap = llc->llc_ssap = LLC_SNAP_LSAP;
llc->llc_control = LLC_UI;
@@ -571,7 +571,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_TRYWAIT );
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 66e20df..3d48fd2 100644
--- a/sys/netatalk/ddp_output.c
+++ b/sys/netatalk/ddp_output.c
@@ -48,7 +48,7 @@ ddp_output( struct mbuf *m, struct socket *so)
struct ddpehdr *deh;
struct ddpcb *ddp = sotoddpcb( so );
- M_PREPEND( m, sizeof( struct ddpehdr ), M_WAIT );
+ M_PREPEND( m, sizeof( struct ddpehdr ), M_TRYWAIT );
deh = mtod( m, struct ddpehdr *);
deh->deh_pad = 0;
@@ -189,7 +189,7 @@ ddp_route( struct mbuf *m, struct route *ro)
* packets end up poorly aligned due to the three byte elap header.
*/
if ( !(aa->aa_flags & AFA_PHASE2) ) {
- MGET( m0, M_WAIT, MT_HEADER );
+ MGET( m0, M_TRYWAIT, MT_HEADER );
if ( m0 == 0 ) {
m_freem( m );
printf("ddp_route: no buffers\n");
OpenPOWER on IntegriCloud