Skip to content

Commit cffaba1

Browse files
author
Alex Elder
committed
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>
1 parent d3002b9 commit cffaba1

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

‎fs/ceph/super.c‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,12 @@ enum {
130130
Opt_nodirstat,
131131
Opt_rbytes,
132132
Opt_norbytes,
133+
Opt_asyncreaddir,
133134
Opt_noasyncreaddir,
134135
Opt_dcache,
135136
Opt_nodcache,
136137
Opt_ino32,
138+
Opt_noino32,
137139
};
138140

139141
static match_table_t fsopt_tokens = {
@@ -153,10 +155,12 @@ static match_table_t fsopt_tokens = {
153155
{Opt_nodirstat, "nodirstat"},
154156
{Opt_rbytes, "rbytes"},
155157
{Opt_norbytes, "norbytes"},
158+
{Opt_asyncreaddir, "asyncreaddir"},
156159
{Opt_noasyncreaddir, "noasyncreaddir"},
157160
{Opt_dcache, "dcache"},
158161
{Opt_nodcache, "nodcache"},
159162
{Opt_ino32, "ino32"},
163+
{Opt_noino32, "noino32"},
160164
{-1, NULL}
161165
};
162166

@@ -232,6 +236,9 @@ static int parse_fsopt_token(char *c, void *private)
232236
case Opt_norbytes:
233237
fsopt->flags &= ~CEPH_MOUNT_OPT_RBYTES;
234238
break;
239+
case Opt_asyncreaddir:
240+
fsopt->flags &= ~CEPH_MOUNT_OPT_NOASYNCREADDIR;
241+
break;
235242
case Opt_noasyncreaddir:
236243
fsopt->flags |= CEPH_MOUNT_OPT_NOASYNCREADDIR;
237244
break;
@@ -244,6 +251,9 @@ static int parse_fsopt_token(char *c, void *private)
244251
case Opt_ino32:
245252
fsopt->flags |= CEPH_MOUNT_OPT_INO32;
246253
break;
254+
case Opt_noino32:
255+
fsopt->flags &= ~CEPH_MOUNT_OPT_INO32;
256+
break;
247257
default:
248258
BUG_ON(token);
249259
}

‎net/ceph/ceph_common.c‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,9 @@ enum {
201201
Opt_ip,
202202
Opt_last_string,
203203
/* string args above */
204+
Opt_share,
204205
Opt_noshare,
206+
Opt_crc,
205207
Opt_nocrc,
206208
};
207209

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

406+
case Opt_share:
407+
opt->flags &= ~CEPH_OPT_NOSHARE;
408+
break;
402409
case Opt_noshare:
403410
opt->flags |= CEPH_OPT_NOSHARE;
404411
break;
405412

413+
case Opt_crc:
414+
opt->flags &= ~CEPH_OPT_NOCRC;
415+
break;
406416
case Opt_nocrc:
407417
opt->flags |= CEPH_OPT_NOCRC;
408418
break;

0 commit comments

Comments
 (0)