SUNRPC: Initialise struct svc_serv backchannel fields during __svc_create()
authorTrond Myklebust <trond.myklebust@primarydata.com>
Tue, 30 Aug 2016 00:03:49 +0000 (20:03 -0400)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Mon, 19 Sep 2016 17:08:36 +0000 (13:08 -0400)
Clean up.

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
fs/nfs/callback.c
net/sunrpc/svc.c

index 478bb0a7effedffe51b38674908b33207594ac75..08e16f9b333363a884a626485226a9c63566412f 100644 (file)
@@ -147,9 +147,6 @@ nfs41_callback_up(struct svc_serv *serv)
 {
        struct svc_rqst *rqstp;
 
-       INIT_LIST_HEAD(&serv->sv_cb_list);
-       spin_lock_init(&serv->sv_cb_lock);
-       init_waitqueue_head(&serv->sv_cb_waitq);
        rqstp = svc_prepare_thread(serv, &serv->sv_pools[0], NUMA_NO_NODE);
        dprintk("--> %s return %d\n", __func__, PTR_ERR_OR_ZERO(rqstp));
        return rqstp;
index c5b0cb4f4056c4da0a0adc556cf46bebb48d2e7a..7c8070ec93c8a74b9735e7b388c2de404141a0df 100644 (file)
@@ -401,6 +401,21 @@ int svc_bind(struct svc_serv *serv, struct net *net)
 }
 EXPORT_SYMBOL_GPL(svc_bind);
 
+#if defined(CONFIG_SUNRPC_BACKCHANNEL)
+static void
+__svc_init_bc(struct svc_serv *serv)
+{
+       INIT_LIST_HEAD(&serv->sv_cb_list);
+       spin_lock_init(&serv->sv_cb_lock);
+       init_waitqueue_head(&serv->sv_cb_waitq);
+}
+#else
+static void
+__svc_init_bc(struct svc_serv *serv)
+{
+}
+#endif
+
 /*
  * Create an RPC service
  */
@@ -443,6 +458,8 @@ __svc_create(struct svc_program *prog, unsigned int bufsize, int npools,
        init_timer(&serv->sv_temptimer);
        spin_lock_init(&serv->sv_lock);
 
+       __svc_init_bc(serv);
+
        serv->sv_nrpools = npools;
        serv->sv_pools =
                kcalloc(serv->sv_nrpools, sizeof(struct svc_pool),