]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common: Add cctid meta variable
authorAdam Crume <adamcrume@gmail.com>
Thu, 18 Sep 2014 23:57:27 +0000 (16:57 -0700)
committerSage Weil <sage@redhat.com>
Thu, 2 Oct 2014 00:50:59 +0000 (17:50 -0700)
Fixes: #6228
Signed-off-by: Adam Crume <adamcrume@gmail.com>
(cherry picked from commit bb45621cb117131707a85154292a3b3cdd1c662a)

src/common/config.cc

index 23bfe351e634eb951be2c9bce5db9c8d666f5734..fc47083245b192e21ae4727c07064958cb41c61e 100644 (file)
@@ -947,7 +947,7 @@ int md_config_t::set_val_raw(const char *val, const config_option *opt)
 }
 
 static const char *CONF_METAVARIABLES[] =
-  { "cluster", "type", "name", "host", "num", "id", "pid" };
+  { "cluster", "type", "name", "host", "num", "id", "pid", "cctid" };
 static const int NUM_CONF_METAVARIABLES =
       (sizeof(CONF_METAVARIABLES) / sizeof(CONF_METAVARIABLES[0]));
 
@@ -1059,6 +1059,8 @@ bool md_config_t::expand_meta(std::string &origval,
          out += name.get_id().c_str();
        else if (var == "pid")
          out += stringify(getpid());
+       else if (var == "cctid")
+         out += stringify((unsigned long long)this);
        else
          assert(0); // unreachable
        expanded = true;