SUNRPC: allow disabling idle timeout
authorJ. Bruce Fields <bfields@redhat.com>
Thu, 11 Apr 2013 19:06:36 +0000 (15:06 -0400)
committerJ. Bruce Fields <bfields@redhat.com>
Fri, 26 Apr 2013 15:41:26 +0000 (11:41 -0400)
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>
include/linux/sunrpc/clnt.h
include/linux/sunrpc/xprt.h
net/sunrpc/clnt.c
net/sunrpc/xprt.c

index e7d492ce7c18f6ccaa9da544f07ef6af68ba7fe2..bfe11be81f6fd46dfa1a20de478ceadf4418ac10 100644 (file)
@@ -125,6 +125,7 @@ struct rpc_create_args {
 #define RPC_CLNT_CREATE_DISCRTRY       (1UL << 5)
 #define RPC_CLNT_CREATE_QUIET          (1UL << 6)
 #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_bind_new_program(struct rpc_clnt *,
index ff5392421cb241f3e5f67f85391882d5372193a1..cec7b9b5e1bfb6591ad10997485b05ddc7421120 100644 (file)
@@ -256,6 +256,7 @@ static inline int bc_prealloc(struct rpc_rqst *req)
 #endif /* CONFIG_SUNRPC_BACKCHANNEL */
 
 #define XPRT_CREATE_INFINITE_SLOTS     (1U)
+#define XPRT_CREATE_NO_IDLE_TIMEOUT    (1U << 1)
 
 struct xprt_create {
        int                     ident;          /* XPRT_TRANSPORT identifier */
index 651245aa829a325743aa1190788bdc9b8ae4dc4d..80cf23241da99f8f7bb88acc89e9e6d5d711c5de 100644 (file)
@@ -416,6 +416,8 @@ struct rpc_clnt *rpc_create(struct rpc_create_args *args)
 
        if (args->flags & RPC_CLNT_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
         * up a string representation of the passed-in address.
index 745fca3cfd360531f9f18c4dadf2aa186b3c9cf2..095363eee764b3ff496a745f56e4fa646f5f02c0 100644 (file)
@@ -1300,6 +1300,8 @@ found:
                                -PTR_ERR(xprt));
                goto out;
        }
+       if (args->flags & XPRT_CREATE_NO_IDLE_TIMEOUT)
+               xprt->idle_timeout = 0;
        INIT_WORK(&xprt->task_cleanup, xprt_autoclose);
        if (xprt_has_timer(xprt))
                setup_timer(&xprt->timer, xprt_init_autodisconnect,
This page took 0.029952 seconds and 5 git commands to generate.