aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2013-04-14 11:42:00 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2013-04-14 12:26:03 -0400
commitb7993cebb841b0da7a33e9d5ce301a9fd3209165 (patch)
tree62361acf994e04b3b9205d5e4a9b26c4a3193c34
parentba60eb25ff6be6f8e60488cdfd454e5c612bce60 (diff)
SUNRPC: Allow rpc_create() to request that TCP slots be unlimited
This is mainly for use by NFSv4.1, where the session negotiation ultimately wants to decide how many RPC slots we can fill. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r--include/linux/sunrpc/clnt.h1
-rw-r--r--include/linux/sunrpc/xprt.h3
-rw-r--r--net/sunrpc/clnt.c2
-rw-r--r--net/sunrpc/xprtsock.c6
4 files changed, 11 insertions, 1 deletions
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h
index 2cf4ffaa3cd4..e7d492ce7c18 100644
--- a/include/linux/sunrpc/clnt.h
+++ b/include/linux/sunrpc/clnt.h
@@ -124,6 +124,7 @@ struct rpc_create_args {
124#define RPC_CLNT_CREATE_NOPING (1UL << 4) 124#define RPC_CLNT_CREATE_NOPING (1UL << 4)
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 128
128struct rpc_clnt *rpc_create(struct rpc_create_args *args); 129struct rpc_clnt *rpc_create(struct rpc_create_args *args);
129struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *, 130struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *,
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h
index 12815f66a9c4..ff5392421cb2 100644
--- a/include/linux/sunrpc/xprt.h
+++ b/include/linux/sunrpc/xprt.h
@@ -255,6 +255,8 @@ static inline int bc_prealloc(struct rpc_rqst *req)
255} 255}
256#endif /* CONFIG_SUNRPC_BACKCHANNEL */ 256#endif /* CONFIG_SUNRPC_BACKCHANNEL */
257 257
258#define XPRT_CREATE_INFINITE_SLOTS (1U)
259
258struct xprt_create { 260struct xprt_create {
259 int ident; /* XPRT_TRANSPORT identifier */ 261 int ident; /* XPRT_TRANSPORT identifier */
260 struct net * net; 262 struct net * net;
@@ -263,6 +265,7 @@ struct xprt_create {
263 size_t addrlen; 265 size_t addrlen;
264 const char *servername; 266 const char *servername;
265 struct svc_xprt *bc_xprt; /* NFSv4.1 backchannel */ 267 struct svc_xprt *bc_xprt; /* NFSv4.1 backchannel */
268 unsigned int flags;
266}; 269};
267 270
268struct xprt_class { 271struct xprt_class {
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index a80ee9b80dcf..651245aa829a 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -414,6 +414,8 @@ struct rpc_clnt *rpc_create(struct rpc_create_args *args)
414 }; 414 };
415 char servername[48]; 415 char servername[48];
416 416
417 if (args->flags & RPC_CLNT_CREATE_INFINITE_SLOTS)
418 xprtargs.flags |= XPRT_CREATE_INFINITE_SLOTS;
417 /* 419 /*
418 * If the caller chooses not to specify a hostname, whip 420 * If the caller chooses not to specify a hostname, whip
419 * up a string representation of the passed-in address. 421 * up a string representation of the passed-in address.
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index 3081620cb02c..726e702b7a29 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -2762,9 +2762,13 @@ static struct rpc_xprt *xs_setup_tcp(struct xprt_create *args)
2762 struct rpc_xprt *xprt; 2762 struct rpc_xprt *xprt;
2763 struct sock_xprt *transport; 2763 struct sock_xprt *transport;
2764 struct rpc_xprt *ret; 2764 struct rpc_xprt *ret;
2765 unsigned int max_slot_table_size = xprt_max_tcp_slot_table_entries;
2766
2767 if (args->flags & XPRT_CREATE_INFINITE_SLOTS)
2768 max_slot_table_size = RPC_MAX_SLOT_TABLE_LIMIT;
2765 2769
2766 xprt = xs_setup_xprt(args, xprt_tcp_slot_table_entries, 2770 xprt = xs_setup_xprt(args, xprt_tcp_slot_table_entries,
2767 xprt_max_tcp_slot_table_entries); 2771 max_slot_table_size);
2768 if (IS_ERR(xprt)) 2772 if (IS_ERR(xprt))
2769 return xprt; 2773 return xprt;
2770 transport = container_of(xprt, struct sock_xprt, xprt); 2774 transport = container_of(xprt, struct sock_xprt, xprt);