]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: cleanups 16321/head
authorYan Jun <yan.jun8@zte.com.cn>
Wed, 12 Jul 2017 06:20:33 +0000 (14:20 +0800)
committerYan Jun <yan.jun8@zte.com.cn>
Thu, 13 Jul 2017 14:22:20 +0000 (22:22 +0800)
Signed-off-by: Yan Jun <yan.jun8@zte.com.cn>
src/common/config.cc
src/global/global_init.cc
src/os/filestore/FileStore.cc
src/osd/OSD.cc

index 2981e4f01fe089e0d65e61c70412268d047630de..5cbbd85e97be0a0ed7b53bdb8bccdb6009498833 100644 (file)
@@ -711,11 +711,11 @@ void md_config_t::call_all_observers()
 
     expand_all_meta();
 
-    for (obs_map_t::iterator r = observers.begin(); r != observers.end(); ++r) {
+    for (auto r = observers.begin(); r != observers.end(); ++r) {
       obs[r->second].insert(r->first);
     }
   }
-  for (std::map<md_config_obs_t*,std::set<std::string> >::iterator p = obs.begin();
+  for (auto p = obs.begin();
        p != obs.end();
        ++p) {
     p->first->handle_conf_change(this, p->second);
index a8833c5eb19c598af1864080db53d3b058847308..e5e19e0796f30c0db344fc8479dfa21354b3547e 100644 (file)
@@ -114,7 +114,7 @@ void global_pre_init(std::vector < const char * > *alt_def_args,
         dout_emergency(oss.str());
         _exit(1);
       } else {
-        derr <<"did not load config file, using default settings." << dendl;
+        derr << "did not load config file, using default settings." << dendl;
       }
     }
   }
index 8a3a5a1db9f61aa11c198e3b4bac50bae09f3e88..15a83dac0a736340c1bc2b6b04c8d7cfa6099766 100644 (file)
@@ -820,7 +820,7 @@ int FileStore::mkfs()
   basedir_fd = ::open(basedir.c_str(), O_RDONLY);
   if (basedir_fd < 0) {
     ret = -errno;
-    derr << "mkfs failed to open base dir " << basedir << ": " << cpp_strerror(ret) << dendl;
+    derr << __FUNC__ << ": failed to open base dir " << basedir << ": " << cpp_strerror(ret) << dendl;
     return ret;
   }
 
@@ -829,7 +829,7 @@ int FileStore::mkfs()
   fsid_fd = ::open(fsid_fn, O_RDWR|O_CREAT, 0644);
   if (fsid_fd < 0) {
     ret = -errno;
-    derr << "mkfs: failed to open " << fsid_fn << ": " << cpp_strerror(ret) << dendl;
+    derr << __FUNC__ << ": failed to open " << fsid_fn << ": " << cpp_strerror(ret) << dendl;
     goto close_basedir_fd;
   }
 
@@ -841,9 +841,9 @@ int FileStore::mkfs()
   if (read_fsid(fsid_fd, &old_fsid) < 0 || old_fsid.is_zero()) {
     if (fsid.is_zero()) {
       fsid.generate_random();
-      dout(1) << "mkfs generated fsid " << fsid << dendl;
+      dout(1) << __FUNC__ << ": generated fsid " << fsid << dendl;
     } else {
-      dout(1) << "mkfs using provided fsid " << fsid << dendl;
+      dout(1) << __FUNC__ << ": using provided fsid " << fsid << dendl;
     }
 
     fsid.print(fsid_str);
@@ -867,7 +867,7 @@ int FileStore::mkfs()
           << cpp_strerror(ret) << dendl;
       goto close_fsid_fd;
     }
-    dout(10) << "mkfs fsid is " << fsid << dendl;
+    dout(10) << __FUNC__ << ": fsid is " << fsid << dendl;
   } else {
     if (!fsid.is_zero() && fsid != old_fsid) {
       derr << __FUNC__ << ": on-disk fsid " << old_fsid << " != provided " << fsid << dendl;
@@ -907,7 +907,7 @@ int FileStore::mkfs()
 #if defined(__linux__)
   if (basefs.f_type == BTRFS_SUPER_MAGIC &&
       !g_ceph_context->check_experimental_feature_enabled("btrfs")) {
-    derr <<__FUNC__ << ": deprecated btrfs support is not enabled" << dendl;
+    derr << __FUNC__ << ": deprecated btrfs support is not enabled" << dendl;
     goto close_fsid_fd;
   }
 #endif
index 90b11fe484f262fde5f248d49711d8ca6b5e6ea7..4c9ad76fba2f93374ee9b663e6f10607edaf58c9 100644 (file)
@@ -1717,7 +1717,8 @@ int OSD::mkfs(CephContext *cct, ObjectStore *store, const string &dev,
 
   ret = store->mkfs();
   if (ret) {
-    derr << "OSD::mkfs: ObjectStore::mkfs failed with error " << ret << dendl;
+    derr << "OSD::mkfs: ObjectStore::mkfs failed with error "
+         << cpp_strerror(ret) << dendl;
     goto free_store;
   }
 
@@ -1725,7 +1726,8 @@ int OSD::mkfs(CephContext *cct, ObjectStore *store, const string &dev,
 
   ret = store->mount();
   if (ret) {
-    derr << "OSD::mkfs: couldn't mount ObjectStore: error " << ret << dendl;
+    derr << "OSD::mkfs: couldn't mount ObjectStore: error "
+         << cpp_strerror(ret) << dendl;
     goto free_store;
   }
 
@@ -1764,7 +1766,7 @@ int OSD::mkfs(CephContext *cct, ObjectStore *store, const string &dev,
     ret = store->apply_transaction(osr.get(), std::move(t));
     if (ret) {
       derr << "OSD::mkfs: error while writing OSD_SUPERBLOCK_GOBJECT: "
-          << "apply_transaction returned " << ret << dendl;
+          << "apply_transaction returned " << cpp_strerror(ret) << dendl;
       goto umount_store;
     }
   }
@@ -1775,7 +1777,8 @@ int OSD::mkfs(CephContext *cct, ObjectStore *store, const string &dev,
 
   ret = write_meta(store, sb.cluster_fsid, sb.osd_fsid, whoami);
   if (ret) {
-    derr << "OSD::mkfs: failed to write fsid file: error " << ret << dendl;
+    derr << "OSD::mkfs: failed to write fsid file: error "
+         << cpp_strerror(ret) << dendl;
     goto umount_store;
   }