From cf874b345d0f766fb64cf4737e1c85ccc78d2bee Mon Sep 17 00:00:00 2001 From: imp Date: Wed, 19 Feb 2003 05:47:46 +0000 Subject: Back out M_* changes, per decision of the TRB. Approved by: trb --- sys/nfsserver/nfs_serv.c | 20 ++++++++++---------- sys/nfsserver/nfs_srvcache.c | 6 +++--- sys/nfsserver/nfs_srvsock.c | 18 +++++++++--------- sys/nfsserver/nfs_srvsubs.c | 10 +++++----- sys/nfsserver/nfs_syscalls.c | 12 ++++++------ 5 files changed, 33 insertions(+), 33 deletions(-) (limited to 'sys/nfsserver') diff --git a/sys/nfsserver/nfs_serv.c b/sys/nfsserver/nfs_serv.c index 322b1d4..1d953cd 100644 --- a/sys/nfsserver/nfs_serv.c +++ b/sys/nfsserver/nfs_serv.c @@ -656,8 +656,8 @@ nfsrv_readlink(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, len = 0; i = 0; while (len < NFS_MAXPATHLEN) { - MGET(nmp, 0, MT_DATA); - MCLGET(nmp, 0); + MGET(nmp, M_TRYWAIT, MT_DATA); + MCLGET(nmp, M_TRYWAIT); nmp->m_len = NFSMSIZ(nmp); if (len == 0) mp3 = mp = nmp; @@ -899,15 +899,15 @@ nfsrv_read(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, i++; } if (left > 0) { - MGET(m, 0, MT_DATA); - MCLGET(m, 0); + MGET(m, M_TRYWAIT, MT_DATA); + MCLGET(m, M_TRYWAIT); m->m_len = 0; m2->m_next = m; m2 = m; } } MALLOC(iv, struct iovec *, i * sizeof (struct iovec), - M_TEMP, 0); + M_TEMP, M_WAITOK); uiop->uio_iov = iv2 = iv; m = mb; left = len; @@ -1107,7 +1107,7 @@ nfsrv_write(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, if (len > 0) { MALLOC(ivp, struct iovec *, cnt * sizeof (struct iovec), M_TEMP, - 0); + M_WAITOK); uiop->uio_iov = iv = ivp; uiop->uio_iovcnt = cnt; mp = mrep; @@ -1404,7 +1404,7 @@ loop1: } uiop->uio_iovcnt = i; MALLOC(iov, struct iovec *, i * sizeof (struct iovec), - M_TEMP, 0); + M_TEMP, M_WAITOK); uiop->uio_iov = ivp = iov; mp = mrep; while (mp) { @@ -2551,7 +2551,7 @@ nfsrv_symlink(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, if (v3) nfsm_srvsattr(vap); nfsm_srvpathsiz(len2); - MALLOC(pathcp, caddr_t, len2 + 1, M_TEMP, 0); + MALLOC(pathcp, caddr_t, len2 + 1, M_TEMP, M_WAITOK); iv.iov_base = pathcp; iv.iov_len = len2; io.uio_resid = len2; @@ -3059,7 +3059,7 @@ nfsrv_readdir(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, /* * end section. Allocate rbuf and continue */ - MALLOC(rbuf, caddr_t, siz, M_TEMP, 0); + MALLOC(rbuf, caddr_t, siz, M_TEMP, M_WAITOK); again: iv.iov_base = rbuf; iv.iov_len = fullsiz; @@ -3337,7 +3337,7 @@ nfsrv_readdirplus(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, goto nfsmout; } VOP_UNLOCK(vp, 0, td); - MALLOC(rbuf, caddr_t, siz, M_TEMP, 0); + MALLOC(rbuf, caddr_t, siz, M_TEMP, M_WAITOK); again: iv.iov_base = rbuf; iv.iov_len = fullsiz; diff --git a/sys/nfsserver/nfs_srvcache.c b/sys/nfsserver/nfs_srvcache.c index a9e84e9..1986c0b 100644 --- a/sys/nfsserver/nfs_srvcache.c +++ b/sys/nfsserver/nfs_srvcache.c @@ -193,7 +193,7 @@ loop: } else if (rp->rc_flag & RC_REPMBUF) { nfsrvstats.srvcache_nonidemdonehits++; *repp = m_copym(rp->rc_reply, 0, M_COPYALL, - 0); + M_TRYWAIT); ret = RC_REPLY; } else { nfsrvstats.srvcache_idemdonehits++; @@ -212,7 +212,7 @@ loop: NFS_DPF(RC, ("M%03x", nd->nd_retxid & 0xfff)); if (numnfsrvcache < desirednfsrvcache) { rp = (struct nfsrvcache *)malloc((u_long)sizeof *rp, - M_NFSD, M_ZERO); + M_NFSD, M_WAITOK | M_ZERO); numnfsrvcache++; rp->rc_flag = RC_LOCKED; } else { @@ -303,7 +303,7 @@ loop: rp->rc_flag |= RC_REPSTATUS; } else { rp->rc_reply = m_copym(repmbuf, - 0, M_COPYALL, 0); + 0, M_COPYALL, M_TRYWAIT); rp->rc_flag |= RC_REPMBUF; } } diff --git a/sys/nfsserver/nfs_srvsock.c b/sys/nfsserver/nfs_srvsock.c index e17e023..bf4e985 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, 0, MT_DATA); + MGETHDR(mreq, M_TRYWAIT, 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, 0); + MCLGET(mreq, M_TRYWAIT); } 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, 0, MT_DATA); + MGET(n, M_TRYWAIT, MT_DATA); if (m->m_len >= MINCLSIZE) { - MCLGET(n, 0); + MCLGET(n, M_TRYWAIT); } n->m_len = 0; break; @@ -403,7 +403,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 without M_NOWAIT from an nfsd. + * be called with M_TRYWAIT from an nfsd. */ void nfsrv_rcv(struct socket *so, void *arg, int waitflag) @@ -421,7 +421,7 @@ nfsrv_rcv(struct socket *so, void *arg, int waitflag) /* * Define this to test for nfsds handling this under heavy load. */ - if (waitflag == M_NOWAIT) { + if (waitflag == M_DONTWAIT) { slp->ns_flag |= SLP_NEEDQ; goto dorecs; } @@ -433,7 +433,7 @@ nfsrv_rcv(struct socket *so, void *arg, int waitflag) * to an nfsd so that there is feedback to the TCP layer that * the nfs servers are heavily loaded. */ - if (STAILQ_FIRST(&slp->ns_rec) && waitflag == M_NOWAIT) { + if (STAILQ_FIRST(&slp->ns_rec) && waitflag == M_DONTWAIT) { slp->ns_flag |= SLP_NEEDQ; goto dorecs; } @@ -509,7 +509,7 @@ nfsrv_rcv(struct socket *so, void *arg, int waitflag) * Now try and process the request records, non-blocking. */ dorecs: - if (waitflag == M_NOWAIT && + if (waitflag == M_DONTWAIT && (STAILQ_FIRST(&slp->ns_rec) || (slp->ns_flag & (SLP_NEEDQ | SLP_DISCONN)))) nfsrv_wakenfsd(slp); @@ -667,7 +667,7 @@ nfsrv_dorec(struct nfssvc_sock *slp, struct nfsd *nfsd, m = rec->nr_packet; free(rec, M_NFSRVDESC); MALLOC(nd, struct nfsrv_descript *, sizeof (struct nfsrv_descript), - M_NFSRVDESC, 0); + M_NFSRVDESC, M_WAITOK); nd->nd_md = nd->nd_mrep = m; nd->nd_nam2 = nam; nd->nd_dpos = mtod(m, caddr_t); diff --git a/sys/nfsserver/nfs_srvsubs.c b/sys/nfsserver/nfs_srvsubs.c index 9ad6af1..5ac51ad 100644 --- a/sys/nfsserver/nfs_srvsubs.c +++ b/sys/nfsserver/nfs_srvsubs.c @@ -605,7 +605,7 @@ nfs_namei(struct nameidata *ndp, fhandle_t *fhp, int len, *retdirp = NULL; cnp->cn_flags |= NOMACCHECK; - cnp->cn_pnbuf = uma_zalloc(namei_zone, 0); + cnp->cn_pnbuf = uma_zalloc(namei_zone, M_WAITOK); /* * Copy the name from the mbuf list to ndp->ni_pnbuf @@ -670,7 +670,7 @@ nfs_namei(struct nameidata *ndp, fhandle_t *fhp, int len, * Oh joy. For WebNFS, handle those pesky '%' escapes, * and the 'native path' indicator. */ - cp = uma_zalloc(namei_zone, 0); + cp = uma_zalloc(namei_zone, M_WAITOK); fromcp = cnp->cn_pnbuf; tocp = cp; if ((unsigned char)*fromcp >= WEBNFS_SPECCHAR_START) { @@ -779,7 +779,7 @@ nfs_namei(struct nameidata *ndp, fhandle_t *fhp, int len, goto badlink2; } if (ndp->ni_pathlen > 1) - cp = uma_zalloc(namei_zone, 0); + cp = uma_zalloc(namei_zone, M_WAITOK); else cp = cnp->cn_pnbuf; aiov.iov_base = cp; @@ -1287,8 +1287,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, 0, MT_DATA); - MCLGET(nmp, 0); + MGET(nmp, M_TRYWAIT, MT_DATA); + MCLGET(nmp, M_TRYWAIT); 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 b41a5f7..cf9bf90 100644 --- a/sys/nfsserver/nfs_syscalls.c +++ b/sys/nfsserver/nfs_syscalls.c @@ -262,7 +262,7 @@ nfssvc_addsock(struct file *fp, struct sockaddr *mynam, struct thread *td) slp = (struct nfssvc_sock *) malloc(sizeof (struct nfssvc_sock), M_NFSSVC, - M_ZERO); + M_WAITOK | M_ZERO); STAILQ_INIT(&slp->ns_rec); TAILQ_INSERT_TAIL(&nfssvc_sockhead, slp, ns_chain); @@ -301,7 +301,7 @@ nfssvc_nfsd(struct thread *td) writes_todo = 0; #endif nfsd = (struct nfsd *) - malloc(sizeof (struct nfsd), M_NFSD, M_ZERO); + malloc(sizeof (struct nfsd), M_NFSD, M_WAITOK | M_ZERO); s = splnet(); nfsd->nfsd_td = td; TAILQ_INSERT_TAIL(&nfsd_head, nfsd, nfsd_chain); @@ -345,7 +345,7 @@ nfssvc_nfsd(struct thread *td) slp->ns_flag &= ~SLP_NEEDQ; (void) nfs_slplock(slp, 1); nfsrv_rcv(slp->ns_so, (caddr_t)slp, - 0); + M_TRYWAIT); nfs_slpunlock(slp); } error = nfsrv_dorec(slp, nfsd, &nd); @@ -471,7 +471,7 @@ nfssvc_nfsd(struct thread *td) * Record Mark. */ if (sotype == SOCK_STREAM) { - M_PREPEND(m, NFSX_UNSIGNED, 0); + M_PREPEND(m, NFSX_UNSIGNED, M_TRYWAIT); *mtod(m, u_int32_t *) = htonl(0x80000000 | siz); } if (slp->ns_so->so_proto->pr_flags & PR_CONNREQUIRED) @@ -671,12 +671,12 @@ nfsrv_init(int terminating) #if 0 nfs_udpsock = (struct nfssvc_sock *) - malloc(sizeof (struct nfssvc_sock), M_NFSSVC, M_ZERO); + malloc(sizeof (struct nfssvc_sock), M_NFSSVC, M_WAITOK | M_ZERO); STAILQ_INIT(&nfs_udpsock->ns_rec); TAILQ_INSERT_HEAD(&nfssvc_sockhead, nfs_udpsock, ns_chain); nfs_cltpsock = (struct nfssvc_sock *) - malloc(sizeof (struct nfssvc_sock), M_NFSSVC, M_ZERO); + malloc(sizeof (struct nfssvc_sock), M_NFSSVC, M_WAITOK | M_ZERO); STAILQ_INIT(&nfs_cltpsock->ns_rec); TAILQ_INSERT_TAIL(&nfssvc_sockhead, nfs_cltpsock, ns_chain); #endif -- cgit v1.1