aboutsummaryrefslogtreecommitdiffstats
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
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>
-rw-r--r--fs/ceph/super.c10
-rw-r--r--net/ceph/ceph_common.c10
2 files changed, 20 insertions, 0 deletions
diff --git a/fs/ceph/super.c b/fs/ceph/super.c
index 4fab1fdcfa6a..3663cf0cb073 100644
--- a/fs/ceph/super.c
+++ b/fs/ceph/super.c
@@ -130,10 +130,12 @@ enum {
130 Opt_nodirstat, 130 Opt_nodirstat,
131 Opt_rbytes, 131 Opt_rbytes,
132 Opt_norbytes, 132 Opt_norbytes,
133 Opt_asyncreaddir,
133 Opt_noasyncreaddir, 134 Opt_noasyncreaddir,
134 Opt_dcache, 135 Opt_dcache,
135 Opt_nodcache, 136 Opt_nodcache,
136 Opt_ino32, 137 Opt_ino32,
138 Opt_noino32,
137}; 139};
138 140
139static match_table_t fsopt_tokens = { 141static match_table_t fsopt_tokens = {
@@ -153,10 +155,12 @@ static match_table_t fsopt_tokens = {
153 {Opt_nodirstat, "nodirstat"}, 155 {Opt_nodirstat, "nodirstat"},
154 {Opt_rbytes, "rbytes"}, 156 {Opt_rbytes, "rbytes"},
155 {Opt_norbytes, "norbytes"}, 157 {Opt_norbytes, "norbytes"},
158 {Opt_asyncreaddir, "asyncreaddir"},
156 {Opt_noasyncreaddir, "noasyncreaddir"}, 159 {Opt_noasyncreaddir, "noasyncreaddir"},
157 {Opt_dcache, "dcache"}, 160 {Opt_dcache, "dcache"},
158 {Opt_nodcache, "nodcache"}, 161 {Opt_nodcache, "nodcache"},
159 {Opt_ino32, "ino32"}, 162 {Opt_ino32, "ino32"},
163 {Opt_noino32, "noino32"},
160 {-1, NULL} 164 {-1, NULL}
161}; 165};
162 166
@@ -232,6 +236,9 @@ static int parse_fsopt_token(char *c, void *private)
232 case Opt_norbytes: 236 case Opt_norbytes:
233 fsopt->flags &= ~CEPH_MOUNT_OPT_RBYTES; 237 fsopt->flags &= ~CEPH_MOUNT_OPT_RBYTES;
234 break; 238 break;
239 case Opt_asyncreaddir:
240 fsopt->flags &= ~CEPH_MOUNT_OPT_NOASYNCREADDIR;
241 break;
235 case Opt_noasyncreaddir: 242 case Opt_noasyncreaddir:
236 fsopt->flags |= CEPH_MOUNT_OPT_NOASYNCREADDIR; 243 fsopt->flags |= CEPH_MOUNT_OPT_NOASYNCREADDIR;
237 break; 244 break;
@@ -244,6 +251,9 @@ static int parse_fsopt_token(char *c, void *private)
244 case Opt_ino32: 251 case Opt_ino32:
245 fsopt->flags |= CEPH_MOUNT_OPT_INO32; 252 fsopt->flags |= CEPH_MOUNT_OPT_INO32;
246 break; 253 break;
254 case Opt_noino32:
255 fsopt->flags &= ~CEPH_MOUNT_OPT_INO32;
256 break;
247 default: 257 default:
248 BUG_ON(token); 258 BUG_ON(token);
249 } 259 }
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;