]> git-server-git.apps.pok.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>
Sun, 23 Nov 2014 05:13:05 +0000 (21:13 -0800)
Fixes: #6228
Signed-off-by: Adam Crume <adamcrume@gmail.com>
(cherry picked from commit bb45621cb117131707a85154292a3b3cdd1c662a)

src/common/config.cc

index 5c64f4ec1517c242bf3bf9a1d303f06fe94890e2..47849550469720a5d59c0ac3c25be42034b92e22 100644 (file)
@@ -929,7 +929,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]));
 
@@ -1007,6 +1007,8 @@ bool md_config_t::expand_meta(std::string &origval) const
          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
        found_meta = true;