All of lore.kernel.org
 help / color / mirror / Atom feed
From: Scott Mayhew <smayhew@redhat.com>
To: linux-nfs@vger.kernel.org
Subject: [nfs-utils PATCH 4/4] mount.nfs:  clean up conf_parse_mntopts()
Date: Tue, 13 Aug 2013 15:20:29 -0400	[thread overview]
Message-ID: <1376421629-21382-5-git-send-email-smayhew@redhat.com> (raw)
In-Reply-To: <1376421629-21382-1-git-send-email-smayhew@redhat.com>

It's no longer necessary for conf_parse_mntopts to explicitly check for
argtype != MNT_NOARG after calling should_add_noarg_opt().

Signed-off-by: Scott Mayhew <smayhew@redhat.com>
---
 utils/mount/configfile.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/utils/mount/configfile.c b/utils/mount/configfile.c
index 623c886..8f68a6e 100644
--- a/utils/mount/configfile.c
+++ b/utils/mount/configfile.c
@@ -364,15 +364,12 @@ conf_parse_mntopts(char *section, char *arg, char *opts)
 			}
 			continue;
 		}
-		if (argtype != MNT_NOARG) {
-			snprintf(buf, BUFSIZ, "no%s", field);
-			if (lookup_entry(buf) != NULL)
-				continue;
-			buf[0] = '\0';
-		}
+		snprintf(buf, BUFSIZ, "no%s", field);
+		if (lookup_entry(buf) != NULL)
+			continue;
+		buf[0] = '\0';
 		if (strcasecmp(value, "false") == 0) {
-			if (argtype != MNT_NOARG)
-				snprintf(buf, BUFSIZ, "no%s", field);
+			snprintf(buf, BUFSIZ, "no%s", field);
 		} else if (strcasecmp(value, "true") == 0) {
 			snprintf(buf, BUFSIZ, "%s", field);
 		} else {
-- 
1.7.11.7


      parent reply	other threads:[~2013-08-13 19:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-13 19:20 [nfs-utils PATCH 0/4] Improve nfsmount.conf configuration parsing Scott Mayhew
2013-08-13 19:20 ` [nfs-utils PATCH 1/4] mount.nfs: avoid unnecessary duplication of options passed to mount(2) Scott Mayhew
2013-08-13 19:30   ` Chuck Lever
2013-08-13 22:39     ` Scott Mayhew
2013-08-14  1:29       ` Chuck Lever
2013-08-14 14:24         ` Scott Mayhew
2013-08-13 19:20 ` [nfs-utils PATCH 2/4] mount.nfs: avoid sending conflicting mount options Scott Mayhew
2013-08-13 19:20 ` [nfs-utils PATCH 3/4] mount.nfs: improve handling of MNT_NOARG type options Scott Mayhew
2013-08-13 19:32   ` Chuck Lever
2013-08-13 22:45     ` Scott Mayhew
2013-08-14  1:46       ` Chuck Lever
2013-08-13 19:20 ` Scott Mayhew [this message]

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=1376421629-21382-5-git-send-email-smayhew@redhat.com \
    --to=smayhew@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 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.