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

Method execute_command

src/common/admin_socket.cc:474–503  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

472}
473
474int AdminSocket::execute_command(
475 const std::vector<std::string>& cmd,
476 const bufferlist& inbl,
477 std::ostream& errss,
478 bufferlist *outbl)
479{
480#ifdef WITH_CRIMSON
481 // TODO: crimson: blocking execute_command() in alien thread
482 return -ENOSYS;
483#else
484 bool done = false;
485 int rval = 0;
486 ceph::mutex mylock = ceph::make_mutex("admin_socket::excute_command::mylock");
487 ceph::condition_variable mycond;
488 C_SafeCond fin(mylock, mycond, &done, &rval);
489 execute_command(
490 cmd,
491 inbl,
492 [&errss, outbl, &fin](int r, std::string_view err, bufferlist& out) {
493 errss << err;
494 *outbl = std::move(out);
495 fin.finish(r);
496 });
497 {
498 std::unique_lock l{mylock};
499 mycond.wait(l, [&done] { return done;});
500 }
501 return rval;
502#endif
503}
504
505void AdminSocket::execute_command(
506 const std::vector<std::string>& cmdvec,

Callers 2

get_perf_countersMethod · 0.45
mainFunction · 0.45

Calls 15

make_mutexFunction · 0.85
execute_commandFunction · 0.85
cmdmap_from_jsonFunction · 0.85
assertFunction · 0.85
cmd_getvalFunction · 0.70
createFunction · 0.70
finishMethod · 0.45
waitMethod · 0.45
strMethod · 0.45
emptyMethod · 0.45
dataMethod · 0.45
is_openMethod · 0.45

Tested by

no test coverage detected