Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

SUNRPC: Add documenting comments in net/sunrpc/timer.c

Clean up: provide documenting comments for the functions in
net/sunrpc/timer.c.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

authored by

Chuck Lever and committed by
Trond Myklebust
c05988cd 9dc3b095

+29 -16
+29 -16
net/sunrpc/timer.c
··· 25 25 #define RPC_RTO_INIT (HZ/5) 26 26 #define RPC_RTO_MIN (HZ/10) 27 27 28 - void 29 - rpc_init_rtt(struct rpc_rtt *rt, unsigned long timeo) 28 + /** 29 + * rpc_init_rtt - Initialize an RPC RTT estimator context 30 + * @rt: context to initialize 31 + * @timeo: initial timeout value, in jiffies 32 + * 33 + */ 34 + void rpc_init_rtt(struct rpc_rtt *rt, unsigned long timeo) 30 35 { 31 36 unsigned long init = 0; 32 37 unsigned i; ··· 48 43 } 49 44 EXPORT_SYMBOL_GPL(rpc_init_rtt); 50 45 51 - /* 46 + /** 47 + * rpc_update_rtt - Update an RPC RTT estimator context 48 + * @rt: context to update 49 + * @timer: timer array index (request type) 50 + * @m: recent actual RTT, in jiffies 51 + * 52 52 * NB: When computing the smoothed RTT and standard deviation, 53 53 * be careful not to produce negative intermediate results. 54 54 */ 55 - void 56 - rpc_update_rtt(struct rpc_rtt *rt, unsigned timer, long m) 55 + void rpc_update_rtt(struct rpc_rtt *rt, unsigned timer, long m) 57 56 { 58 57 long *srtt, *sdrtt; 59 58 ··· 88 79 } 89 80 EXPORT_SYMBOL_GPL(rpc_update_rtt); 90 81 91 - /* 92 - * Estimate rto for an nfs rpc sent via. an unreliable datagram. 93 - * Use the mean and mean deviation of rtt for the appropriate type of rpc 94 - * for the frequent rpcs and a default for the others. 95 - * The justification for doing "other" this way is that these rpcs 96 - * happen so infrequently that timer est. would probably be stale. 97 - * Also, since many of these rpcs are 98 - * non-idempotent, a conservative timeout is desired. 82 + /** 83 + * rpc_calc_rto - Provide an estimated timeout value 84 + * @rt: context to use for calculation 85 + * @timer: timer array index (request type) 86 + * 87 + * Estimate RTO for an NFS RPC sent via an unreliable datagram. Use 88 + * the mean and mean deviation of RTT for the appropriate type of RPC 89 + * for frequently issued RPCs, and a fixed default for the others. 90 + * 91 + * The justification for doing "other" this way is that these RPCs 92 + * happen so infrequently that timer estimation would probably be 93 + * stale. Also, since many of these RPCs are non-idempotent, a 94 + * conservative timeout is desired. 95 + * 99 96 * getattr, lookup, 100 97 * read, write, commit - A+4D 101 98 * other - timeo 102 99 */ 103 - 104 - unsigned long 105 - rpc_calc_rto(struct rpc_rtt *rt, unsigned timer) 100 + unsigned long rpc_calc_rto(struct rpc_rtt *rt, unsigned timer) 106 101 { 107 102 unsigned long res; 108 103