diff options
author | Weston Andros Adamson <dros@netapp.com> | 2013-02-28 20:30:09 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2013-02-28 20:35:20 -0500 |
commit | edddbb1eda61753c886a3c5e159293a7b3a9e30a (patch) | |
tree | 2771abd18c39df234420c332158bfb4f09085401 | |
parent | eb97cbb459c656b542101091f67ce112b3e56183 (diff) |
SUNRPC: add call to get configured timeout
Returns the configured timeout for the xprt of the rpc client.
Signed-off-by: Weston Andros Adamson <dros@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r-- | include/linux/sunrpc/clnt.h | 1 | ||||
-rw-r--r-- | net/sunrpc/clnt.c | 15 |
2 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h index 34206b84d8da..21d52d0dc15c 100644 --- a/include/linux/sunrpc/clnt.h +++ b/include/linux/sunrpc/clnt.h | |||
@@ -160,6 +160,7 @@ void rpc_setbufsize(struct rpc_clnt *, unsigned int, unsigned int); | |||
160 | int rpc_protocol(struct rpc_clnt *); | 160 | int rpc_protocol(struct rpc_clnt *); |
161 | struct net * rpc_net_ns(struct rpc_clnt *); | 161 | struct net * rpc_net_ns(struct rpc_clnt *); |
162 | size_t rpc_max_payload(struct rpc_clnt *); | 162 | size_t rpc_max_payload(struct rpc_clnt *); |
163 | unsigned long rpc_get_timeout(struct rpc_clnt *clnt); | ||
163 | void rpc_force_rebind(struct rpc_clnt *); | 164 | void rpc_force_rebind(struct rpc_clnt *); |
164 | size_t rpc_peeraddr(struct rpc_clnt *, struct sockaddr *, size_t); | 165 | size_t rpc_peeraddr(struct rpc_clnt *, struct sockaddr *, size_t); |
165 | const char *rpc_peeraddr2str(struct rpc_clnt *, enum rpc_display_format_t); | 166 | const char *rpc_peeraddr2str(struct rpc_clnt *, enum rpc_display_format_t); |
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index a9f7906c1a6a..09dc0c2b56a3 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c | |||
@@ -1196,6 +1196,21 @@ size_t rpc_max_payload(struct rpc_clnt *clnt) | |||
1196 | EXPORT_SYMBOL_GPL(rpc_max_payload); | 1196 | EXPORT_SYMBOL_GPL(rpc_max_payload); |
1197 | 1197 | ||
1198 | /** | 1198 | /** |
1199 | * rpc_get_timeout - Get timeout for transport in tenths of seconds | ||
1200 | * @clnt: RPC client to query | ||
1201 | */ | ||
1202 | unsigned long rpc_get_timeout(struct rpc_clnt *clnt) | ||
1203 | { | ||
1204 | unsigned long ret; | ||
1205 | |||
1206 | rcu_read_lock(); | ||
1207 | ret = rcu_dereference(clnt->cl_xprt)->timeout->to_initval; | ||
1208 | rcu_read_unlock(); | ||
1209 | return ret; | ||
1210 | } | ||
1211 | EXPORT_SYMBOL_GPL(rpc_get_timeout); | ||
1212 | |||
1213 | /** | ||
1199 | * rpc_force_rebind - force transport to check that remote port is unchanged | 1214 | * rpc_force_rebind - force transport to check that remote port is unchanged |
1200 | * @clnt: client to rebind | 1215 | * @clnt: client to rebind |
1201 | * | 1216 | * |