]> git.karo-electronics.de Git - linux-beck.git/commitdiff
sunrpc: require svc_create callers to pass in meaningful shutdown routine
authorJeff Layton <jlayton@primarydata.com>
Wed, 19 Nov 2014 12:51:22 +0000 (07:51 -0500)
committerJ. Bruce Fields <bfields@redhat.com>
Tue, 9 Dec 2014 16:22:21 +0000 (11:22 -0500)
Currently all svc_create callers pass in NULL for the shutdown parm,
which then gets fixed up to be svc_rpcb_cleanup if the service uses
rpcbind.

Simplify this by instead having the the only caller that requires it
(lockd) pass in svc_rpcb_cleanup and get rid of the special casing.

Signed-off-by: Jeff Layton <jlayton@primarydata.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/lockd/svc.c
net/sunrpc/svc.c

index d1bb7ecfd201e9443c1f368acec6ec5665668ed8..e94c887da2d72f7043ed010bfa8675b4ad825bb6 100644 (file)
@@ -350,7 +350,7 @@ static struct svc_serv *lockd_create_svc(void)
                printk(KERN_WARNING
                        "lockd_up: no pid, %d users??\n", nlmsvc_users);
 
-       serv = svc_create(&nlmsvc_program, LOCKD_BUFSIZE, NULL);
+       serv = svc_create(&nlmsvc_program, LOCKD_BUFSIZE, svc_rpcb_cleanup);
        if (!serv) {
                printk(KERN_WARNING "lockd_up: create service failed\n");
                return ERR_PTR(-ENOMEM);
index 2c1c49ebd84d31e2ef5abe6d68c5598ec27ba9c3..a06a891012e5223a9584ac4c8c0ece06dc429dc0 100644 (file)
@@ -482,9 +482,6 @@ __svc_create(struct svc_program *prog, unsigned int bufsize, int npools,
                spin_lock_init(&pool->sp_lock);
        }
 
-       if (svc_uses_rpcbind(serv) && (!serv->sv_shutdown))
-               serv->sv_shutdown = svc_rpcb_cleanup;
-
        return serv;
 }