]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/FileStore: include filestore backend, f_type in osd metadata
authorSage Weil <sage@inktank.com>
Sat, 24 May 2014 22:58:54 +0000 (15:58 -0700)
committerSage Weil <sage@inktank.com>
Sat, 24 May 2014 22:58:54 +0000 (15:58 -0700)
Report the FileStore backend and underlying fs type as part of the osd
metadata shared with the monitor.

Signed-off-by: Sage Weil <sage@inktank.com>
src/os/FileStore.cc
src/os/FileStore.h
src/os/ObjectStore.h
src/osd/OSD.cc

index 64de42b5a3f38a91e7a156eae784aaf5686dc996..092ad22cd849da94edfc474480fd71859f1b579b 100644 (file)
@@ -543,6 +543,14 @@ bool parse_attrname(char **name)
   return false;
 }
 
+void FileStore::collect_metadata(map<string,string> *pm)
+{
+  (*pm)["filestore_backend"] = backend->get_name();
+  ostringstream ss;
+  ss << "0x" << std::hex << m_fs_type << std::dec;
+  (*pm)["filestore_f_type"] = ss.str();
+}
+
 int FileStore::statfs(struct statfs *buf)
 {
   if (::statfs(basedir.c_str(), buf) < 0) {
index 347e1a2d598edf51031b24fe9f9e39a6e721d362..4312400449f8c65bdfed013c8cc6a650da5f9f31 100644 (file)
@@ -363,6 +363,8 @@ public:
    */
   bool get_allow_sharded_objects();
 
+  void collect_metadata(map<string,string> *pm);
+
   int statfs(struct statfs *buf);
 
   int _do_transactions(
index 084bbdba4c57d54cb17579bc0a0a369f5c9892c2..078e40f547983171a8010b8e32aa392007df2b6f 100644 (file)
@@ -1174,6 +1174,8 @@ public:
 
   virtual int statfs(struct statfs *buf) = 0;
 
+  virtual void collect_metadata(map<string,string> *pm) { }
+
   /**
    * get the most recent "on-disk format version" supported
    */
index 179560c6f72739cc19bc9654c61b944fba073e8f..1e20a7804594c143d77ecab277383872357ee734 100644 (file)
@@ -3840,12 +3840,15 @@ void OSD::_collect_metadata(map<string,string> *pm)
   // config info
   (*pm)["osd_data"] = dev_path;
   (*pm)["osd_journal"] = journal_path;
-  (*pm)["osd_objectstore"] = g_conf->osd_objectstore;
   (*pm)["front_addr"] = stringify(client_messenger->get_myaddr());
   (*pm)["back_addr"] = stringify(cluster_messenger->get_myaddr());
   (*pm)["hb_front_addr"] = stringify(hb_front_server_messenger->get_myaddr());
   (*pm)["hb_back_addr"] = stringify(hb_back_server_messenger->get_myaddr());
 
+  // backend
+  (*pm)["osd_objectstore"] = g_conf->osd_objectstore;
+  store->collect_metadata(pm);
+
   // kernel info
   struct utsname u;
   int r = uname(&u);