diff options
author | bmilekic <bmilekic@FreeBSD.org> | 2000-12-21 21:44:31 +0000 |
---|---|---|
committer | bmilekic <bmilekic@FreeBSD.org> | 2000-12-21 21:44:31 +0000 |
commit | 4b6a7bddad70a11b35893cc1825a768e53fb28c7 (patch) | |
tree | cb3615d12a5b91954bedb7d2b4481c994b02b3d6 /sys/nfs/nfs_socket.c | |
parent | 37eea88efd33920c8d4ef7e41923db5d5eec76cf (diff) | |
download | FreeBSD-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/nfs/nfs_socket.c')
-rw-r--r-- | sys/nfs/nfs_socket.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/nfs/nfs_socket.c b/sys/nfs/nfs_socket.c index f1ace4e..fefeea8 100644 --- a/sys/nfs/nfs_socket.c +++ b/sys/nfs/nfs_socket.c @@ -590,7 +590,7 @@ tryagain: goto tryagain; } while (rep->r_flags & R_MUSTRESEND) { - m = m_copym(rep->r_mreq, 0, M_COPYALL, M_WAIT); + m = m_copym(rep->r_mreq, 0, M_COPYALL, M_TRYWAIT); nfsstats.rpcretries++; error = nfs_send(so, rep->r_nmp->nm_nam, m, rep); if (error) { @@ -1014,7 +1014,7 @@ kerbauth: * For stream protocols, insert a Sun RPC Record Mark. */ if (nmp->nm_sotype == SOCK_STREAM) { - M_PREPEND(m, NFSX_UNSIGNED, M_WAIT); + M_PREPEND(m, NFSX_UNSIGNED, M_TRYWAIT); *mtod(m, u_int32_t *) = htonl(0x80000000 | (m->m_pkthdr.len - NFSX_UNSIGNED)); } @@ -1058,7 +1058,7 @@ tryagain: if (nmp->nm_soflags & PR_CONNREQUIRED) error = nfs_sndlock(rep); if (!error) { - m2 = m_copym(m, 0, M_COPYALL, M_WAIT); + m2 = m_copym(m, 0, M_COPYALL, M_TRYWAIT); error = nfs_send(nmp->nm_so, nmp->nm_nam, m2, rep); if (nmp->nm_soflags & PR_CONNREQUIRED) nfs_sndunlock(rep); @@ -1237,7 +1237,7 @@ nfs_rephead(siz, nd, slp, err, cache, frev, mrq, mbp, bposp) caddr_t bpos; struct mbuf *mb, *mb2; - MGETHDR(mreq, M_WAIT, MT_DATA); + MGETHDR(mreq, M_TRYWAIT, MT_DATA); mb = mreq; /* * If this is a big reply, use a cluster else @@ -1245,7 +1245,7 @@ nfs_rephead(siz, nd, slp, err, cache, frev, mrq, mbp, bposp) */ siz += RPC_REPLYSIZ; if ((max_hdr + siz) >= MINCLSIZE) { - MCLGET(mreq, M_WAIT); + MCLGET(mreq, M_TRYWAIT); } else mreq->m_data += max_hdr; tl = mtod(mreq, u_int32_t *); @@ -1686,9 +1686,9 @@ nfs_realign(pm, hsiz) while ((m = *pm) != NULL) { if ((m->m_len & 0x3) || (mtod(m, intptr_t) & 0x3)) { - MGET(n, M_WAIT, MT_DATA); + MGET(n, M_TRYWAIT, MT_DATA); if (m->m_len >= MINCLSIZE) { - MCLGET(n, M_WAIT); + MCLGET(n, M_TRYWAIT); } n->m_len = 0; break; @@ -1978,7 +1978,7 @@ nfs_msg(p, server, msg) * Socket upcall routine for the nfsd sockets. * The caddr_t arg is a pointer to the "struct nfssvc_sock". * Essentially do as much as possible non-blocking, else punt and it will - * be called with M_WAIT from an nfsd. + * be called with M_TRYWAIT from an nfsd. */ void nfsrv_rcv(so, arg, waitflag) |