Commit 33d90ac0 authored by J. Bruce Fields's avatar J. Bruce Fields

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: default avatarJ. Bruce Fields <bfields@redhat.com>
parent 7073ea87
...@@ -125,6 +125,7 @@ struct rpc_create_args { ...@@ -125,6 +125,7 @@ struct rpc_create_args {
#define RPC_CLNT_CREATE_DISCRTRY (1UL << 5) #define RPC_CLNT_CREATE_DISCRTRY (1UL << 5)
#define RPC_CLNT_CREATE_QUIET (1UL << 6) #define RPC_CLNT_CREATE_QUIET (1UL << 6)
#define RPC_CLNT_CREATE_INFINITE_SLOTS (1UL << 7) #define RPC_CLNT_CREATE_INFINITE_SLOTS (1UL << 7)
#define RPC_CLNT_CREATE_NO_IDLE_TIMEOUT (1UL << 8)
struct rpc_clnt *rpc_create(struct rpc_create_args *args); struct rpc_clnt *rpc_create(struct rpc_create_args *args);
struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *, struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *,
......
...@@ -256,6 +256,7 @@ static inline int bc_prealloc(struct rpc_rqst *req) ...@@ -256,6 +256,7 @@ static inline int bc_prealloc(struct rpc_rqst *req)
#endif /* CONFIG_SUNRPC_BACKCHANNEL */ #endif /* CONFIG_SUNRPC_BACKCHANNEL */
#define XPRT_CREATE_INFINITE_SLOTS (1U) #define XPRT_CREATE_INFINITE_SLOTS (1U)
#define XPRT_CREATE_NO_IDLE_TIMEOUT (1U << 1)
struct xprt_create { struct xprt_create {
int ident; /* XPRT_TRANSPORT identifier */ int ident; /* XPRT_TRANSPORT identifier */
......
...@@ -416,6 +416,8 @@ struct rpc_clnt *rpc_create(struct rpc_create_args *args) ...@@ -416,6 +416,8 @@ struct rpc_clnt *rpc_create(struct rpc_create_args *args)
if (args->flags & RPC_CLNT_CREATE_INFINITE_SLOTS) if (args->flags & RPC_CLNT_CREATE_INFINITE_SLOTS)
xprtargs.flags |= XPRT_CREATE_INFINITE_SLOTS; xprtargs.flags |= XPRT_CREATE_INFINITE_SLOTS;
if (args->flags & RPC_CLNT_CREATE_NO_IDLE_TIMEOUT)
xprtargs.flags |= XPRT_CREATE_NO_IDLE_TIMEOUT;
/* /*
* If the caller chooses not to specify a hostname, whip * If the caller chooses not to specify a hostname, whip
* up a string representation of the passed-in address. * up a string representation of the passed-in address.
......
...@@ -1300,6 +1300,8 @@ struct rpc_xprt *xprt_create_transport(struct xprt_create *args) ...@@ -1300,6 +1300,8 @@ struct rpc_xprt *xprt_create_transport(struct xprt_create *args)
-PTR_ERR(xprt)); -PTR_ERR(xprt));
goto out; goto out;
} }
if (args->flags & XPRT_CREATE_NO_IDLE_TIMEOUT)
xprt->idle_timeout = 0;
INIT_WORK(&xprt->task_cleanup, xprt_autoclose); INIT_WORK(&xprt->task_cleanup, xprt_autoclose);
if (xprt_has_timer(xprt)) if (xprt_has_timer(xprt))
setup_timer(&xprt->timer, xprt_init_autodisconnect, setup_timer(&xprt->timer, xprt_init_autodisconnect,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment