aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorAlex Elder <elder@dreamhost.com>2012-02-15 08:43:54 -0500
committerAlex Elder <elder@dreamhost.com>2012-03-22 11:47:51 -0400
commitcffaba15cd95d4a16eb5a6aa5c22a79f67d555ab (patch)
treed752174022e8444c70afb27e798e032163f89ac9 /net
parentd3002b974cefbb7c1e325cc296966f768ff76b06 (diff)
ceph: ensure Boolean options support both senses
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> Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'net')
-rw-r--r--net/ceph/ceph_common.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/net/ceph/ceph_common.c b/net/ceph/ceph_common.c
index 621c3221b393..cc913193d992 100644
--- a/net/ceph/ceph_common.c
+++ b/net/ceph/ceph_common.c
@@ -201,7 +201,9 @@ enum {
201 Opt_ip, 201 Opt_ip,
202 Opt_last_string, 202 Opt_last_string,
203 /* string args above */ 203 /* string args above */
204 Opt_share,
204 Opt_noshare, 205 Opt_noshare,
206 Opt_crc,
205 Opt_nocrc, 207 Opt_nocrc,
206}; 208};
207 209
@@ -217,7 +219,9 @@ static match_table_t opt_tokens = {
217 {Opt_key, "key=%s"}, 219 {Opt_key, "key=%s"},
218 {Opt_ip, "ip=%s"}, 220 {Opt_ip, "ip=%s"},
219 /* string args above */ 221 /* string args above */
222 {Opt_share, "share"},
220 {Opt_noshare, "noshare"}, 223 {Opt_noshare, "noshare"},
224 {Opt_crc, "crc"},
221 {Opt_nocrc, "nocrc"}, 225 {Opt_nocrc, "nocrc"},
222 {-1, NULL} 226 {-1, NULL}
223}; 227};
@@ -399,10 +403,16 @@ ceph_parse_options(char *options, const char *dev_name,
399 opt->mount_timeout = intval; 403 opt->mount_timeout = intval;
400 break; 404 break;
401 405
406 case Opt_share:
407 opt->flags &= ~CEPH_OPT_NOSHARE;
408 break;
402 case Opt_noshare: 409 case Opt_noshare:
403 opt->flags |= CEPH_OPT_NOSHARE; 410 opt->flags |= CEPH_OPT_NOSHARE;
404 break; 411 break;
405 412
413 case Opt_crc:
414 opt->flags &= ~CEPH_OPT_NOCRC;
415 break;
406 case Opt_nocrc: 416 case Opt_nocrc:
407 opt->flags |= CEPH_OPT_NOCRC; 417 opt->flags |= CEPH_OPT_NOCRC;
408 break; 418 break;