diff options
author | J. Bruce Fields <bfields@redhat.com> | 2013-04-11 15:06:36 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2013-04-26 11:41:26 -0400 |
commit | 33d90ac0581ce81d1ebfc51918a2757e41a6011c (patch) | |
tree | ee1a01377713975303cbfae2abb268de2ec6a769 | |
parent | 7073ea8799a8cf73db60270986f14e4aae20fa80 (diff) |
SUNRPC: allow disabling idle timeout
In the gss-proxy case we don't want to have to reconnect at random--we
want to connect only on gss-proxy startup when we can steal gss-proxy's
context to do the connect in the right namespace.
So, provide a flag that allows the rpc_create caller to turn off the
idle timeout.
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
-rw-r--r-- | include/linux/sunrpc/clnt.h | 1 | ||||
-rw-r--r-- | include/linux/sunrpc/xprt.h | 1 | ||||
-rw-r--r-- | net/sunrpc/clnt.c | 2 | ||||
-rw-r--r-- | net/sunrpc/xprt.c | 2 |
4 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h index e7d492ce7c18..bfe11be81f6f 100644 --- a/include/linux/sunrpc/clnt.h +++ b/include/linux/sunrpc/clnt.h | |||
@@ -125,6 +125,7 @@ struct rpc_create_args { | |||
125 | #define RPC_CLNT_CREATE_DISCRTRY (1UL << 5) | 125 | #define RPC_CLNT_CREATE_DISCRTRY (1UL << 5) |
126 | #define RPC_CLNT_CREATE_QUIET (1UL << 6) | 126 | #define RPC_CLNT_CREATE_QUIET (1UL << 6) |
127 | #define RPC_CLNT_CREATE_INFINITE_SLOTS (1UL << 7) | 127 | #define RPC_CLNT_CREATE_INFINITE_SLOTS (1UL << 7) |
128 | #define RPC_CLNT_CREATE_NO_IDLE_TIMEOUT (1UL << 8) | ||
128 | 129 | ||
129 | struct rpc_clnt *rpc_create(struct rpc_create_args *args); | 130 | struct rpc_clnt *rpc_create(struct rpc_create_args *args); |
130 | struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *, | 131 | struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *, |
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h index ff5392421cb2..cec7b9b5e1bf 100644 --- a/include/linux/sunrpc/xprt.h +++ b/include/linux/sunrpc/xprt.h | |||
@@ -256,6 +256,7 @@ static inline int bc_prealloc(struct rpc_rqst *req) | |||
256 | #endif /* CONFIG_SUNRPC_BACKCHANNEL */ | 256 | #endif /* CONFIG_SUNRPC_BACKCHANNEL */ |
257 | 257 | ||
258 | #define XPRT_CREATE_INFINITE_SLOTS (1U) | 258 | #define XPRT_CREATE_INFINITE_SLOTS (1U) |
259 | #define XPRT_CREATE_NO_IDLE_TIMEOUT (1U << 1) | ||
259 | 260 | ||
260 | struct xprt_create { | 261 | struct xprt_create { |
261 | int ident; /* XPRT_TRANSPORT identifier */ | 262 | int ident; /* XPRT_TRANSPORT identifier */ |
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index 651245aa829a..80cf23241da9 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c | |||
@@ -416,6 +416,8 @@ struct rpc_clnt *rpc_create(struct rpc_create_args *args) | |||
416 | 416 | ||
417 | if (args->flags & RPC_CLNT_CREATE_INFINITE_SLOTS) | 417 | if (args->flags & RPC_CLNT_CREATE_INFINITE_SLOTS) |
418 | xprtargs.flags |= XPRT_CREATE_INFINITE_SLOTS; | 418 | xprtargs.flags |= XPRT_CREATE_INFINITE_SLOTS; |
419 | if (args->flags & RPC_CLNT_CREATE_NO_IDLE_TIMEOUT) | ||
420 | xprtargs.flags |= XPRT_CREATE_NO_IDLE_TIMEOUT; | ||
419 | /* | 421 | /* |
420 | * If the caller chooses not to specify a hostname, whip | 422 | * If the caller chooses not to specify a hostname, whip |
421 | * up a string representation of the passed-in address. | 423 | * up a string representation of the passed-in address. |
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c index 745fca3cfd36..095363eee764 100644 --- a/net/sunrpc/xprt.c +++ b/net/sunrpc/xprt.c | |||
@@ -1300,6 +1300,8 @@ found: | |||
1300 | -PTR_ERR(xprt)); | 1300 | -PTR_ERR(xprt)); |
1301 | goto out; | 1301 | goto out; |
1302 | } | 1302 | } |
1303 | if (args->flags & XPRT_CREATE_NO_IDLE_TIMEOUT) | ||
1304 | xprt->idle_timeout = 0; | ||
1303 | INIT_WORK(&xprt->task_cleanup, xprt_autoclose); | 1305 | INIT_WORK(&xprt->task_cleanup, xprt_autoclose); |
1304 | if (xprt_has_timer(xprt)) | 1306 | if (xprt_has_timer(xprt)) |
1305 | setup_timer(&xprt->timer, xprt_init_autodisconnect, | 1307 | setup_timer(&xprt->timer, xprt_init_autodisconnect, |