summaryrefslogtreecommitdiff
path: root/include/linux/sunrpc/timer.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/sunrpc/timer.h')
-rw-r--r--include/linux/sunrpc/timer.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/include/linux/sunrpc/timer.h b/include/linux/sunrpc/timer.h
index 1d0d3a0d64ec..a67fd734c73b 100644
--- a/include/linux/sunrpc/timer.h
+++ b/include/linux/sunrpc/timer.h
@@ -25,9 +25,18 @@ extern unsigned long rpc_calc_rto(struct rpc_rtt *rt, unsigned timer);
static inline void rpc_set_timeo(struct rpc_rtt *rt, int timer, int ntimeo)
{
+ int *t;
if (!timer)
return;
- rt->ntimeouts[timer-1] = ntimeo;
+ t = &rt->ntimeouts[timer-1];
+ if (ntimeo < *t) {
+ if (*t > 0)
+ (*t)--;
+ } else {
+ if (ntimeo > 8)
+ ntimeo = 8;
+ *t = ntimeo;
+ }
}
static inline int rpc_ntimeo(struct rpc_rtt *rt, int timer)