diff options
author | ru <ru@FreeBSD.org> | 2008-03-25 09:39:02 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2008-03-25 09:39:02 +0000 |
commit | 3b1bf8c2e9222b7d27e8b9084e637a84005de7ba (patch) | |
tree | cf0376c9359f2d1ca6e4e8e4ad4a4f722dba61a7 /sys/nfsserver | |
parent | 0655a583e2ccba8b534e710284a730a0d6af1375 (diff) | |
download | FreeBSD-src-3b1bf8c2e9222b7d27e8b9084e637a84005de7ba.zip FreeBSD-src-3b1bf8c2e9222b7d27e8b9084e637a84005de7ba.tar.gz |
Replaced the misleading uses of a historical artefact M_TRYWAIT with M_WAIT.
Removed dead code that assumed that M_TRYWAIT can return NULL; it's not true
since the advent of MBUMA.
Reviewed by: arch
There are ongoing disputes as to whether we want to switch to directly using
UMA flags M_WAITOK/M_NOWAIT for mbuf(9) allocation.
Diffstat (limited to 'sys/nfsserver')
-rw-r--r-- | sys/nfsserver/nfs_serv.c | 8 | ||||
-rw-r--r-- | sys/nfsserver/nfs_srvcache.c | 4 | ||||
-rw-r--r-- | sys/nfsserver/nfs_srvsock.c | 10 | ||||
-rw-r--r-- | sys/nfsserver/nfs_srvsubs.c | 4 | ||||
-rw-r--r-- | sys/nfsserver/nfs_syscalls.c | 4 |
5 files changed, 15 insertions, 15 deletions
diff --git a/sys/nfsserver/nfs_serv.c b/sys/nfsserver/nfs_serv.c index 67a0a7f..04f743a 100644 --- a/sys/nfsserver/nfs_serv.c +++ b/sys/nfsserver/nfs_serv.c @@ -686,8 +686,8 @@ nfsrv_readlink(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, len = 0; i = 0; while (len < NFS_MAXPATHLEN) { - MGET(nmp, M_TRYWAIT, MT_DATA); - MCLGET(nmp, M_TRYWAIT); + MGET(nmp, M_WAIT, MT_DATA); + MCLGET(nmp, M_WAIT); nmp->m_len = NFSMSIZ(nmp); if (len == 0) mp3 = mp = nmp; @@ -935,8 +935,8 @@ nfsrv_read(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, i++; } if (left > 0) { - MGET(m, M_TRYWAIT, MT_DATA); - MCLGET(m, M_TRYWAIT); + MGET(m, M_WAIT, MT_DATA); + MCLGET(m, M_WAIT); m->m_len = 0; m2->m_next = m; m2 = m; diff --git a/sys/nfsserver/nfs_srvcache.c b/sys/nfsserver/nfs_srvcache.c index ca6b8c2..a0f272b 100644 --- a/sys/nfsserver/nfs_srvcache.c +++ b/sys/nfsserver/nfs_srvcache.c @@ -227,7 +227,7 @@ loop: nfsrvstats.srvcache_nonidemdonehits++; NFSD_UNLOCK(); *repp = m_copym(rp->rc_reply, 0, M_COPYALL, - M_TRYWAIT); + M_WAIT); NFSD_LOCK(); ret = RC_REPLY; } else { @@ -348,7 +348,7 @@ loop: } else { NFSD_UNLOCK(); rp->rc_reply = m_copym(repmbuf, - 0, M_COPYALL, M_TRYWAIT); + 0, M_COPYALL, M_WAIT); NFSD_LOCK(); rp->rc_flag |= RC_REPMBUF; } diff --git a/sys/nfsserver/nfs_srvsock.c b/sys/nfsserver/nfs_srvsock.c index 1a7f91b..6df5998 100644 --- a/sys/nfsserver/nfs_srvsock.c +++ b/sys/nfsserver/nfs_srvsock.c @@ -148,7 +148,7 @@ nfs_rephead(int siz, struct nfsrv_descript *nd, int err, nd->nd_repstat = err; if (err && (nd->nd_flag & ND_NFSV3) == 0) /* XXX recheck */ siz = 0; - MGETHDR(mreq, M_TRYWAIT, MT_DATA); + MGETHDR(mreq, M_WAIT, MT_DATA); mb = mreq; /* * If this is a big reply, use a cluster else @@ -157,7 +157,7 @@ nfs_rephead(int siz, struct nfsrv_descript *nd, int err, mreq->m_len = 6 * NFSX_UNSIGNED; siz += RPC_REPLYSIZ; if ((max_hdr + siz) >= MINCLSIZE) { - MCLGET(mreq, M_TRYWAIT); + MCLGET(mreq, M_WAIT); } else mreq->m_data += min(max_hdr, M_TRAILINGSPACE(mreq)); tl = mtod(mreq, u_int32_t *); @@ -244,9 +244,9 @@ nfs_realign(struct mbuf **pm, int hsiz) /* XXX COMMON */ ++nfs_realign_test; while ((m = *pm) != NULL) { if ((m->m_len & 0x3) || (mtod(m, intptr_t) & 0x3)) { - MGET(n, M_TRYWAIT, MT_DATA); + MGET(n, M_WAIT, MT_DATA); if (m->m_len >= MINCLSIZE) { - MCLGET(n, M_TRYWAIT); + MCLGET(n, M_WAIT); } n->m_len = 0; break; @@ -401,7 +401,7 @@ nfsmout: * 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_TRYWAIT from an nfsd. + * be called with M_WAIT from an nfsd. */ void nfsrv_rcv(struct socket *so, void *arg, int waitflag) diff --git a/sys/nfsserver/nfs_srvsubs.c b/sys/nfsserver/nfs_srvsubs.c index 6db52b6..9fa702c 100644 --- a/sys/nfsserver/nfs_srvsubs.c +++ b/sys/nfsserver/nfs_srvsubs.c @@ -1352,8 +1352,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_TRYWAIT, MT_DATA); - MCLGET(nmp, M_TRYWAIT); + MGET(nmp, M_WAIT, MT_DATA); + MCLGET(nmp, M_WAIT); nmp->m_len = NFSMSIZ(nmp); (*mp)->m_next = nmp; *mp = nmp; diff --git a/sys/nfsserver/nfs_syscalls.c b/sys/nfsserver/nfs_syscalls.c index 3043fcd..52ba9d9 100644 --- a/sys/nfsserver/nfs_syscalls.c +++ b/sys/nfsserver/nfs_syscalls.c @@ -351,7 +351,7 @@ nfssvc_nfsd(struct thread *td) (void) nfs_slplock(slp, 1); NFSD_UNLOCK(); nfsrv_rcv(slp->ns_so, (caddr_t)slp, - M_TRYWAIT); + M_WAIT); NFSD_LOCK(); nfs_slpunlock(slp); } @@ -489,7 +489,7 @@ nfssvc_nfsd(struct thread *td) * Record Mark. */ if (sotype == SOCK_STREAM) { - M_PREPEND(m, NFSX_UNSIGNED, M_TRYWAIT); + M_PREPEND(m, NFSX_UNSIGNED, M_WAIT); *mtod(m, u_int32_t *) = htonl(0x80000000 | siz); } NFSD_LOCK(); |