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 | 43 | int xprt_setup_bc(struct rpc_xprt *xprt, unsigned int min_reqs); |
| 44 | 44 | void xprt_destroy_bc(struct rpc_xprt *xprt, unsigned int max_reqs); |
| 45 | 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 | 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 | 194 | struct net * rpc_net_ns(struct rpc_clnt *); |
| 195 | 195 | size_t rpc_max_payload(struct rpc_clnt *); |
| 196 | 196 | size_t rpc_max_bc_payload(struct rpc_clnt *); |
| 197 | +unsigned int rpc_num_bc_slots(struct rpc_clnt *); | |
| 197 | 198 | void rpc_force_rebind(struct rpc_clnt *); |
| 198 | 199 | size_t rpc_peeraddr(struct rpc_clnt *, struct sockaddr *, size_t); |
| 199 | 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 | 158 | int (*bc_setup)(struct rpc_xprt *xprt, |
| 159 | 159 | unsigned int min_reqs); |
| 160 | 160 | size_t (*bc_maxpayload)(struct rpc_xprt *xprt); |
| 161 | + unsigned int (*bc_num_slots)(struct rpc_xprt *xprt); | |
| 161 | 162 | void (*bc_free_rqst)(struct rpc_rqst *rqst); |
| 162 | 163 | void (*bc_destroy)(struct rpc_xprt *xprt, |
| 163 | 164 | unsigned int max_reqs); |
| @@ -251,8 +252,9 @@ struct rpc_xprt { · 87 unmodified lines | ||
| 251 | 252 | #if defined(CONFIG_SUNRPC_BACKCHANNEL) |
| 252 | 253 | struct svc_serv *bc_serv; /* The RPC service which will */ |
| 253 | 254 | /* process the callback */ |
| 254 | − int bc_alloc_count; /* Total number of preallocs */ | |
| 255 | − atomic_t bc_free_slots; | |
| 255 | + unsigned int bc_alloc_max; | |
| 256 | + unsigned int bc_alloc_count; /* Total number of preallocs */ | |
| 257 | + atomic_t bc_slot_count; /* Number of allocated slots */ | |
| 256 | 258 | spinlock_t bc_pa_lock; /* Protects the preallocated |
| 257 | 259 | * items */ |
| 258 | 260 | struct list_head bc_pa_list; /* List of preallocated |