From d55e1a05ed4ffe8fcbe388e98639dd4578b7296a Mon Sep 17 00:00:00 2001 From: Trond Myklebust Date: Sat, 13 Mar 2004 11:40:04 -0500 Subject: RPC: Sync rpc_set_timeo() up to the 2.4.x version. In particular, this will ensure that the timeout shift is clamped to a maximum value of 8. RPC: Fix by Olaf Kirch to the rpc scheduler to ensure sync tasks respect the "intr" mount flag. --- include/linux/sunrpc/timer.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'include/linux') 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) -- cgit v1.2.3