From: Chuck Lever <chuck.lever@oracle.com>
To: steved@redhat.com
Cc: linux-nfs@vger.kernel.org
Subject: [PATCH 2/3] libexport.a: Clean up client_add()
Date: Mon, 03 May 2010 15:24:14 -0400 [thread overview]
Message-ID: <20100503192414.29316.84745.stgit@localhost.localdomain> (raw)
In-Reply-To: <20100503192041.29316.35846.stgit-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
Clean up: client_add()'s current callers never set unknown m_type
values, so the m_type check is unnecessary.
All of client_add()'s callers are in the same source file where it is
defined, so make it a static helper function.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
support/export/client.c | 26 ++++++++++++--------------
support/include/exportfs.h | 1 -
2 files changed, 12 insertions(+), 15 deletions(-)
diff --git a/support/export/client.c b/support/export/client.c
index 9259180..4600255 100644
--- a/support/export/client.c
+++ b/support/export/client.c
@@ -113,6 +113,18 @@ client_init(nfs_client *clp, const char *hname, const struct hostent *hp)
return 1;
}
+static void
+client_add(nfs_client *clp)
+{
+ nfs_client **cpp;
+
+ cpp = &clientlist[clp->m_type];
+ while (*cpp != NULL)
+ cpp = &((*cpp)->m_next);
+ clp->m_next = NULL;
+ *cpp = clp;
+}
+
/* if canonical is set, then we *know* this is already a canonical name
* so hostname lookup is avoided.
* This is used when reading /proc/fs/nfs/exports
@@ -209,20 +221,6 @@ client_dup(nfs_client *clp, struct hostent *hp)
}
void
-client_add(nfs_client *clp)
-{
- nfs_client **cpp;
-
- if (clp->m_type < 0 || clp->m_type >= MCL_MAXTYPES)
- xlog(L_FATAL, "unknown client type in client_add");
- cpp = clientlist + clp->m_type;
- while (*cpp)
- cpp = &((*cpp)->m_next);
- clp->m_next = NULL;
- *cpp = clp;
-}
-
-void
client_release(nfs_client *clp)
{
if (clp->m_count <= 0)
diff --git a/support/include/exportfs.h b/support/include/exportfs.h
index 9a19cbb..05891c5 100644
--- a/support/include/exportfs.h
+++ b/support/include/exportfs.h
@@ -69,7 +69,6 @@ extern exp_hash_table exportlist[MCL_MAXTYPES];
extern nfs_client * clientlist[MCL_MAXTYPES];
nfs_client * client_lookup(char *hname, int canonical);
-void client_add(nfs_client *);
nfs_client * client_dup(nfs_client *, struct hostent *);
int client_gettype(char *hname);
int client_check(nfs_client *, struct hostent *);
next prev parent reply other threads:[~2010-05-03 19:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-03 19:23 [PATCH 0/3] Three more IPv6-related mountd patches Chuck Lever
[not found] ` <20100503192041.29316.35846.stgit-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2010-05-03 19:24 ` [PATCH 1/3] libexport.a: Refactor client_init() Chuck Lever
2010-05-03 19:24 ` Chuck Lever [this message]
2010-05-03 19:24 ` [PATCH 3/3] mountd/exportfs: Make m_addrlist field a nfs_sockaddr Chuck Lever
2010-05-05 19:39 ` [PATCH 0/3] Three more IPv6-related mountd patches Steve Dickson
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=20100503192414.29316.84745.stgit@localhost.localdomain \
--to=chuck.lever@oracle.com \
--cc=linux-nfs@vger.kernel.org \
--cc=steved@redhat.com \
/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