Lines Matching refs:rep
146 nfs_connect(nmp, rep) in nfs_connect() argument
148 struct nfsreq *rep;
226 so->so_error == 0 && rep &&
227 (error = nfs_sigintr(nmp, rep, rep->r_procp)) != 0){
309 nfs_reconnect(rep) in nfs_reconnect() argument
310 struct nfsreq *rep; in nfs_reconnect()
313 struct nfsmount *nmp = rep->r_nmp;
317 while ((error = nfs_connect(nmp, rep)) != 0) {
367 nfs_send(so, nam, top, rep) in nfs_send() argument
371 struct nfsreq *rep;
376 if (rep) {
377 if (rep->r_flags & R_SOFTTERM) {
381 if ((so = rep->r_nmp->nm_so) == NULL) {
382 rep->r_flags |= R_MUSTRESEND;
386 rep->r_flags &= ~R_MUSTRESEND;
387 soflags = rep->r_nmp->nm_soflags;
402 if (rep) {
404 rep->r_nmp->nm_mountp->mnt_stat.f_mntfromname);
408 if (rep->r_flags & R_SOFTTERM)
411 rep->r_flags |= R_MUSTRESEND;
436 nfs_receive(rep, aname, mp) in nfs_receive() argument
437 struct nfsreq *rep; in nfs_receive()
456 sotype = rep->r_nmp->nm_sotype;
467 error = nfs_sndlock(&rep->r_nmp->nm_flag, rep);
480 if (rep->r_mrep || (rep->r_flags & R_SOFTTERM)) {
481 nfs_sndunlock(&rep->r_nmp->nm_flag);
484 so = rep->r_nmp->nm_so;
486 error = nfs_reconnect(rep);
488 nfs_sndunlock(&rep->r_nmp->nm_flag);
493 while (rep->r_flags & R_MUSTRESEND) {
494 m = m_copym(rep->r_mreq, 0, M_COPYALL, M_WAIT);
496 rep->r_rtt = 0;
497 rep->r_flags &= ~R_TIMING;
498 error = nfs_send(so, rep->r_nmp->nm_nam, m, rep);
501 (error = nfs_reconnect(rep)) != 0) {
502 nfs_sndunlock(&rep->r_nmp->nm_flag);
508 nfs_sndunlock(&rep->r_nmp->nm_flag);
523 if (error == EWOULDBLOCK && rep) {
524 if (rep->r_flags & R_SOFTTERM)
532 if (rep->r_rexmit >= rep->r_nmp->nm_retry) {
543 rep->r_nmp->nm_mountp->mnt_stat.f_mntfromname);
558 rep->r_nmp->nm_mountp->mnt_stat.f_mntfromname);
573 rep->r_nmp->nm_mountp->mnt_stat.f_mntfromname);
593 if (error == EWOULDBLOCK && rep) {
594 if (rep->r_flags & R_SOFTTERM)
613 rep->r_nmp->nm_mountp->mnt_stat.f_mntfromname);
614 error = nfs_sndlock(&rep->r_nmp->nm_flag, rep);
616 error = nfs_reconnect(rep);
619 nfs_sndunlock(&rep->r_nmp->nm_flag);
623 if ((so = rep->r_nmp->nm_so) == NULL)
636 (rep->r_flags & R_SOFTTERM))
665 struct nfsreq *rep; local
732 for (rep = TAILQ_FIRST(&nfs_reqq); rep != NULL;
733 rep = TAILQ_NEXT(rep, r_chain)) {
734 if (rep->r_mrep == NULL && rxid == rep->r_xid) {
736 rep->r_mrep = mrep;
737 rep->r_md = md;
738 rep->r_dpos = dpos;
743 rt->proc = rep->r_procnum;
744 rt->rto = NFS_RTO(nmp, proct[rep->r_procnum]);
747 rt->srtt = nmp->nm_srtt[proct[rep->r_procnum] - 1];
748 rt->sdrtt = nmp->nm_sdrtt[proct[rep->r_procnum] - 1];
751 if (rep->r_flags & R_TIMING)
752 rt->rtt = rep->r_rtt;
769 rep->r_flags &= ~R_SENT;
775 if (rep->r_flags & R_TIMING) {
784 t1 = rep->r_rtt + 1;
785 t1 -= (NFS_SRTT(rep) >> 3);
786 NFS_SRTT(rep) += t1;
789 t1 -= (NFS_SDRTT(rep) >> 2);
790 NFS_SDRTT(rep) += t1;
800 if (rep == 0) {
803 } else if (rep == myrep) {
804 if (rep->r_mrep == NULL)
835 struct nfsreq *rep; local
851 rep = pool_get(&nfsreqpl, PR_WAITOK);
852 rep->r_nmp = nmp;
853 rep->r_vp = vp;
854 rep->r_procp = procp;
855 rep->r_procnum = procnum;
876 error = nfs_getauth(nmp, rep, cred, &auth_str,
879 pool_put(&nfsreqpl, rep);
903 rep->r_mreq = m;
904 rep->r_xid = xid;
907 rep->r_retry = nmp->nm_retry;
909 rep->r_retry = NFS_MAXREXMIT + 1; /* past clip limit */
910 rep->r_rtt = rep->r_rexmit = 0;
912 rep->r_flags = R_TIMING;
914 rep->r_flags = 0;
915 rep->r_mrep = NULL;
926 TAILQ_INSERT_TAIL(&nfs_reqq, rep, r_chain);
941 error = nfs_sndlock(&nmp->nm_flag, rep);
945 rep);
949 if (!error && (rep->r_flags & R_MUSTRESEND) == 0) {
951 rep->r_flags |= R_SENT;
955 rep->r_rtt = -1;
962 error = nfs_reply(rep);
968 TAILQ_REMOVE(&nfs_reqq, rep, r_chain);
974 if (rep->r_flags & R_SENT) {
975 rep->r_flags &= ~R_SENT; /* paranoia */
983 if (!error && (rep->r_flags & R_TPRINTFMSG))
984 nfs_msg(rep->r_procp, nmp->nm_mountp->mnt_stat.f_mntfromname,
986 mrep = rep->r_mrep;
987 md = rep->r_md;
988 dpos = rep->r_dpos;
990 m_freem(rep->r_mreq);
991 pool_put(&nfsreqpl, rep);
1007 m_freem(rep->r_mreq);
1014 m_freem(rep->r_mreq);
1015 pool_put(&nfsreqpl, rep);
1063 m_freem(rep->r_mreq);
1064 pool_put(&nfsreqpl, rep);
1071 m_freem(rep->r_mreq);
1072 pool_put(&nfsreqpl, rep);
1078 m_freem(rep->r_mreq);
1079 pool_put(&nfsreqpl, rep);
1219 struct nfsreq *rep; local
1231 for (rep = TAILQ_FIRST(&nfs_reqq); rep != NULL;
1232 rep = TAILQ_NEXT(rep, r_chain)) {
1233 nmp = rep->r_nmp;
1234 if (rep->r_mrep || (rep->r_flags & R_SOFTTERM))
1236 if (nfs_sigintr(nmp, rep, rep->r_procp)) {
1237 rep->r_flags |= R_SOFTTERM;
1240 if (rep->r_rtt >= 0) {
1241 rep->r_rtt++;
1245 timeo = NFS_RTO(nmp, proct[rep->r_procnum]);
1248 if (rep->r_rtt <= timeo)
1256 if ((rep->r_flags & R_TPRINTFMSG) == 0 &&
1257 rep->r_rexmit > nmp->nm_deadthresh) {
1258 nfs_msg(rep->r_procp,
1261 rep->r_flags |= R_TPRINTFMSG;
1263 if (rep->r_rexmit >= rep->r_retry) { /* too many */
1265 rep->r_flags |= R_SOFTTERM;
1269 if (++rep->r_rexmit > NFS_MAXREXMIT)
1270 rep->r_rexmit = NFS_MAXREXMIT;
1281 rep->r_rtt = -1;
1282 if (sbspace(&so->so_snd) >= rep->r_mreq->m_pkthdr.len &&
1284 (rep->r_flags & R_SENT) ||
1286 (m = m_copym(rep->r_mreq, 0, M_COPYALL, M_DONTWAIT))){
1302 if (rep->r_flags & R_SENT) {
1303 rep->r_flags &= ~R_TIMING;
1304 if (++rep->r_rexmit > NFS_MAXREXMIT)
1305 rep->r_rexmit = NFS_MAXREXMIT;
1311 rep->r_flags |= R_SENT;
1314 rep->r_rtt = 0;
1341 nfs_sigintr(nmp, rep, p) in nfs_sigintr() argument
1343 struct nfsreq *rep;
1347 if (rep && (rep->r_flags & R_SOFTTERM))
1365 nfs_sndlock(flagp, rep) in nfs_sndlock() argument
1367 struct nfsreq *rep;
1372 if (rep) {
1373 p = rep->r_procp;
1374 if (rep->r_nmp->nm_flag & NFSMNT_INT)
1379 if (nfs_sigintr(rep->r_nmp, rep, p))
1411 nfs_rcvlock(rep) in nfs_rcvlock() argument
1412 struct nfsreq *rep; in nfs_rcvlock()
1414 int *flagp = &rep->r_nmp->nm_flag;
1422 if (nfs_sigintr(rep->r_nmp, rep, rep->r_procp))