Skip to content

Commit 33d90ac

Browse files
author
J. Bruce Fields
committed
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 <[email protected]>
1 parent 7073ea8 commit 33d90ac

File tree

4 files changed

+6
-0
lines changed

4 files changed

+6
-0
lines changed

include/linux/sunrpc/clnt.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ struct rpc_create_args {
125125
#define RPC_CLNT_CREATE_DISCRTRY (1UL << 5)
126126
#define RPC_CLNT_CREATE_QUIET (1UL << 6)
127127
#define RPC_CLNT_CREATE_INFINITE_SLOTS (1UL << 7)
128+
#define RPC_CLNT_CREATE_NO_IDLE_TIMEOUT (1UL << 8)
128129

129130
struct rpc_clnt *rpc_create(struct rpc_create_args *args);
130131
struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *,

include/linux/sunrpc/xprt.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ static inline int bc_prealloc(struct rpc_rqst *req)
256256
#endif /* CONFIG_SUNRPC_BACKCHANNEL */
257257

258258
#define XPRT_CREATE_INFINITE_SLOTS (1U)
259+
#define XPRT_CREATE_NO_IDLE_TIMEOUT (1U << 1)
259260

260261
struct xprt_create {
261262
int ident; /* XPRT_TRANSPORT identifier */

net/sunrpc/clnt.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,8 @@ struct rpc_clnt *rpc_create(struct rpc_create_args *args)
416416

417417
if (args->flags & RPC_CLNT_CREATE_INFINITE_SLOTS)
418418
xprtargs.flags |= XPRT_CREATE_INFINITE_SLOTS;
419+
if (args->flags & RPC_CLNT_CREATE_NO_IDLE_TIMEOUT)
420+
xprtargs.flags |= XPRT_CREATE_NO_IDLE_TIMEOUT;
419421
/*
420422
* If the caller chooses not to specify a hostname, whip
421423
* up a string representation of the passed-in address.

net/sunrpc/xprt.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1300,6 +1300,8 @@ struct rpc_xprt *xprt_create_transport(struct xprt_create *args)
13001300
-PTR_ERR(xprt));
13011301
goto out;
13021302
}
1303+
if (args->flags & XPRT_CREATE_NO_IDLE_TIMEOUT)
1304+
xprt->idle_timeout = 0;
13031305
INIT_WORK(&xprt->task_cleanup, xprt_autoclose);
13041306
if (xprt_has_timer(xprt))
13051307
setup_timer(&xprt->timer, xprt_init_autodisconnect,

0 commit comments

Comments
 (0)