From: Sage Weil Date: Wed, 30 Oct 2019 12:29:05 +0000 (-0500) Subject: mds: remove old handle_command machinery X-Git-Tag: v15.1.0~519^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ea65f084000974e8aafd65d117f181d5baf0d587;p=ceph.git mds: remove old handle_command machinery Signed-off-by: Sage Weil --- diff --git a/src/mds/MDSDaemon.cc b/src/mds/MDSDaemon.cc index 0dc905408336..a2b519cdb672 100644 --- a/src/mds/MDSDaemon.cc +++ b/src/mds/MDSDaemon.cc @@ -650,74 +650,6 @@ const std::vector& MDSDaemon::get_commands() return commands; }; -int MDSDaemon::_handle_command( - const cmdmap_t &cmdmap, - const cref_t &m, - bufferlist *outbl, - std::string *outs, - Context **run_later, - bool *need_reply) -{ - ceph_assert(outbl != NULL); - ceph_assert(outs != NULL); - - std::stringstream ds; - std::stringstream ss; - std::string prefix; - std::string format; - std::unique_ptr f(Formatter::create(format)); - cmd_getval(cct, cmdmap, "prefix", prefix); - - int r = 0; - - if (prefix == "get_command_descriptions") { - int cmdnum = 0; - std::unique_ptr f(std::make_unique()); - f->open_object_section("command_descriptions"); - for (auto& c : get_commands()) { - ostringstream secname; - secname << "cmd" << setfill('0') << std::setw(3) << cmdnum; - dump_cmddesc_to_json(f.get(), m->get_connection()->get_features(), - secname.str(), c.cmdstring, c.helpstring, - c.module, "*", 0); - cmdnum++; - } - f->close_section(); // command_descriptions - - f->flush(ds); - goto out; - } - - cmd_getval(cct, cmdmap, "format", format); - if (true) { - // Give MDSRank a shot at the command - if (!mds_rank) { - ss << "MDS not active"; - r = -EINVAL; - } - else { - bool handled; - try { - handled = mds_rank->handle_command(cmdmap, m, &r, &ds, &ss, - run_later, need_reply); - if (!handled) { - // MDSDaemon doesn't know this command - ss << "unrecognized command! " << prefix; - r = -EINVAL; - } - } catch (const bad_cmd_get& e) { - ss << e.what(); - r = -EINVAL; - } - } - } - -out: - *outs = ss.str(); - outbl->append(ds); - return r; -} - void MDSDaemon::handle_mds_map(const cref_t &m) { version_t epoch = m->get_epoch(); diff --git a/src/mds/MDSDaemon.h b/src/mds/MDSDaemon.h index a3117679862c..b511e9f16984 100644 --- a/src/mds/MDSDaemon.h +++ b/src/mds/MDSDaemon.h @@ -122,13 +122,6 @@ class MDSDaemon : public Dispatcher { static void send_command_reply(const cref_t &m, MDSRank* mds_rank, int r, bufferlist outbl, std::string_view outs); - int _handle_command( - const cmdmap_t &cmdmap, - const cref_t &m, - bufferlist *outbl, - std::string *outs, - Context **run_later, - bool *need_reply); void handle_command(const cref_t &m); void handle_mds_map(const cref_t &m); diff --git a/src/mds/MDSRank.cc b/src/mds/MDSRank.cc index 68ba408d0153..6a311120db44 100644 --- a/src/mds/MDSRank.cc +++ b/src/mds/MDSRank.cc @@ -3499,27 +3499,6 @@ MDSRankDispatcher::MDSRankDispatcher( g_conf().add_observer(this); } -bool MDSRankDispatcher::handle_command( - const cmdmap_t &cmdmap, - const cref_t &m, - int *r, - std::stringstream *ds, - std::stringstream *ss, - Context **run_later, - bool *need_reply) -{ - ceph_assert(r != nullptr); - ceph_assert(ds != nullptr); - ceph_assert(ss != nullptr); - - *need_reply = true; - - std::string prefix; - cmd_getval(g_ceph_context, cmdmap, "prefix", prefix); - - return false; -} - void MDSRank::command_cache_drop(uint64_t timeout, Formatter *f, Context *on_finish) { dout(20) << __func__ << dendl; diff --git a/src/mds/MDSRank.h b/src/mds/MDSRank.h index 4f5bbc7cca07..ea89c1102cc0 100644 --- a/src/mds/MDSRank.h +++ b/src/mds/MDSRank.h @@ -643,15 +643,6 @@ public: const char** get_tracked_conf_keys() const override final; void handle_conf_change(const ConfigProxy& conf, const std::set& changed) override; - bool handle_command( - const cmdmap_t &cmdmap, - const cref_t &m, - int *r, - std::stringstream *ds, - std::stringstream *ss, - Context **run_later, - bool *need_reply); - void dump_sessions(const SessionFilter &filter, Formatter *f) const; void evict_clients(const SessionFilter &filter, std::function on_finish);