All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chuck Lever <chuck.lever@oracle.com>
To: bfields@fieldses.org
Cc: linux-nfs@vger.kernel.org
Subject: [PATCH 08/11] NSM: Move nsm_create()
Date: Thu, 11 Dec 2008 17:56:37 -0500	[thread overview]
Message-ID: <20081211225636.21468.36639.stgit@ingres.1015granger.net> (raw)
In-Reply-To: <20081211224543.21468.8939.stgit-07a7zB5ZJzbwdl/1UfZZQIVfYA8g3rJ/@public.gmane.org>

Clean up: one last thing... relocate nsm_create() to eliminate the forward
declaration and group it near the only function that actually uses it.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---

 fs/lockd/mon.c |   51 ++++++++++++++++++++-------------------------------
 1 files changed, 20 insertions(+), 31 deletions(-)

diff --git a/fs/lockd/mon.c b/fs/lockd/mon.c
index cd8db11..0027843 100644
--- a/fs/lockd/mon.c
+++ b/fs/lockd/mon.c
@@ -44,8 +44,6 @@ struct nsm_res {
 	u32			state;
 };
 
-static struct rpc_clnt *	nsm_create(void);
-
 static struct rpc_program	nsm_program;
 static				LIST_HEAD(nsm_handles);
 static				DEFINE_SPINLOCK(nsm_lock);
@@ -99,11 +97,26 @@ static void nsm_display_address(const struct sockaddr *sap,
 	}
 }
 
-/*
- * Common procedure for NSMPROC_MON/NSMPROC_UNMON calls
- */
-static int
-nsm_mon_unmon(struct nsm_handle *nsm, u32 proc, struct nsm_res *res)
+static struct rpc_clnt *nsm_create(void)
+{
+	struct sockaddr_in sin = {
+		.sin_family		= AF_INET,
+		.sin_addr.s_addr	= htonl(INADDR_LOOPBACK),
+	};
+	struct rpc_create_args args = {
+		.protocol		= XPRT_TRANSPORT_UDP,
+		.address		= (struct sockaddr *)&sin,
+		.addrsize		= sizeof(sin),
+		.servername		= "rpc.statd",
+		.program		= &nsm_program,
+		.version		= NSM_VERSION,
+		.authflavor		= RPC_AUTH_NULL,
+	};
+
+	return rpc_create(&args);
+}
+
+static int nsm_mon_unmon(struct nsm_handle *nsm, u32 proc, struct nsm_res *res)
 {
 	struct rpc_clnt	*clnt;
 	int		status;
@@ -410,30 +423,6 @@ void nsm_release(struct nsm_handle *nsm)
 }
 
 /*
- * Create NSM client for the local host
- */
-static struct rpc_clnt *
-nsm_create(void)
-{
-	struct sockaddr_in	sin = {
-		.sin_family	= AF_INET,
-		.sin_addr.s_addr = htonl(INADDR_LOOPBACK),
-		.sin_port	= 0,
-	};
-	struct rpc_create_args args = {
-		.protocol	= XPRT_TRANSPORT_UDP,
-		.address	= (struct sockaddr *)&sin,
-		.addrsize	= sizeof(sin),
-		.servername	= "localhost",
-		.program	= &nsm_program,
-		.version	= NSM_VERSION,
-		.authflavor	= RPC_AUTH_NULL,
-	};
-
-	return rpc_create(&args);
-}
-
-/*
  * XDR functions for NSM.
  *
  * See http://www.opengroup.org/ for details on the Network


  parent reply	other threads:[~2008-12-11 22:56 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-11 22:55 [PATCH 00/11] Replacement patches for NSM IPv6 support Chuck Lever
     [not found] ` <20081211224543.21468.8939.stgit-07a7zB5ZJzbwdl/1UfZZQIVfYA8g3rJ/@public.gmane.org>
2008-12-11 22:55   ` [PATCH 01/11] NLM: Remove "create" argument from nsm_find() Chuck Lever
2008-12-11 22:55   ` [PATCH 02/11] NSM: Refactor nsm_handle creation into a helper function Chuck Lever
2008-12-11 22:55   ` [PATCH 03/11] NSM: More clean up of nsm_get_handle() Chuck Lever
2008-12-11 22:56   ` [PATCH 04/11] NSM: Replace IP address as our nlm_reboot lookup key Chuck Lever
2008-12-11 22:56   ` [PATCH 05/11] NSM: Remove include/linux/lockd/sm_inter.h Chuck Lever
2008-12-11 22:56   ` [PATCH 06/11] NSM: Move nsm_addr() to fs/lockd/mon.c Chuck Lever
2008-12-11 22:56   ` [PATCH 07/11] NSM: Move nsm_use_hostnames to mon.c Chuck Lever
2008-12-11 22:56   ` Chuck Lever [this message]
2008-12-11 22:56   ` [PATCH 09/11] NLM: nlm_privileged_requester() doesn't recognize mapped loopback address Chuck Lever
2008-12-11 22:56   ` [PATCH 10/11] NLM: Rewrite IPv4 privileged requester's check Chuck Lever
2008-12-11 22:56   ` [PATCH 11/11] lockd: Enable NLM use of AF_INET6 Chuck Lever
2008-12-12 18:59   ` [PATCH 00/11] Replacement patches for NSM IPv6 support J. Bruce Fields
2008-12-12 20:17     ` Chuck Lever

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=20081211225636.21468.36639.stgit@ingres.1015granger.net \
    --to=chuck.lever@oracle.com \
    --cc=bfields@fieldses.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.