From: Steve Dickson <steved@redhat.com>
To: Linux NFS Mailing list <linux-nfs@vger.kernel.org>
Subject: [PATCH 1/2] mountd: Cleanup how config options are read in
Date: Mon, 1 Feb 2021 18:01:46 -0500 [thread overview]
Message-ID: <20210201230147.45593-1-steved@redhat.com> (raw)
Signed-off-by: Steve Dickson <steved@redhat.com>
---
utils/mountd/mountd.c | 49 +++++++++++++++++++++++++------------------
1 file changed, 29 insertions(+), 20 deletions(-)
diff --git a/utils/mountd/mountd.c b/utils/mountd/mountd.c
index 07bcdc5a..988e51c5 100644
--- a/utils/mountd/mountd.c
+++ b/utils/mountd/mountd.c
@@ -661,30 +661,17 @@ get_exportlist(void)
return elist;
}
-int
-main(int argc, char **argv)
+int vers;
+int port = 0;
+int descriptors = 0;
+
+inline static void
+read_mount_conf(char **argv)
{
- char *progname;
char *s;
- unsigned int listeners = 0;
- int foreground = 0;
- int port = 0;
- int descriptors = 0;
- int c;
- int vers;
- struct sigaction sa;
- struct rlimit rlim;
-
- /* Set the basename */
- if ((progname = strrchr(argv[0], '/')) != NULL)
- progname++;
- else
- progname = argv[0];
-
- /* Initialize logging. */
- xlog_open(progname);
conf_init_file(NFS_CONFFILE);
+
xlog_from_conffile("mountd");
manage_gids = conf_get_bool("mountd", "manage-gids", manage_gids);
descriptors = conf_get_num("mountd", "descriptors", descriptors);
@@ -714,7 +701,29 @@ main(int argc, char **argv)
else
NFSCTL_VERUNSET(nfs_version, vers);
}
+}
+
+int
+main(int argc, char **argv)
+{
+ char *progname;
+ unsigned int listeners = 0;
+ int foreground = 0;
+ int c;
+ struct sigaction sa;
+ struct rlimit rlim;
+
+ /* Set the basename */
+ if ((progname = strrchr(argv[0], '/')) != NULL)
+ progname++;
+ else
+ progname = argv[0];
+
+ /* Initialize logging. */
+ xlog_open(progname);
+ /* Read in config setting */
+ read_mount_conf(argv);
/* Parse the command line options and arguments. */
opterr = 0;
--
2.29.2
next reply other threads:[~2021-02-01 23:01 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-01 23:01 Steve Dickson [this message]
2021-02-01 23:01 ` [PATCH 2/2] mountd: Add debug processing from nfs.conf Steve Dickson
2021-02-02 17:03 ` Steve Dickson
2021-02-08 0:30 ` NeilBrown
2021-02-08 17:44 ` Steve Dickson
2021-02-08 22:27 ` NeilBrown
2021-02-02 17:02 ` [PATCH 1/2] mountd: Cleanup how config options are read in 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=20210201230147.45593-1-steved@redhat.com \
--to=steved@redhat.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