@@ -448,7 +448,7 @@ __svc_init_bc(struct svc_serv *serv)
448448 */
449449static struct svc_serv *
450450__svc_create (struct svc_program * prog , unsigned int bufsize , int npools ,
451- const struct svc_serv_ops * ops )
451+ int ( * threadfn )( void * data ) )
452452{
453453 struct svc_serv * serv ;
454454 unsigned int vers ;
@@ -465,7 +465,7 @@ __svc_create(struct svc_program *prog, unsigned int bufsize, int npools,
465465 bufsize = RPCSVC_MAXPAYLOAD ;
466466 serv -> sv_max_payload = bufsize ? bufsize : 4096 ;
467467 serv -> sv_max_mesg = roundup (serv -> sv_max_payload + PAGE_SIZE , PAGE_SIZE );
468- serv -> sv_ops = ops ;
468+ serv -> sv_threadfn = threadfn ;
469469 xdrsize = 0 ;
470470 while (prog ) {
471471 prog -> pg_lovers = prog -> pg_nvers - 1 ;
@@ -511,22 +511,37 @@ __svc_create(struct svc_program *prog, unsigned int bufsize, int npools,
511511 return serv ;
512512}
513513
514- struct svc_serv *
515- svc_create (struct svc_program * prog , unsigned int bufsize ,
516- const struct svc_serv_ops * ops )
514+ /**
515+ * svc_create - Create an RPC service
516+ * @prog: the RPC program the new service will handle
517+ * @bufsize: maximum message size for @prog
518+ * @threadfn: a function to service RPC requests for @prog
519+ *
520+ * Returns an instantiated struct svc_serv object or NULL.
521+ */
522+ struct svc_serv * svc_create (struct svc_program * prog , unsigned int bufsize ,
523+ int (* threadfn )(void * data ))
517524{
518- return __svc_create (prog , bufsize , /*npools*/ 1 , ops );
525+ return __svc_create (prog , bufsize , 1 , threadfn );
519526}
520527EXPORT_SYMBOL_GPL (svc_create );
521528
522- struct svc_serv *
523- svc_create_pooled (struct svc_program * prog , unsigned int bufsize ,
524- const struct svc_serv_ops * ops )
529+ /**
530+ * svc_create_pooled - Create an RPC service with pooled threads
531+ * @prog: the RPC program the new service will handle
532+ * @bufsize: maximum message size for @prog
533+ * @threadfn: a function to service RPC requests for @prog
534+ *
535+ * Returns an instantiated struct svc_serv object or NULL.
536+ */
537+ struct svc_serv * svc_create_pooled (struct svc_program * prog ,
538+ unsigned int bufsize ,
539+ int (* threadfn )(void * data ))
525540{
526541 struct svc_serv * serv ;
527542 unsigned int npools = svc_pool_map_get ();
528543
529- serv = __svc_create (prog , bufsize , npools , ops );
544+ serv = __svc_create (prog , bufsize , npools , threadfn );
530545 if (!serv )
531546 goto out_err ;
532547 return serv ;
@@ -736,7 +751,7 @@ svc_start_kthreads(struct svc_serv *serv, struct svc_pool *pool, int nrservs)
736751 if (IS_ERR (rqstp ))
737752 return PTR_ERR (rqstp );
738753
739- task = kthread_create_on_node (serv -> sv_ops -> svo_function , rqstp ,
754+ task = kthread_create_on_node (serv -> sv_threadfn , rqstp ,
740755 node , "%s" , serv -> sv_name );
741756 if (IS_ERR (task )) {
742757 svc_exit_thread (rqstp );
0 commit comments