2 * linux/include/linux/sunrpc/timer.h
4 * Declarations for the RPC transport timer.
6 * Copyright (C) 2002 Trond Myklebust <trond.myklebust@fys.uio.no>
9 #ifndef _LINUX_SUNRPC_TIMER_H
10 #define _LINUX_SUNRPC_TIMER_H
12 #include <linux/atomic.h>
15 unsigned long timeo
; /* default timeout value */
16 unsigned long srtt
[5]; /* smoothed round trip time << 3 */
17 unsigned long sdrtt
[5]; /* smoothed medium deviation of RTT */
18 int ntimeouts
[5]; /* Number of timeouts for the last request */
22 extern void rpc_init_rtt(struct rpc_rtt
*rt
, unsigned long timeo
);
23 extern void rpc_update_rtt(struct rpc_rtt
*rt
, unsigned timer
, long m
);
24 extern unsigned long rpc_calc_rto(struct rpc_rtt
*rt
, unsigned timer
);
26 static inline void rpc_set_timeo(struct rpc_rtt
*rt
, int timer
, int ntimeo
)
31 t
= &rt
->ntimeouts
[timer
-1];
42 static inline int rpc_ntimeo(struct rpc_rtt
*rt
, int timer
)
46 return rt
->ntimeouts
[timer
-1];
49 #endif /* _LINUX_SUNRPC_TIMER_H */