linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Trond Myklebust <trond.myklebust@primarydata.com>
To: linux-nfs@vger.kernel.org
Subject: [PATCH 3/6] SUNRPC: Initialise struct svc_serv backchannel fields during __svc_create()
Date: Mon, 29 Aug 2016 20:03:49 -0400	[thread overview]
Message-ID: <1472515432-54202-4-git-send-email-trond.myklebust@primarydata.com> (raw)
In-Reply-To: <1472515432-54202-3-git-send-email-trond.myklebust@primarydata.com>

Clean up.

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
---
 fs/nfs/callback.c |  3 ---
 net/sunrpc/svc.c  | 17 +++++++++++++++++
 2 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/fs/nfs/callback.c b/fs/nfs/callback.c
index 478bb0a7effe..08e16f9b3333 100644
--- a/fs/nfs/callback.c
+++ b/fs/nfs/callback.c
@@ -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;
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index c5b0cb4f4056..7c8070ec93c8 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -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),
-- 
2.7.4


  reply	other threads:[~2016-08-30  0:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-30  0:03 [PATCH 0/6] NFSv4 backchannel improvements Trond Myklebust
2016-08-30  0:03 ` [PATCH 1/6] NFSv4.x: Fix a refcount leak in nfs_callback_up_net Trond Myklebust
2016-08-30  0:03   ` [PATCH 2/6] NFSv4.x: Set up struct svc_serv_ops for the callback channel Trond Myklebust
2016-08-30  0:03     ` Trond Myklebust [this message]
2016-08-30  0:03       ` [PATCH 4/6] NFSv4.x: Fix up the global tracking of the callback server Trond Myklebust
2016-08-30  0:03         ` [PATCH 5/6] NFSv4.x: Switch to using svc_set_num_threads() to manage the callback threads Trond Myklebust
2016-08-30  0:03           ` [PATCH 6/6] NFSv4.x: Add kernel parameter to control the callback server Trond Myklebust

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1472515432-54202-4-git-send-email-trond.myklebust@primarydata.com \
    --to=trond.myklebust@primarydata.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).