SUNRPC: spin svc_rqst initialization to its own function
Move the initialzation in __svc_create_thread that happens prior to thread creation to a new function. Export the function to allow services to have better control over the svc_rqst structs. Also rearrange the rqstp initialization to prevent NULL pointer dereferences in svc_exit_thread in case allocations fail. Signed-off-by: Jeff Layton <jlayton@redhat.com> Reviewed-by: NeilBrown <neilb@suse.de> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
This commit is contained in:

committed by
J. Bruce Fields

parent
87d26ea777
commit
0113ab3464
@@ -384,6 +384,8 @@ struct svc_procedure {
|
||||
*/
|
||||
struct svc_serv * svc_create(struct svc_program *, unsigned int,
|
||||
void (*shutdown)(struct svc_serv*));
|
||||
struct svc_rqst *svc_prepare_thread(struct svc_serv *serv,
|
||||
struct svc_pool *pool);
|
||||
int svc_create_thread(svc_thread_fn, struct svc_serv *);
|
||||
void svc_exit_thread(struct svc_rqst *);
|
||||
struct svc_serv * svc_create_pooled(struct svc_program *, unsigned int,
|
||||
|
Reference in New Issue
Block a user