MCPcopy Create free account
hub / github.com/ceph/ceph / handle

Method handle

src/mon/FSCommands.cc:370–406  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

368 {}
369
370 int handle(
371 Monitor *mon,
372 FSMap& fsmap,
373 MonOpRequestRef op,
374 const cmdmap_t& cmdmap,
375 ostream &ss) override
376 {
377 string fs_name;
378 if (!cmd_getval(cmdmap, "fs_name", fs_name) || fs_name.empty()) {
379 ss << "Missing filesystem name";
380 return -EINVAL;
381 }
382
383 auto* fsp = fsmap.get_filesystem(fs_name);
384 string var;
385 if (!cmd_getval(cmdmap, "var", var) || var.empty()) {
386 ss << "Invalid variable";
387 return -EINVAL;
388 }
389 string val;
390 if (!cmd_getval(cmdmap, "val", val)) {
391 return -EINVAL;
392 }
393
394 bool confirm = false;
395 cmd_getval(cmdmap, "yes_i_really_mean_it", confirm);
396 if (var == "max_mds" && !confirm && mon->mdsmon()->has_any_health_warning()) {
397 ss << "One or more file system health warnings are present. Modifying "
398 << "the file system setting variable \"max_mds\" may not help "
399 << "troubleshoot or recover from these warnings and may further "
400 << "destabilize the system. If you really wish to proceed, run "
401 << "again with --yes-i-really-mean-it";
402 return -EPERM;
403 }
404
405 return set_val(mon, fsmap, op, cmdmap, ss, fsp->get_fscid(), var, val);
406 }
407};
408
409static void modify_filesystem(FSMap& fsmap, auto&& fsv, auto&& fn)

Callers 5

operator()Method · 0.45
_do_watch_notifyMethod · 0.45
interceptMethod · 0.45
prepare_commandMethod · 0.45

Calls 6

get_filesystemMethod · 0.80
mdsmonMethod · 0.80
get_fscidMethod · 0.80
cmd_getvalFunction · 0.70
emptyMethod · 0.45

Tested by

no test coverage detected