Add a per-transport maximum limit in the socket case, and add helpers to allow the NFSv4 code to discover that limit.
Showing the changes to include/linux (3 of 11 files). Show all
Unified · Split
| @@ -43,6 +43,7 @@ void xprt_destroy_backchannel(struct rpc_xprt *, unsigned int max_reqs); · 42 unmodified lines | |||
| 43 | int xprt_setup_bc(struct rpc_xprt *xprt, unsigned int min_reqs); | 43 | int xprt_setup_bc(struct rpc_xprt *xprt, unsigned int min_reqs); |
| 44 | void xprt_destroy_bc(struct rpc_xprt *xprt, unsigned int max_reqs); | 44 | void xprt_destroy_bc(struct rpc_xprt *xprt, unsigned int max_reqs); |
| 45 | void xprt_free_bc_rqst(struct rpc_rqst *req); | 45 | void xprt_free_bc_rqst(struct rpc_rqst *req); |
| 46 | unsigned int xprt_bc_max_slots(struct rpc_xprt *xprt); | ||
| 46 | 47 | ||
| 47 | /* | 48 | /* |
| 48 | * Determine if a shared backchannel is in use | 49 | * Determine if a shared backchannel is in use |
| @@ -194,6 +194,7 @@ void rpc_setbufsize(struct rpc_clnt *, unsigned int, unsigned int); · 193 unmodified lines | |||
| 194 | struct net * rpc_net_ns(struct rpc_clnt *); | 194 | struct net * rpc_net_ns(struct rpc_clnt *); |
| 195 | size_t rpc_max_payload(struct rpc_clnt *); | 195 | size_t rpc_max_payload(struct rpc_clnt *); |
| 196 | size_t rpc_max_bc_payload(struct rpc_clnt *); | 196 | size_t rpc_max_bc_payload(struct rpc_clnt *); |
| 197 | unsigned int rpc_num_bc_slots(struct rpc_clnt *); | ||
| 197 | void rpc_force_rebind(struct rpc_clnt *); | 198 | void rpc_force_rebind(struct rpc_clnt *); |
| 198 | size_t rpc_peeraddr(struct rpc_clnt *, struct sockaddr *, size_t); | 199 | size_t rpc_peeraddr(struct rpc_clnt *, struct sockaddr *, size_t); |
| 199 | const char *rpc_peeraddr2str(struct rpc_clnt *, enum rpc_display_format_t); | 200 | const char *rpc_peeraddr2str(struct rpc_clnt *, enum rpc_display_format_t); |
| @@ -158,6 +158,7 @@ struct rpc_xprt_ops { · 157 unmodified lines | |||
| 158 | int (*bc_setup)(struct rpc_xprt *xprt, | 158 | int (*bc_setup)(struct rpc_xprt *xprt, |
| 159 | unsigned int min_reqs); | 159 | unsigned int min_reqs); |
| 160 | size_t (*bc_maxpayload)(struct rpc_xprt *xprt); | 160 | size_t (*bc_maxpayload)(struct rpc_xprt *xprt); |
| 161 | unsigned int (*bc_num_slots)(struct rpc_xprt *xprt); | ||
| 161 | void (*bc_free_rqst)(struct rpc_rqst *rqst); | 162 | void (*bc_free_rqst)(struct rpc_rqst *rqst); |
| 162 | void (*bc_destroy)(struct rpc_xprt *xprt, | 163 | void (*bc_destroy)(struct rpc_xprt *xprt, |
| 163 | unsigned int max_reqs); | 164 | unsigned int max_reqs); |
| @@ -251,8 +252,9 @@ struct rpc_xprt { · 87 unmodified lines | |||
| 251 | #if defined(CONFIG_SUNRPC_BACKCHANNEL) | 252 | #if defined(CONFIG_SUNRPC_BACKCHANNEL) |
| 252 | struct svc_serv *bc_serv; /* The RPC service which will */ | 253 | struct svc_serv *bc_serv; /* The RPC service which will */ |
| 253 | /* process the callback */ | 254 | /* process the callback */ |
| 254 | int bc_alloc_count; /* Total number of preallocs */ | 255 | unsigned int bc_alloc_max; |
| 255 | atomic_t bc_free_slots; | 256 | unsigned int bc_alloc_count; /* Total number of preallocs */ |
| 257 | atomic_t bc_slot_count; /* Number of allocated slots */ | ||
| 256 | spinlock_t bc_pa_lock; /* Protects the preallocated | 258 | spinlock_t bc_pa_lock; /* Protects the preallocated |
| 257 | * items */ | 259 | * items */ |
| 258 | struct list_head bc_pa_list; /* List of preallocated | 260 | struct list_head bc_pa_list; /* List of preallocated |