nfsd/sunrpc: add a new svc_serv_ops struct and move sv_shutdown into it

In later patches we'll need to abstract out more operations on a
per-service level, besides sv_shutdown and sv_function.

Declare a new svc_serv_ops struct to hold these operations, and move
sv_shutdown into this struct.

Signed-off-by: Shirley Ma <[email protected]>
Acked-by: Jeff Layton <[email protected]>
Tested-by: Shirley Ma <[email protected]>
Signed-off-by: J. Bruce Fields <[email protected]>
This commit is contained in:
Jeff Layton 2015-06-08 12:03:32 -07:00 • committed by J. Bruce Fields
commit ea126e7435
5 changed files with 33 additions and 22 deletions

View file

@ -322,6 +322,10 @@ out_rqst:
return error;
}
static struct svc_serv_ops lockd_sv_ops = {
.svo_shutdown = svc_rpcb_cleanup,
};
static struct svc_serv *lockd_create_svc(void)
{
struct svc_serv *serv;
@ -350,7 +354,7 @@ static struct svc_serv *lockd_create_svc(void)
nlm_timeout = LOCKD_DFLT_TIMEO;
nlmsvc_timeout = nlm_timeout * HZ;
serv = svc_create(&nlmsvc_program, LOCKD_BUFSIZE, svc_rpcb_cleanup);
serv = svc_create(&nlmsvc_program, LOCKD_BUFSIZE, &lockd_sv_ops);
if (!serv) {
printk(KERN_WARNING "lockd_up: create service failed\n");
return ERR_PTR(-ENOMEM);