Skip to contentSkip to conversation

nfsd/sunrpc: factor svc_rqst allocation and freeing from sv_nrthreads refcounting

RFC PATCH In review Shirley Ma 1 participant 1 message Jun 8, 2015

Subsystems (3)
lore
Share & tools
lore

Shirley Ma

author
#0 lore raw

RFC PATCH v4 7/7 nfsd/sunrpc: factor svc_rqst allocation and freeing from sv_nrthreads refcounting

From: Jeff Layton <[email protected]>

In later patches, we'll want to be able to allocate and free svc_rqst structures without monkeying with the serv->sv_nrthreads refcount.

Factor those pieces out of their respective functions.

---

include/linux/sunrpc/svc.h +3 -0
index 758b4eb..8203ec0 100644
@@ -458,8 +458,11 @@ void svc_rpcb_cleanup(struct svc_serv *serv, struct net *net);
 int svc_bind(struct svc_serv *serv, struct net *net);
 struct svc_serv *svc_create(struct svc_program *, unsigned int,
 			    struct svc_serv_ops *);
+struct svc_rqst *svc_rqst_alloc(struct svc_serv *serv,
+					struct svc_pool *pool, int node);
 struct svc_rqst *svc_prepare_thread(struct svc_serv *serv,
 					struct svc_pool *pool, int node);
+void		   svc_rqst_free(struct svc_rqst *);
 void		   svc_exit_thread(struct svc_rqst *);
 unsigned int	   svc_pool_map_get(void);
 void		   svc_pool_map_put(void);
net/sunrpc/svc.c +36 -18

98 lines not on this page · raw message