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

Method register_command

src/common/admin_socket.cc:655–679  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

653}
654
655int AdminSocket::register_command(std::string_view cmddesc,
656 AdminSocketHook *hook,
657 std::string_view help)
658{
659 int ret;
660 std::unique_lock l(lock);
661 string prefix = cmddesc_get_prefix(cmddesc);
662 auto i = hooks.find(prefix);
663 if (i != hooks.cend() &&
664 i->second.desc == cmddesc) {
665 ldout(m_cct, 5) << "register_command " << prefix
666 << " cmddesc " << cmddesc << " hook " << hook
667 << " EEXIST" << dendl;
668 ret = -EEXIST;
669 } else {
670 ldout(m_cct, 5) << "register_command " << prefix << " hook " << hook
671 << dendl;
672 hooks.emplace_hint(i,
673 std::piecewise_construct,
674 std::forward_as_tuple(prefix),
675 std::forward_as_tuple(hook, cmddesc, help));
676 ret = 0;
677 }
678 return ret;
679}
680
681void AdminSocket::unregister_commands(const AdminSocketHook *hook)
682{

Callers 15

WnbdAdminHookMethod · 0.45
MirrorAdminSocketHookMethod · 0.45
register_commandsMethod · 0.45
MirrorAdminSocketHookMethod · 0.45
LibrbdAdminSocketHookMethod · 0.45
_finish_initMethod · 0.45
SocketHookMethod · 0.45
initMethod · 0.45
SocketHookMethod · 0.45

Calls 4

cmddesc_get_prefixFunction · 0.85
findMethod · 0.45
cendMethod · 0.45
emplace_hintMethod · 0.45

Tested by 1

TESTFunction · 0.36