aboutsummaryrefslogtreecommitdiff
path: root/sys/netatalk
diff options
context:
space:
mode:
authorBosko Milekic <bmilekic@FreeBSD.org>2000-12-21 21:44:31 +0000
committerBosko Milekic <bmilekic@FreeBSD.org>2000-12-21 21:44:31 +0000
commit2a0c503e7afc6498157c35173896688a147efb34 (patch)
treeb06b70c0a77fed3143ac7cd4a373e0881af4a5fd /sys/netatalk
parentb3a120de36b969a34388149a816fd8b57317debe (diff)
downloadsrc-2a0c503e7afc6498157c35173896688a147efb34.tar.gz
src-2a0c503e7afc6498157c35173896688a147efb34.zip
* 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.
Notes
Notes: svn path=/head/; revision=70254
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 e5aa7c63192b..049387028003 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 66e20dfe6181..3d48fd25e3be 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");