This makes the management interface a bit more consistent.
Signed-off-by: Sage Weil <sage@inktank.com>
ceph mds set_max_mds 3
ceph mds set max_mds 4
expect_false ceph mds set max_mds asdf
+expect_false ceph mds set inline_data true
+ceph mds set inline_data true --yes-i-really-mean-it
+ceph mds set inline_data yes --yes-i-really-mean-it
+ceph mds set inline_data 1 --yes-i-really-mean-it
+expect_false ceph mds set inline_data --yes-i-really-mean-it
+ceph mds set inline_data false
+ceph mds set inline_data no
+ceph mds set inline_data 0
+expect_false ceph mds set inline_data asdf
ceph mds set max_file_size 1000000000
expect_false ceph mds set max_file_size 123asdf
if (interr.length())
goto out;
pending_mdsmap.max_mds = n;
+ } else if (var == "inline_data") {
+ if (val == "true" || val == "yes" || (!interr.length() && n == 1)) {
+ string confirm;
+ if (!cmd_getval(g_ceph_context, cmdmap, "confirm", confirm) ||
+ confirm != "--yes-i-really-mean-it") {
+ ss << "inline data is new and experimental; you must specify --yes-i-really-mean-it";
+ r = -EPERM;
+ goto out;
+ }
+ ss << "inline data enabled";
+ pending_mdsmap.set_inline_data_enabled(true);
+ pending_mdsmap.compat.incompat.insert(MDS_FEATURE_INCOMPAT_INLINE);
+ } else if (val == "false" || val == "no" ||
+ (!interr.length() && n == 0)) {
+ ss << "inline data disabled";
+ pending_mdsmap.set_inline_data_enabled(false);
+ } else {
+ ss << "value must be false|no|0 or true|yes|1";
+ r = -EINVAL;
+ goto out;
+ }
} else if (var == "max_file_size") {
if (interr.length()) {
ss << var << " requires an integer value";
r = 0;
}
- } else if (prefix == "mds inline enable") {
- pending_mdsmap.set_inline_data_enabled(true);
- pending_mdsmap.compat.incompat.insert(MDS_FEATURE_INCOMPAT_INLINE);
- r = 0;
- } else if (prefix == "mds inline disable") {
- pending_mdsmap.set_inline_data_enabled(false);
- r = 0;
} else if (prefix == "mds add_data_pool") {
string poolname;
cmd_getval(g_ceph_context, cmdmap, "pool", poolname);
"name=maxmds,type=CephInt,range=0", \
"set max MDS index", "mds", "rw", "cli,rest")
COMMAND("mds set " \
- "name=var,type=CephChoices,strings=max_mds|max_file_size|allow_new_snaps " \
+ "name=var,type=CephChoices,strings=max_mds|max_file_size|allow_new_snaps|inline_data " \
"name=val,type=CephString " \
"name=confirm,type=CephString,req=false", \
"set mds parameter <var> to <val>", "mds", "rw", "cli,rest")
COMMAND("mds compat rm_incompat " \
"name=feature,type=CephInt,range=0", \
"remove incompatible feature", "mds", "rw", "cli,rest")
-COMMAND("mds inline enable", \
- "enable inline data feature", \
- "mds", "rw", "cli,rest")
-COMMAND("mds inline disable", \
- "disable inline data feature", \
- "mds", "rw", "cli,rest")
COMMAND("mds add_data_pool " \
"name=pool,type=CephString", \
"add data pool <pool>", "mds", "rw", "cli,rest")