Lines 1-6
Link Here
|
1 |
--- nfs.c.orig Tue Mar 12 21:44:19 2002 |
1 |
--- nfs.c.orig Mon Mar 18 00:18:17 2002 |
2 |
+++ nfs.c Thu Mar 14 07:51:43 2002 |
2 |
+++ nfs.c Fri Jan 3 15:49:03 2003 |
3 |
@@ -321,6 +321,14 @@ |
3 |
@@ -61,6 +61,14 @@ |
4 |
int retries; |
4 |
int retries; |
5 |
long *p; |
5 |
long *p; |
6 |
|
6 |
|
Lines 15-22
Link Here
|
15 |
id = rpc_id++; |
15 |
id = rpc_id++; |
16 |
buf.u.call.id = htonl(id); |
16 |
buf.u.call.id = htonl(id); |
17 |
buf.u.call.type = htonl(MSG_CALL); |
17 |
buf.u.call.type = htonl(MSG_CALL); |
18 |
@@ -336,9 +344,14 @@ |
18 |
@@ -267,6 +275,14 @@ |
19 |
*p++ = 0; /* unused parameter */ |
19 |
int retries; |
|
|
20 |
int pathlen = strlen(path); |
21 |
|
22 |
+ static int tokens=0; |
23 |
+ /* |
24 |
+ * Try to implement something similar to a window protocol in |
25 |
+ * terms of response to losses. On successful receive, increment |
26 |
+ * the number of tokens by 1 (cap at 256). On failure, halve it. |
27 |
+ * When the number of tokens is >= 2, use a very short timeout. |
28 |
+ */ |
29 |
+ |
30 |
id = rpc_id++; |
31 |
buf.u.call.id = htonl(id); |
32 |
buf.u.call.type = htonl(MSG_CALL); |
33 |
@@ -285,9 +301,14 @@ |
34 |
p += (pathlen + 3) / 4; |
20 |
for (retries = 0; retries < MAX_RPC_RETRIES; retries++) { |
35 |
for (retries = 0; retries < MAX_RPC_RETRIES; retries++) { |
21 |
long timeout = rfc2131_sleep_interval(TIMEOUT, retries); |
36 |
long timeout = rfc2131_sleep_interval(TIMEOUT, retries); |
22 |
+ if (tokens >= 2) |
37 |
+ if (tokens >= 2) |
Lines 30-37
Link Here
|
30 |
rpc = (struct rpc_t *)&nic.packet[ETH_HLEN]; |
45 |
rpc = (struct rpc_t *)&nic.packet[ETH_HLEN]; |
31 |
if (rpc->u.reply.rstatus || rpc->u.reply.verifier || |
46 |
if (rpc->u.reply.rstatus || rpc->u.reply.verifier || |
32 |
rpc->u.reply.astatus || rpc->u.reply.data[0]) { |
47 |
rpc->u.reply.astatus || rpc->u.reply.data[0]) { |
33 |
@@ -355,7 +368,8 @@ |
48 |
@@ -305,7 +326,8 @@ |
34 |
} else { |
49 |
memcpy(nfh, rpc->u.reply.data + 1, NFS_FHSIZE); |
35 |
return 0; |
50 |
return 0; |
36 |
} |
51 |
} |
37 |
- } |
52 |
- } |