All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Elder <elder@dreamhost.com>
To: ceph-devel@vger.kernel.org
Subject: [PATCH] ceph: ensure Boolean options support both senses
Date: Tue, 28 Feb 2012 20:47:12 -0800	[thread overview]
Message-ID: <4F4DADD0.2020707@dreamhost.com> (raw)

Many ceph-related Boolean options offer the ability to both enable
and disable a feature.  For all those that don't offer this, add
a new option so that they do.

Note that ceph_show_options()--which reports mount options currently
in effect--only reports the option if it is different from the
default value.

Signed-off-by: Alex Elder <elder@dreamhost.com>
---
  fs/ceph/super.c        |   10 ++++++++++
  net/ceph/ceph_common.c |   10 ++++++++++
  2 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/fs/ceph/super.c b/fs/ceph/super.c
index 1d325bc..8e497a6 100644
--- a/fs/ceph/super.c
+++ b/fs/ceph/super.c
@@ -130,8 +130,10 @@ enum {
  	Opt_nodirstat,
  	Opt_rbytes,
  	Opt_norbytes,
+	Opt_asyncreaddir,
  	Opt_noasyncreaddir,
  	Opt_ino32,
+	Opt_noino32,
  };

  static match_table_t fsopt_tokens = {
@@ -151,8 +153,10 @@ static match_table_t fsopt_tokens = {
  	{Opt_nodirstat, "nodirstat"},
  	{Opt_rbytes, "rbytes"},
  	{Opt_norbytes, "norbytes"},
+	{Opt_asyncreaddir, "asyncreaddir"},
  	{Opt_noasyncreaddir, "noasyncreaddir"},
  	{Opt_ino32, "ino32"},
+	{Opt_noino32, "noino32"},
  	{-1, NULL}
  };

@@ -228,12 +232,18 @@ static int parse_fsopt_token(char *c, void *private)
  	case Opt_norbytes:
  		fsopt->flags &= ~CEPH_MOUNT_OPT_RBYTES;
  		break;
+	case Opt_asyncreaddir:
+		fsopt->flags &= ~CEPH_MOUNT_OPT_NOASYNCREADDIR;
+		break;
  	case Opt_noasyncreaddir:
  		fsopt->flags |= CEPH_MOUNT_OPT_NOASYNCREADDIR;
  		break;
  	case Opt_ino32:
  		fsopt->flags |= CEPH_MOUNT_OPT_INO32;
  		break;
+	case Opt_noino32:
+		fsopt->flags &= ~CEPH_MOUNT_OPT_INO32;
+		break;
  	default:
  		BUG_ON(token);
  	}
diff --git a/net/ceph/ceph_common.c b/net/ceph/ceph_common.c
index 621c322..cc91319 100644
--- a/net/ceph/ceph_common.c
+++ b/net/ceph/ceph_common.c
@@ -201,7 +201,9 @@ enum {
  	Opt_ip,
  	Opt_last_string,
  	/* string args above */
+	Opt_share,
  	Opt_noshare,
+	Opt_crc,
  	Opt_nocrc,
  };

@@ -217,7 +219,9 @@ static match_table_t opt_tokens = {
  	{Opt_key, "key=%s"},
  	{Opt_ip, "ip=%s"},
  	/* string args above */
+	{Opt_share, "share"},
  	{Opt_noshare, "noshare"},
+	{Opt_crc, "crc"},
  	{Opt_nocrc, "nocrc"},
  	{-1, NULL}
  };
@@ -399,10 +403,16 @@ ceph_parse_options(char *options, const char 
*dev_name,
  			opt->mount_timeout = intval;
  			break;

+		case Opt_share:
+			opt->flags &= ~CEPH_OPT_NOSHARE;
+			break;
  		case Opt_noshare:
  			opt->flags |= CEPH_OPT_NOSHARE;
  			break;

+		case Opt_crc:
+			opt->flags &= ~CEPH_OPT_NOCRC;
+			break;
  		case Opt_nocrc:
  			opt->flags |= CEPH_OPT_NOCRC;
  			break;
-- 
1.7.5.4


             reply	other threads:[~2012-02-29  4:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-29  4:47 Alex Elder [this message]
2012-03-02 21:44 ` [PATCH] ceph: ensure Boolean options support both senses Sage Weil

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=4F4DADD0.2020707@dreamhost.com \
    --to=elder@dreamhost.com \
    --cc=ceph-devel@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.