]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: convert '{session,client} config'
authorSage Weil <sage@redhat.com>
Wed, 30 Oct 2019 02:40:21 +0000 (21:40 -0500)
committerSage Weil <sage@redhat.com>
Tue, 10 Dec 2019 00:25:02 +0000 (18:25 -0600)
Signed-off-by: Sage Weil <sage@redhat.com>
src/mds/MDSDaemon.cc
src/mds/MDSRank.cc

index 2e54ce37815c590e869a978f5afbad4bf9071e0b..32cd36f15e663107ff129443e381b430d4be39f4 100644 (file)
@@ -350,7 +350,15 @@ void MDSDaemon::set_up_admin_socket()
                                     asok_hook,
                                     "Enumerate connected CephFS clients");
   ceph_assert(r == 0);
-  r = admin_socket->register_command("session config name=client_id,type=CephInt,req=true "
+  r = admin_socket->register_command("session config "
+                                    "name=client_id,type=CephInt,req=true "
+                                    "name=option,type=CephString,req=true "
+                                    "name=value,type=CephString,req=false ",
+                                    asok_hook,
+                                    "Config a CephFS client session");
+  assert(r == 0);
+  r = admin_socket->register_command("client config "
+                                    "name=client_id,type=CephInt,req=true "
                                     "name=option,type=CephString,req=true "
                                     "name=value,type=CephString,req=false ",
                                     asok_hook,
@@ -624,10 +632,6 @@ void MDSDaemon::handle_command(const cref_t<MCommand> &m)
 const std::vector<MDSDaemon::MDSCommand>& MDSDaemon::get_commands()
 {
   static const std::vector<MDSCommand> commands = {
-    MDSCommand("session config name=client_id,type=CephInt name=option,type=CephString name=value,type=CephString,req=false",
-       "Config a client session"),
-    MDSCommand("client config name=client_id,type=CephInt name=option,type=CephString name=value,type=CephString,req=false",
-       "Config a client session"),
     MDSCommand("damage ls", "List detected metadata damage"),
     MDSCommand("damage rm name=damage_id,type=CephInt", "Remove a damage table entry"),
     MDSCommand("cache drop name=timeout,type=CephInt,range=0,req=false", "trim cache and optionally request client to release all caps and flush the journal"),
index 479f140271a15a4ed93f899157dadfbdd73e0812..849985188fda57cd2c1718b377e3159aa8a37907 100644 (file)
@@ -2515,7 +2515,8 @@ void MDSRankDispatcher::handle_asok_command(
       dout(15) << ss.str() << dendl;
       r = -ENOENT;
     }
-  } else if (command == "session config") {
+  } else if (command == "session config" ||
+            command == "client config") {
     int64_t client_id;
     std::string option;
     std::string value;
@@ -3539,18 +3540,7 @@ bool MDSRankDispatcher::handle_command(
   std::string prefix;
   cmd_getval(g_ceph_context, cmdmap, "prefix", prefix);
 
-  if (prefix == "session config" || prefix == "client config") {
-    int64_t client_id;
-    std::string option;
-    std::string value;
-
-    cmd_getval(g_ceph_context, cmdmap, "client_id", client_id);
-    cmd_getval(g_ceph_context, cmdmap, "option", option);
-    bool got_value = cmd_getval(g_ceph_context, cmdmap, "value", value);
-
-    *r = config_client(client_id, !got_value, option, value, *ss);
-    return true;
-  } else if (prefix == "damage ls") {
+  if (prefix == "damage ls") {
     JSONFormatter f(true);
     damage_table.dump(&f);
     f.flush(*ds);