View | Details | Raw Unified | Return to bug 15055
Collapse All | Expand All

(-)nfs_socket.c (-4 / +28 lines)
Lines 152-157 Link Here
152
static void	nfs_realign __P((struct mbuf **pm, int hsiz));
152
static void	nfs_realign __P((struct mbuf **pm, int hsiz));
153
static int	nfs_receive __P((struct nfsreq *rep, struct sockaddr **aname,
153
static int	nfs_receive __P((struct nfsreq *rep, struct sockaddr **aname,
154
				 struct mbuf **mp));
154
				 struct mbuf **mp));
155
static void	nfs_softterm __P((struct nfsreq *rep));
155
static int	nfs_reconnect __P((struct nfsreq *rep));
156
static int	nfs_reconnect __P((struct nfsreq *rep));
156
#ifndef NFS_NOSERVER 
157
#ifndef NFS_NOSERVER 
157
static int	nfsrv_getstream __P((struct nfssvc_sock *,int));
158
static int	nfsrv_getstream __P((struct nfssvc_sock *,int));
Lines 864-871 Link Here
864
					if (nmp->nm_cwnd > NFS_MAXCWND)
865
					if (nmp->nm_cwnd > NFS_MAXCWND)
865
						nmp->nm_cwnd = NFS_MAXCWND;
866
						nmp->nm_cwnd = NFS_MAXCWND;
866
				}
867
				}
867
				rep->r_flags &= ~R_SENT;
868
				if (rep->r_flags & R_SENT) {
868
				nmp->nm_sent -= NFS_CWNDSCALE;
869
					rep->r_flags &= ~R_SENT;
870
					nmp->nm_sent -= NFS_CWNDSCALE;
871
				}
869
				/*
872
				/*
870
				 * Update rtt using a gain of 0.125 on the mean
873
				 * Update rtt using a gain of 0.125 on the mean
871
				 * and a gain of 0.25 on the deviation.
874
				 * and a gain of 0.25 on the deviation.
Lines 1384-1390 Link Here
1384
		if (rep->r_mrep || (rep->r_flags & R_SOFTTERM))
1387
		if (rep->r_mrep || (rep->r_flags & R_SOFTTERM))
1385
			continue;
1388
			continue;
1386
		if (nfs_sigintr(nmp, rep, rep->r_procp)) {
1389
		if (nfs_sigintr(nmp, rep, rep->r_procp)) {
1387
			rep->r_flags |= R_SOFTTERM;
1390
			nfs_softterm(rep);
1388
			continue;
1391
			continue;
1389
		}
1392
		}
1390
		if (rep->r_rtt >= 0) {
1393
		if (rep->r_rtt >= 0) {
Lines 1412-1418 Link Here
1412
		}
1415
		}
1413
		if (rep->r_rexmit >= rep->r_retry) {	/* too many */
1416
		if (rep->r_rexmit >= rep->r_retry) {	/* too many */
1414
			nfsstats.rpctimeouts++;
1417
			nfsstats.rpctimeouts++;
1415
			rep->r_flags |= R_SOFTTERM;
1418
			nfs_softterm(rep);
1416
			continue;
1419
			continue;
1417
		}
1420
		}
1418
		if (nmp->nm_sotype != SOCK_DGRAM) {
1421
		if (nmp->nm_sotype != SOCK_DGRAM) {
Lines 1491-1496 Link Here
1491
	nfs_timer_handle = timeout(nfs_timer, (void *)0, nfs_ticks);
1494
	nfs_timer_handle = timeout(nfs_timer, (void *)0, nfs_ticks);
1492
}
1495
}
1493
1496
1497
/*
1498
 * Flag a request as being about to terminate (due to NFSMNT_INT/NFSMNT_SOFT).
1499
 * The nm_send count is decremented now to avoid deadlocks when the process in
1500
 * soreceive() hasn't yet managed to send its own request.
1501
 */
1502
static void
1503
nfs_softterm(rep)
1504
	struct nfsreq *rep;
1505
{
1506
	rep->r_flags |= R_SOFTTERM;
1507
1508
	/*
1509
	 * Decrement the outstanding request count, and clear R_SENT so
1510
	 * that the decrement doesn't get done again later.
1511
	 */
1512
	if (rep->r_flags & R_SENT) {
1513
		rep->r_nmp->nm_sent -= NFS_CWNDSCALE;
1514
		rep->r_flags &= ~R_SENT;
1515
	}
1516
}
1517
	
1494
1518
1495
/*
1519
/*
1496
 * Test for a termination condition pending on the process.
1520
 * Test for a termination condition pending on the process.

Return to bug 15055