linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stanislav Kinsbursky <skinsbursky@parallels.com>
To: bfields@fieldses.org, Trond.Myklebust@netapp.com
Cc: linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org,
	devel@openvz.org
Subject: [PATCH 2/6] LockD: use existent per-net data function on service creation
Date: Wed, 25 Apr 2012 18:22:47 +0400	[thread overview]
Message-ID: <20120425142247.22909.7047.stgit@localhost6.localdomain6> (raw)
In-Reply-To: <20120425141934.22909.53047.stgit@localhost6.localdomain6>

This patch also replaces svc_rpcb_setup() with svc_bind().

Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>

---
 fs/lockd/svc.c |   23 +++++++----------------
 1 files changed, 7 insertions(+), 16 deletions(-)

diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c
index 58ddc38..71c6c31 100644
--- a/fs/lockd/svc.c
+++ b/fs/lockd/svc.c
@@ -259,9 +259,9 @@ static int lockd_up_net(struct svc_serv *serv, struct net *net)
 	if (ln->nlmsvc_users++)
 		return 0;
 
-	error = svc_rpcb_setup(serv, net);
+	error = svc_bind(serv, net);
 	if (error)
-		goto err_rpcb;
+		goto err_bind;
 
 	error = make_socks(serv, net);
 	if (error < 0)
@@ -270,7 +270,7 @@ static int lockd_up_net(struct svc_serv *serv, struct net *net)
 
 err_socks:
 	svc_rpcb_cleanup(serv, net);
-err_rpcb:
+err_bind:
 	ln->nlmsvc_users--;
 	return error;
 }
@@ -298,7 +298,6 @@ int lockd_up(struct net *net)
 {
 	struct svc_serv *serv;
 	int		error = 0;
-	struct lockd_net *ln = net_generic(net, lockd_net_id);
 
 	mutex_lock(&nlmsvc_mutex);
 	/*
@@ -324,17 +323,9 @@ int lockd_up(struct net *net)
 		goto out;
 	}
 
-	error = svc_bind(serv, net);
-	if (error < 0) {
-		printk(KERN_WARNING "lockd_up: bind service failed\n");
-		goto destroy_and_out;
-	}
-
-	ln->nlmsvc_users++;
-
-	error = make_socks(serv, net);
+	error = lockd_up_net(serv, net);
 	if (error < 0)
-		goto err_start;
+		goto err_net;
 
 	/*
 	 * Create the kernel thread and wait for it to start.
@@ -367,7 +358,7 @@ int lockd_up(struct net *net)
 	 * Note: svc_serv structures have an initial use count of 1,
 	 * so we exit through here on both success and failure.
 	 */
-destroy_and_out:
+err_net:
 	svc_destroy(serv);
 out:
 	if (!error)
@@ -377,7 +368,7 @@ out:
 
 err_start:
 	lockd_down_net(serv, net);
-	goto destroy_and_out;
+	goto err_net;
 }
 EXPORT_SYMBOL_GPL(lockd_up);
 


  parent reply	other threads:[~2012-04-25 14:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-25 14:22 [PATCH 0/6] Lockd: service start cleanup patch set Stanislav Kinsbursky
2012-04-25 14:22 ` [PATCH 1/6] LockD: pass service to per-net up and down functions Stanislav Kinsbursky
2012-04-25 14:22 ` Stanislav Kinsbursky [this message]
2012-04-25 14:22 ` [PATCH 3/6] LockD: service creation function introduced Stanislav Kinsbursky
2012-04-25 14:23 ` [PATCH 4/6] LockD: move global usage counter manipulation from error path Stanislav Kinsbursky
2012-04-25 14:23 ` [PATCH 5/6] LockD: service start function introduced Stanislav Kinsbursky
2012-04-25 14:23 ` [PATCH 6/6] LockD: add debug message to start and stop functions Stanislav Kinsbursky
2012-05-09 19:08 ` [PATCH 0/6] Lockd: service start cleanup patch set J. Bruce Fields
2012-05-09 21:04   ` Stanislav Kinsbursky
2012-05-11 11:04   ` Stanislav Kinsbursky

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=20120425142247.22909.7047.stgit@localhost6.localdomain6 \
    --to=skinsbursky@parallels.com \
    --cc=Trond.Myklebust@netapp.com \
    --cc=bfields@fieldses.org \
    --cc=devel@openvz.org \
    --cc=linux-kernel@vger.kernel.org \
    --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).