1 /* SPDX-License-Identifier: GPL-2.0 */
3 * linux/include/linux/sunrpc/timer.h
5 * Declarations for the RPC transport timer.
10 #ifndef _LINUX_SUNRPC_TIMER_H
11 #define _LINUX_SUNRPC_TIMER_H
13 #include <linux/atomic.h>
16 unsigned long timeo; /* default timeout value */
17 unsigned long srtt[5]; /* smoothed round trip time << 3 */
18 unsigned long sdrtt[5]; /* smoothed medium deviation of RTT */
19 int ntimeouts[5]; /* Number of timeouts for the last request */
23 extern void rpc_init_rtt(struct rpc_rtt *rt, unsigned long timeo);
24 extern void rpc_update_rtt(struct rpc_rtt *rt, unsigned timer, long m);
25 extern unsigned long rpc_calc_rto(struct rpc_rtt *rt, unsigned timer);
27 static inline void rpc_set_timeo(struct rpc_rtt *rt, int timer, int ntimeo)
32 t = &rt->ntimeouts[timer-1];
43 static inline int rpc_ntimeo(struct rpc_rtt *rt, int timer)
47 return rt->ntimeouts[timer-1];
50 #endif /* _LINUX_SUNRPC_TIMER_H */