]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
make ctors with one argument explicit
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Thu, 28 Jan 2016 15:36:23 +0000 (16:36 +0100)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Fri, 29 Jan 2016 22:48:58 +0000 (23:48 +0100)
Use explicit keyword for constructors with one argument to
prevent implicit usage as conversion functions.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
267 files changed:
src/auth/AuthClientHandler.h
src/auth/AuthServiceHandler.h
src/auth/AuthSessionHandler.h
src/auth/cephx/CephxKeyServer.h
src/auth/cephx/CephxProtocol.h
src/auth/none/AuthNoneServiceHandler.h
src/client/Client.cc
src/client/Client.h
src/client/ClientSnapRealm.h
src/client/Dir.h
src/client/Inode.h
src/client/MetaRequest.h
src/client/Trace.h
src/client/hypertable/CephBroker.h
src/cls/log/cls_log_client.cc
src/cls/replica_log/cls_replica_log_ops.h
src/cls/rgw/cls_rgw_client.cc
src/cls/version/cls_version_client.cc
src/common/BackTrace.h
src/common/DecayCounter.h
src/common/Finisher.h
src/common/Formatter.h
src/common/HTMLFormatter.h
src/common/HeartbeatMap.h
src/common/Initialize.h
src/common/MemoryModel.h
src/common/Mutex.h
src/common/PluginRegistry.h
src/common/RWLock.h
src/common/Timer.cc
src/common/TracepointProvider.h
src/common/TrackedOp.h
src/common/admin_socket.cc
src/common/buffer.cc
src/common/ceph_argparse.h
src/common/ceph_context.cc
src/common/hobject.h
src/common/obj_bencher.cc
src/common/obj_bencher.h
src/common/pick_address.cc
src/compressor/AsyncCompressor.h
src/compressor/CompressionPlugin.h
src/compressor/snappy/CompressionPluginSnappy.cc
src/compressor/snappy/SnappyCompressor.h
src/crush/CrushTreeDumper.h
src/crush/CrushWrapper.cc
src/erasure-code/jerasure/ErasureCodeJerasure.h
src/erasure-code/lrc/ErasureCodeLrc.h
src/journal/JournalPlayer.cc
src/kv/KineticStore.h
src/kv/LevelDBStore.cc
src/kv/LevelDBStore.h
src/kv/RocksDBStore.cc
src/kv/RocksDBStore.h
src/libcephfs.cc
src/librados/AioCompletionImpl.h
src/librados/IoCtxImpl.cc
src/librados/IoCtxImpl.h
src/librados/PoolAsyncCompletionImpl.h
src/librados/RadosClient.h
src/librados/librados.cc
src/librbd/AsyncOperation.cc
src/librbd/ExclusiveLock.cc
src/librbd/ImageCtx.cc
src/librbd/LibrbdAdminSocketHook.cc
src/librbd/WatchNotifyTypes.cc
src/librbd/internal.cc
src/librbd/journal/Entries.cc
src/log/Log.h
src/mds/Beacon.h
src/mds/CDir.cc
src/mds/CInode.cc
src/mds/InoTable.h
src/mds/Locker.cc
src/mds/LogEvent.h
src/mds/MDBalancer.cc
src/mds/MDCache.cc
src/mds/MDCache.h
src/mds/MDLog.cc
src/mds/MDLog.h
src/mds/MDSAuthCaps.h
src/mds/MDSContext.h
src/mds/MDSDaemon.cc
src/mds/MDSDaemon.h
src/mds/MDSRank.cc
src/mds/MDSRank.h
src/mds/MDSTable.cc
src/mds/Migrator.cc
src/mds/RecoveryQueue.h
src/mds/ScatterLock.h
src/mds/Server.cc
src/mds/Server.h
src/mds/SessionMap.cc
src/mds/SessionMap.h
src/mds/SimpleLock.h
src/mds/SnapClient.h
src/mds/StrayManager.cc
src/mds/StrayManager.h
src/mds/events/ECommitted.h
src/mds/events/EMetaBlob.h
src/mds/events/ENoOp.h
src/mds/events/EOpen.h
src/mds/flock.h
src/mds/mdstypes.h
src/messages/MMonMap.h
src/mon/Elector.h
src/mon/MonCap.h
src/mon/MonClient.h
src/mon/Monitor.cc
src/mon/Monitor.h
src/mon/MonitorDBStore.h
src/mon/OSDMonitor.cc
src/mon/OSDMonitor.h
src/mon/Paxos.cc
src/mon/Paxos.h
src/mon/PaxosService.h
src/mon/mon_types.h
src/msg/Dispatcher.h
src/msg/Message.h
src/msg/async/AsyncConnection.cc
src/msg/async/AsyncMessenger.h
src/msg/async/Event.h
src/msg/async/EventEpoll.h
src/msg/async/EventKqueue.h
src/msg/async/EventSelect.h
src/msg/async/net_handler.h
src/msg/msg_types.h
src/msg/simple/DispatchQueue.h
src/msg/simple/Pipe.h
src/msg/simple/SimpleMessenger.h
src/msg/xio/QueueStrategy.h
src/msg/xio/XioConnection.h
src/msg/xio/XioMsg.h
src/msg/xio/XioPool.h
src/msg/xio/XioPortal.h
src/os/FuseStore.h
src/os/ObjectStore.h
src/os/bluestore/BlockDevice.h
src/os/bluestore/BlueFS.h
src/os/bluestore/BlueRocksEnv.cc
src/os/bluestore/BlueRocksEnv.h
src/os/bluestore/BlueStore.h
src/os/bluestore/bluestore_types.h
src/os/filestore/BtrfsFileStoreBackend.h
src/os/filestore/CollectionIndex.h
src/os/filestore/DBObjectMap.h
src/os/filestore/FDCache.h
src/os/filestore/FileJournal.h
src/os/filestore/FileStore.cc
src/os/filestore/FileStore.h
src/os/filestore/GenericFileStoreBackend.h
src/os/filestore/HashIndex.h
src/os/filestore/IndexManager.h
src/os/filestore/JournalingObjectStore.h
src/os/filestore/LFNIndex.cc
src/os/filestore/WBThrottle.h
src/os/filestore/XfsFileStoreBackend.h
src/os/filestore/ZFSFileStoreBackend.h
src/os/fs/FS.h
src/os/kstore/KStore.h
src/os/kstore/kstore_types.h
src/os/memstore/MemStore.h
src/os/memstore/PageSet.h
src/osd/ClassHandler.h
src/osd/ECBackend.h
src/osd/ECTransaction.cc
src/osd/ECTransaction.h
src/osd/ECUtil.h
src/osd/HitSet.h
src/osd/OSD.cc
src/osd/OSD.h
src/osd/OSDCap.h
src/osd/OSDMap.h
src/osd/PG.cc
src/osd/PG.h
src/osd/ReplicatedBackend.h
src/osd/ReplicatedPG.cc
src/osd/ReplicatedPG.h
src/osd/SnapMapper.cc
src/osd/Watch.cc
src/osd/osd_types.cc
src/osd/osd_types.h
src/osdc/Journaler.cc
src/osdc/ObjectCacher.h
src/osdc/Objecter.h
src/rbd_replay/ActionTypes.cc
src/rbd_replay/Replayer.hpp
src/rbd_replay/actions.hpp
src/rgw/rgw_acl.h
src/rgw/rgw_acl_s3.h
src/rgw/rgw_acl_swift.h
src/rgw/rgw_admin.cc
src/rgw/rgw_client_io.h
src/rgw/rgw_common.h
src/rgw/rgw_cors_s3.h
src/rgw/rgw_fcgi.h
src/rgw/rgw_formats.h
src/rgw/rgw_http_client.h
src/rgw/rgw_loadgen.h
src/rgw/rgw_log.cc
src/rgw/rgw_main.cc
src/rgw/rgw_metadata.cc
src/rgw/rgw_object_expirer.cc
src/rgw/rgw_object_expirer_core.h
src/rgw/rgw_op.h
src/rgw/rgw_orphan.h
src/rgw/rgw_quota.cc
src/rgw/rgw_rados.cc
src/rgw/rgw_rados.h
src/rgw/rgw_replica_log.h
src/rgw/rgw_rest_client.cc
src/rgw/rgw_rest_conn.cc
src/rgw/rgw_rest_s3.h
src/rgw/rgw_rest_s3website.h
src/rgw/rgw_rest_user.cc
src/rgw/rgw_swift.h
src/rgw/rgw_user.h
src/rgw/rgw_xml.h
src/test/ObjectMap/KeyValueDBMemory.cc
src/test/ObjectMap/KeyValueDBMemory.h
src/test/TestTimers.cc
src/test/admin_socket.cc
src/test/bench/bencher.cc
src/test/bench/distribution.h
src/test/bench/dumb_backend.h
src/test/bench/rados_backend.h
src/test/bench/rbd_backend.h
src/test/bench/small_io_bench_fs.cc
src/test/bench_log.cc
src/test/ceph_argparse.cc
src/test/common/ObjectContents.h
src/test/common/test_async_compressor.cc
src/test/common/test_lru.cc
src/test/common/test_prioritized_queue.cc
src/test/compressor/compressor_plugin_example.cc
src/test/encoding.cc
src/test/librbd/test_ImageWatcher.cc
src/test/librbd/test_librbd.cc
src/test/messenger/simple_dispatcher.h
src/test/messenger/xio_dispatcher.h
src/test/mon/test-mon-msg.cc
src/test/mon/test_mon_workloadgen.cc
src/test/msgr/test_async_driver.cc
src/test/msgr/test_msgr.cc
src/test/objectstore/TestObjectStoreState.h
src/test/objectstore/store_test.cc
src/test/objectstore/workload_generator.h
src/test/old/testmpi.cc
src/test/old/testnewbuffers.cc
src/test/osd/Object.h
src/test/osd/RadosModel.h
src/test/osd/TestPGLog.cc
src/test/osd/hitset.cc
src/test/osd/types.cc
src/test/perf_local.cc
src/test/system/cross_process_sem.h
src/test/test_snap_mapper.cc
src/test/test_stress_watch.cc
src/test/test_xlist.cc
src/tools/RadosDump.h
src/tools/ceph_monstore_tool.cc
src/tools/ceph_objectstore_tool.cc
src/tools/cephfs/TableTool.cc
src/tools/rados/PoolDump.h
src/tools/rados/rados.cc
src/tools/rbd/action/BenchWrite.cc
src/tools/rbd/action/Journal.cc

index e12cbb914f86af88bdc108bd98d2bda71741b2ff..9b34a6f8270b8befaebae128ee0716069bd0420e 100644 (file)
@@ -40,7 +40,7 @@ protected:
   RWLock lock;
 
 public:
-  AuthClientHandler(CephContext *cct_) 
+  explicit AuthClientHandler(CephContext *cct_)
     : cct(cct_), global_id(0), want(CEPH_ENTITY_TYPE_AUTH), have(0), need(0),
       lock("AuthClientHandler::lock") {}
   virtual ~AuthClientHandler() {}
index 429a5501be524989d4d951bf54f5fcc52351b529..ccadbb0fa54ac70aed459873980a5fedfee5b66e 100644 (file)
@@ -29,7 +29,7 @@ public:
   EntityName entity_name;
   uint64_t global_id;
 
-  AuthServiceHandler(CephContext *cct_) : cct(cct_), global_id(0) {}
+  explicit AuthServiceHandler(CephContext *cct_) : cct(cct_), global_id(0) {}
 
   virtual ~AuthServiceHandler() { }
 
index c560119ec7751fb33a79fb5d8d66c74bafe0ac60..b1f30a400670d12e83f71fede74bb15057e993a7 100644 (file)
@@ -44,7 +44,7 @@ public:
   int messages_encrypted;
   int messages_decrypted;
 
-  AuthSessionHandler(CephContext *cct_) : cct(cct_), protocol(CEPH_AUTH_UNKNOWN), messages_signed(0),
+  explicit AuthSessionHandler(CephContext *cct_) : cct(cct_), protocol(CEPH_AUTH_UNKNOWN), messages_signed(0),
     signatures_checked(0), signatures_matched(0), signatures_failed(0), messages_encrypted(0),
     messages_decrypted(0) {}
 
index 250331d7116765fb6e9e8cbd19d990705e3db7bb..7d95fadc882167bdb27a7f78029d2122c6965b00 100644 (file)
@@ -35,7 +35,7 @@ struct KeyServerData {
   version_t rotating_ver;
   map<uint32_t, RotatingSecrets> rotating_secrets;
 
-  KeyServerData(KeyRing *extra)
+  explicit KeyServerData(KeyRing *extra)
     : version(0),
       extra_secrets(extra),
       rotating_ver(0) {}
index f08f07d84b9ff172e01bc007f202141683bde155..4a5fb5d3dcbeefd3df8269c0e0c17067c59c188b 100644 (file)
@@ -277,7 +277,7 @@ private:
 public:
   uint64_t nonce;
 
-  CephXAuthorizer(CephContext *cct_)
+  explicit CephXAuthorizer(CephContext *cct_)
     : AuthAuthorizer(CEPH_AUTH_CEPHX), cct(cct_), nonce(0) {}
 
   bool build_authorizer();
@@ -320,7 +320,7 @@ struct CephXTicketManager {
   tickets_map_t tickets_map;
   uint64_t global_id;
 
-  CephXTicketManager(CephContext *cct_) : global_id(0), cct(cct_) {}
+  explicit CephXTicketManager(CephContext *cct_) : global_id(0), cct(cct_) {}
 
   bool verify_service_ticket_reply(CryptoKey& principal_secret,
                                 bufferlist::iterator& indata);
index c2bbbc8c8cf01ff02415d8c8240d7a0c96300973..a45dbbfce4b3ba04d9c547987a116a670c51c666 100644 (file)
@@ -22,7 +22,7 @@ class CephContext;
 
 class AuthNoneServiceHandler  : public AuthServiceHandler {
 public:
-  AuthNoneServiceHandler(CephContext *cct_) 
+  explicit AuthNoneServiceHandler(CephContext *cct_)
     : AuthServiceHandler(cct_) {}
   ~AuthNoneServiceHandler() {}
   
index 2f3d6dffe5b848b5a8a90bfd3ab646f8ceda6f40..d6b08bb07399b33c36d419382548d95f958f8d26 100644 (file)
@@ -3793,7 +3793,7 @@ class C_Client_Remount : public Context  {
 private:
   Client *client;
 public:
-  C_Client_Remount(Client *c) : client(c) {}
+  explicit C_Client_Remount(Client *c) : client(c) {}
   void finish(int r) {
     assert (r == 0);
     r = client->remount_cb(client->callback_handle);
@@ -5564,7 +5564,7 @@ void Client::unmount()
 class C_C_Tick : public Context {
   Client *client;
 public:
-  C_C_Tick(Client *c) : client(c) {}
+  explicit C_C_Tick(Client *c) : client(c) {}
   void finish(int r) {
     // Called back via Timer, which takes client_lock for us
     assert(client->client_lock.is_locked_by_me());
index a3415b099c09f89c5cdde2952e8acc9304b09457..ccee4862016d797bd001edde705681e421335653 100644 (file)
@@ -118,7 +118,7 @@ struct DirEntry {
   string d_name;
   struct stat st;
   int stmask;
-  DirEntry(const string &s) : d_name(s), stmask(0) {}
+  explicit DirEntry(const string &s) : d_name(s), stmask(0) {}
   DirEntry(const string &n, struct stat& s, int stm) : d_name(n), st(s), stmask(stm) {}
 };
 
@@ -192,7 +192,7 @@ struct dir_result_t {
 
   string at_cache_name;  // last entry we successfully returned
 
-  dir_result_t(Inode *in);
+  explicit dir_result_t(Inode *in);
 
   frag_t frag() { return frag_t(offset >> SHIFT); }
   unsigned fragpos() { return offset & MASK; }
@@ -231,7 +231,7 @@ class Client : public Dispatcher, public md_config_obs_t {
   class CommandHook : public AdminSocketHook {
     Client *m_client;
   public:
-    CommandHook(Client *client);
+    explicit CommandHook(Client *client);
     bool call(std::string command, cmdmap_t &cmdmap, std::string format,
              bufferlist& out);
   };
index 040430a5342956b7000f1439c6970f38c33d5513..ccb129d78bf3bcafc4869c09087ceef19eae6043 100644 (file)
@@ -31,7 +31,7 @@ private:
 public:
   xlist<Inode*> inodes_with_caps;
 
-  SnapRealm(inodeno_t i) : 
+  explicit SnapRealm(inodeno_t i) :
     ino(i), nref(0), created(0), seq(0),
     pparent(NULL) { }
 
index 0e6d28bbb298ff0a4702612dcf773b3eeefb1089..a7f484d45f3c97abc5e6a9a5c23fd66ca79a7de1 100644 (file)
@@ -11,7 +11,7 @@ class Dir {
   uint64_t release_count;
   uint64_t ordered_count;
 
-  Dir(Inode* in) : release_count(0), ordered_count(0) { parent_inode = in; }
+  explicit Dir(Inode* in) : release_count(0), ordered_count(0) { parent_inode = in; }
 
   bool is_empty() {  return dentries.empty(); }
 };
index bd10ad7626c8e0da86176bed9596952c62d4877c..dd2ad995e83ebb14f24d7c31defbaf6548bf296b 100644 (file)
@@ -66,7 +66,7 @@ struct CapSnap {
   uint64_t flush_tid;
   xlist<CapSnap*>::item flushing_item;
 
-  CapSnap(Inode *i)
+  explicit CapSnap(Inode *i)
     : in(i), issued(0), dirty(0),
       size(0), time_warp_seq(0), mode(0), uid(0), gid(0), xattr_version(0),
       inline_version(0), writing(false), dirty_data(false), flush_tid(0),
@@ -95,7 +95,7 @@ private:
   }
   ~QuotaTree() {}
 public:
-  QuotaTree(Inode *i) :
+  explicit QuotaTree(Inode *i) :
     _in(i),
     _ancestor_ref(0),
     _ancestor(NULL),
index 7a6bd3fb0f81e1d9523e1431b5349b12ac068fa9..d21e5c54e47e95f575628fb291938493d561e403 100644 (file)
@@ -81,7 +81,7 @@ public:
 
   InodeRef target;
 
-  MetaRequest(int op) :
+  explicit MetaRequest(int op) :
     _dentry(NULL), _old_dentry(NULL), abort_rc(0),
     tid(0),
     inode_drop(0), inode_unless(0),
index 24145a8b84c7a60f69d9bc77e0fc98040f874728..7da2eaf896d701184a448e573b65afadaaee3384 100644 (file)
@@ -39,7 +39,7 @@ class Trace {
   string line;
 
  public:
-  Trace(const char* f) : _line(0), filename(f), fs(0) {}
+  explicit Trace(const char* f) : _line(0), filename(f), fs(0) {}
   ~Trace() { 
     delete fs; 
   }
index 542ff668f155c50a45b6531eece16ab4be652e0c..a0d180c4da28552cbd481fd87ef09a034fe845b1 100644 (file)
@@ -58,7 +58,7 @@ namespace Hypertable {
   class OpenFileDataCephPtr : public OpenFileDataPtr {
   public:
     OpenFileDataCephPtr() : OpenFileDataPtr() { }
-    OpenFileDataCephPtr(OpenFileDataCeph *ofdl) : OpenFileDataPtr(ofdl, true) { }
+    explicit OpenFileDataCephPtr(OpenFileDataCeph *ofdl) : OpenFileDataPtr(ofdl, true) { }
     OpenFileDataCeph *operator->() const { return static_cast<OpenFileDataCeph *>(get()); }
   };
 
@@ -67,7 +67,7 @@ namespace Hypertable {
    */
   class CephBroker : public DfsBroker::Broker {
   public:
-    CephBroker(PropertiesPtr& cfg);
+    explicit CephBroker(PropertiesPtr& cfg);
     virtual ~CephBroker();
 
     virtual void open(ResponseCallbackOpen *cb, const char *fname,
index d0c6603d689da771015f86cd63e50ed7946ae7ab..0334deb57d3aa05428b8e430d7e04e3ecfeda4b2 100644 (file)
@@ -127,7 +127,7 @@ void cls_log_list(librados::ObjectReadOperation& op, utime_t& from, utime_t& to,
 class LogInfoCtx : public ObjectOperationCompletion {
   cls_log_header *header;
 public:
-  LogInfoCtx(cls_log_header *_header) : header(_header) {}
+  explicit LogInfoCtx(cls_log_header *_header) : header(_header) {}
   void handle_completion(int r, bufferlist& outbl) {
     if (r >= 0) {
       cls_log_info_ret ret;
index 0905bb94e847c9b3bd5dda1ff4aec328794560a9..c5361a019f279fb88a60d9082d255d2c3de07668 100644 (file)
@@ -16,7 +16,7 @@
 struct cls_replica_log_delete_marker_op {
   string entity_id;
   cls_replica_log_delete_marker_op() {}
-  cls_replica_log_delete_marker_op(const string& id) : entity_id(id) {}
+  explicit cls_replica_log_delete_marker_op(const string& id) : entity_id(id) {}
 
   void encode(bufferlist& bl) const {
     ENCODE_START(1, 1, bl);
@@ -39,7 +39,7 @@ WRITE_CLASS_ENCODER(cls_replica_log_delete_marker_op)
 struct cls_replica_log_set_marker_op {
   cls_replica_log_progress_marker marker;
   cls_replica_log_set_marker_op() {}
-  cls_replica_log_set_marker_op(const cls_replica_log_progress_marker& m) :
+  explicit cls_replica_log_set_marker_op(const cls_replica_log_progress_marker& m) :
     marker(m) {}
 
   void encode(bufferlist& bl) const {
index e6ac56b822c3601ba731fdbaa7e50982ec9632e6..62034f2d1ab99fc5ace88009458a4ba819e406a1 100644 (file)
@@ -476,7 +476,7 @@ int CLSRGWIssueGetDirHeader::issue_op(int shard_id, const string& oid)
 class GetDirHeaderCompletion : public ObjectOperationCompletion {
   RGWGetDirHeader_CB *ret_ctx;
 public:
-  GetDirHeaderCompletion(RGWGetDirHeader_CB *_ctx) : ret_ctx(_ctx) {}
+  explicit GetDirHeaderCompletion(RGWGetDirHeader_CB *_ctx) : ret_ctx(_ctx) {}
   ~GetDirHeaderCompletion() {
     ret_ctx->put();
   }
index 70d5ebe67695c05c171784ecd616569e8f500720..191fa4beeb72debc7cadd57a567efa144c8625f6 100644 (file)
@@ -60,7 +60,7 @@ void cls_version_check(librados::ObjectOperation& op, obj_version& objv, Version
 class VersionReadCtx : public ObjectOperationCompletion {
   obj_version *objv;
 public:
-  VersionReadCtx(obj_version *_objv) : objv(_objv) {}
+  explicit VersionReadCtx(obj_version *_objv) : objv(_objv) {}
   void handle_completion(int r, bufferlist& outbl) {
     if (r >= 0) {
       cls_version_read_ret ret;
index 4157f74a3b3c5c8c5cd567a58c12924e628d8a4f..addfdeeeb28d00d9c4015e5710d624c6172824da 100644 (file)
@@ -18,7 +18,7 @@ struct BackTrace {
   size_t size;
   char **strings;
 
-  BackTrace(int s) : skip(s) {
+  explicit BackTrace(int s) : skip(s) {
 #ifdef HAVE_EXECINFO_H
     size = backtrace(array, max);
     strings = backtrace_symbols(array, size);
index 4e69a88696308483242cff3e76978b097d4c436f..529e50a30b3ded6654917c1687835067e8d32a8f 100644 (file)
@@ -56,7 +56,7 @@ public:
   void dump(Formatter *f) const;
   static void generate_test_instances(list<DecayCounter*>& ls);
 
-  DecayCounter(const utime_t &now)
+  explicit DecayCounter(const utime_t &now)
     : val(0), delta(0), vel(0), last_decay(now)
   {
   }
index 26a41b7461e3594bfafe238a979838517858ada1..4d494ed15333d92802c29d12a593462884829613 100644 (file)
@@ -62,7 +62,7 @@ class Finisher {
 
   struct FinisherThread : public Thread {
     Finisher *fin;    
-    FinisherThread(Finisher *f) : fin(f) {}
+    explicit FinisherThread(Finisher *f) : fin(f) {}
     void* entry() { return (void*)fin->finisher_thread_entry(); }
   } finisher_thread;
 
@@ -134,7 +134,7 @@ class Finisher {
 
   /// Construct an anonymous Finisher.
   /// Anonymous finishers do not log their queue length.
-  Finisher(CephContext *cct_) :
+  explicit Finisher(CephContext *cct_) :
     cct(cct_), finisher_lock("Finisher::finisher_lock"),
     finisher_stop(false), finisher_running(false),
     thread_name("fn_anonymous"), logger(0),
index f67aebd04dbe3d8a93910304563f128285229ace..d74fab7a12d53148760b9332478f26376d40312e 100644 (file)
@@ -91,7 +91,7 @@ namespace ceph {
 
   class JSONFormatter : public Formatter {
   public:
-    JSONFormatter(bool p = false);
+    explicit JSONFormatter(bool p = false);
 
     virtual void set_status(int status, const char* status_name) {};
     virtual void output_header() {};
@@ -178,7 +178,7 @@ namespace ceph {
 
   class TableFormatter : public Formatter {
   public:
-    TableFormatter(bool keyval = false);
+    explicit TableFormatter(bool keyval = false);
 
     virtual void set_status(int status, const char* status_name) {};
     virtual void output_header() {};
index 50d0777973f6da3c86a50d4088e63704e16bae82..c165efc99f6ced428cd485716045d3267f4b668b 100644 (file)
@@ -20,7 +20,7 @@
 namespace ceph {
   class HTMLFormatter : public XMLFormatter {
   public:
-    HTMLFormatter(bool pretty = false);
+    explicit HTMLFormatter(bool pretty = false);
     ~HTMLFormatter();
     void reset();
 
index 61c2f9048d835802503c32cfa8b9aae4719e219f..8ab5f648a035e35f40f0aa33e9753120f2638830 100644 (file)
@@ -46,7 +46,7 @@ struct heartbeat_handle_d {
   time_t grace, suicide_grace;
   std::list<heartbeat_handle_d*>::iterator list_item;
 
-  heartbeat_handle_d(const std::string& n)
+  explicit heartbeat_handle_d(const std::string& n)
     : name(n), grace(0), suicide_grace(0)
   { }
 };
@@ -74,7 +74,7 @@ class HeartbeatMap {
   // get the number of total workers
   int get_total_workers() const;
 
-  HeartbeatMap(CephContext *cct);
+  explicit HeartbeatMap(CephContext *cct);
   ~HeartbeatMap();
 
  private:
index 35414d64be8f830587f6c36c6e55ff79e9e3e338..78ad5ec6973f80ae7c8feab5b753c276bc5cbf25 100644 (file)
@@ -69,7 +69,7 @@ class Initialize {
    *      function should normally contain an internal guard so that it
    *      only performs its initialization the first time it is invoked.
    */
-  Initialize(void (*func)()) {
+  explicit Initialize(void (*func)()) {
     (*func)();
   }
 
index 1b8d185578913cb8536d9ba201cf6da384f0ee7e..0d68dc5daa9304bcd0329e42963734670c4ccd29 100644 (file)
@@ -43,7 +43,7 @@ private:
   void _sample(snap *p);
 
 public:
-  MemoryModel(CephContext *cct);
+  explicit MemoryModel(CephContext *cct);
   void sample(snap *p = 0) {
     _sample(&last);
     if (p)
index 6a4e6b385eead8895879937a0fd380c4a203a006..09e8f8cd6c96404272a68f2a199b1a7e5ff0dfe8 100644 (file)
@@ -111,7 +111,7 @@ public:
     Mutex &mutex;
 
   public:
-    Locker(Mutex& m) : mutex(m) {
+    explicit Locker(Mutex& m) : mutex(m) {
       mutex.Lock();
     }
     ~Locker() {
index 6757ce10a85f61466bb3adfee880401b5cb092a6..ab9abc1030cff8f5336829f231459e8021d51d1a 100644 (file)
@@ -39,7 +39,7 @@ namespace ceph {
     void *library;
     CephContext *cct;
 
-    Plugin(CephContext *cct) : cct(cct) {}
+    explicit Plugin(CephContext *cct) : cct(cct) {}
     virtual ~Plugin() {}
   };
 
@@ -51,7 +51,7 @@ namespace ceph {
     bool disable_dlclose;
     std::map<std::string,std::map<std::string,Plugin*> > plugins;
 
-    PluginRegistry(CephContext *cct);
+    explicit PluginRegistry(CephContext *cct);
     ~PluginRegistry();
 
     int add(const std::string& type, const std::string& name,
index d3b5cdb5533643fb5473d282e9a54134ddad7d73..9b0de9ed967817795fbaf22557c6bf6a4f3073f7 100644 (file)
@@ -140,7 +140,7 @@ public:
     bool locked;
 
   public:
-    RLocker(const RWLock& lock) : m_lock(lock) {
+   explicit  RLocker(const RWLock& lock) : m_lock(lock) {
       m_lock.get_read();
       locked = true;
     }
@@ -162,7 +162,7 @@ public:
     bool locked;
 
   public:
-    WLocker(RWLock& lock) : m_lock(lock) {
+    explicit WLocker(RWLock& lock) : m_lock(lock) {
       m_lock.get_write();
       locked = true;
     }
@@ -192,7 +192,7 @@ public:
     LockState state;
 
   public:
-    Context(RWLock& l) : lock(l), state(Untaken) {}
+    explicit Context(RWLock& l) : lock(l), state(Untaken) {}
     Context(RWLock& l, LockState s) : lock(l), state(s) {}
 
     void get_write() {
index 1160541acae32df0193bd54486a7daa8341fb17e..b71511dc4e337e84d8001ccf2e128d1ef1230e00 100644 (file)
@@ -33,7 +33,7 @@
 class SafeTimerThread : public Thread {
   SafeTimer *parent;
 public:
-  SafeTimerThread(SafeTimer *s) : parent(s) {}
+  explicit SafeTimerThread(SafeTimer *s) : parent(s) {}
   void *entry() {
     parent->timer_thread();
     return NULL;
index 447e2dec07ce314b3a1b17227befe54b31f787c3..9f5ec11f3c43b24768bc32deb18f8d774fe35241 100644 (file)
@@ -45,7 +45,7 @@ public:
   template <const Traits &traits>
   class TypedSingleton : public Singleton {
   public:
-    TypedSingleton(CephContext *cct)
+    explicit TypedSingleton(CephContext *cct)
       : Singleton(cct, traits.library, traits.config_key) {
     }
   };
index 89b990a8b410ffbe51e50dfff950dcda7a1061e0..3663290ec08eb038e88a1fbf5a83ec0fc17185bd 100644 (file)
@@ -56,7 +56,7 @@ class OpTracker {
   class RemoveOnDelete {
     OpTracker *tracker;
   public:
-    RemoveOnDelete(OpTracker *tracker) : tracker(tracker) {}
+    explicit RemoveOnDelete(OpTracker *tracker) : tracker(tracker) {}
     void operator()(TrackedOp *op);
   };
   friend class RemoveOnDelete;
@@ -65,7 +65,7 @@ class OpTracker {
   struct ShardedTrackingData {
     Mutex ops_in_flight_lock_sharded;
     xlist<TrackedOp *> ops_in_flight_sharded;
-    ShardedTrackingData(string lock_name):
+    explicit ShardedTrackingData(string lock_name):
         ops_in_flight_lock_sharded(lock_name.c_str()) {}
   };
   vector<ShardedTrackingData*> sharded_in_flight_list;
index 1d51ef54227a40e9882113a1414c47245cb8dde0..aa0146fe1c3bbccbf2989a2ead45f5949984dd69 100644 (file)
@@ -473,7 +473,7 @@ public:
 class HelpHook : public AdminSocketHook {
   AdminSocket *m_as;
 public:
-  HelpHook(AdminSocket *as) : m_as(as) {}
+  explicit HelpHook(AdminSocket *as) : m_as(as) {}
   bool call(string command, cmdmap_t &cmdmap, string format, bufferlist& out) {
     Formatter *f = Formatter::create(format, "json-pretty", "json-pretty");
     f->open_object_section("help");
@@ -495,7 +495,7 @@ public:
 class GetdescsHook : public AdminSocketHook {
   AdminSocket *m_as;
 public:
-  GetdescsHook(AdminSocket *as) : m_as(as) {}
+  explicit GetdescsHook(AdminSocket *as) : m_as(as) {}
   bool call(string command, cmdmap_t &cmdmap, string format, bufferlist& out) {
     int cmdnum = 0;
     JSONFormatter jf(false);
index 864c7eefb9eb1c77f1d3fb4d5d65ba5f94e88753..bd97b01cd88f3eab8307e9dd9760b40592ff7b21 100644 (file)
@@ -165,7 +165,7 @@ static simple_spinlock_t buffer_debug_lock = SIMPLE_SPINLOCK_INITIALIZER;
     mutable simple_spinlock_t crc_spinlock;
     map<pair<size_t, size_t>, pair<uint32_t, uint32_t> > crc_map;
 
-    raw(unsigned l)
+    explicit raw(unsigned l)
       : data(NULL), len(l), nref(0),
        crc_spinlock(SIMPLE_SPINLOCK_INITIALIZER)
     { }
@@ -236,7 +236,7 @@ static simple_spinlock_t buffer_debug_lock = SIMPLE_SPINLOCK_INITIALIZER;
 
   class buffer::raw_malloc : public buffer::raw {
   public:
-    raw_malloc(unsigned l) : raw(l) {
+    explicit raw_malloc(unsigned l) : raw(l) {
       if (len) {
        data = (char *)malloc(len);
         if (!data)
@@ -265,7 +265,7 @@ static simple_spinlock_t buffer_debug_lock = SIMPLE_SPINLOCK_INITIALIZER;
 #ifndef __CYGWIN__
   class buffer::raw_mmap_pages : public buffer::raw {
   public:
-    raw_mmap_pages(unsigned l) : raw(l) {
+    explicit raw_mmap_pages(unsigned l) : raw(l) {
       data = (char*)::mmap(NULL, len, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, -1, 0);
       if (!data)
        throw bad_alloc();
@@ -347,7 +347,7 @@ static simple_spinlock_t buffer_debug_lock = SIMPLE_SPINLOCK_INITIALIZER;
 #ifdef CEPH_HAVE_SPLICE
   class buffer::raw_pipe : public buffer::raw {
   public:
-    raw_pipe(unsigned len) : raw(len), source_consumed(false) {
+    explicit raw_pipe(unsigned len) : raw(len), source_consumed(false) {
       size_t max = get_max_pipe_size();
       if (len > max) {
        bdout << "raw_pipe: requested length " << len
@@ -527,7 +527,7 @@ static simple_spinlock_t buffer_debug_lock = SIMPLE_SPINLOCK_INITIALIZER;
    */
   class buffer::raw_char : public buffer::raw {
   public:
-    raw_char(unsigned l) : raw(l) {
+    explicit raw_char(unsigned l) : raw(l) {
       if (len)
        data = new char[len];
       else
@@ -552,7 +552,7 @@ static simple_spinlock_t buffer_debug_lock = SIMPLE_SPINLOCK_INITIALIZER;
 
   class buffer::raw_unshareable : public buffer::raw {
   public:
-    raw_unshareable(unsigned l) : raw(l) {
+    explicit raw_unshareable(unsigned l) : raw(l) {
       if (len)
        data = new char[len];
       else
index 6ad0234df0274ca27ef62d6b4a178e77905646cb..b504b3508fb7d93bbaa31f5eaadcc648a037e0c1 100644 (file)
@@ -35,7 +35,7 @@
 class CephInitParameters
 {
 public:
-  CephInitParameters(uint32_t module_type_);
+  explicit CephInitParameters(uint32_t module_type_);
   std::list<std::string> get_conf_files() const;
 
   uint32_t module_type;
index 91d6b97d0c56c77186514c08839b1d312c4dc0a7..bd74967cbb6ba280136fd219c8c14c42a6e0ee3c 100644 (file)
@@ -46,7 +46,7 @@ namespace {
 
 class LockdepObs : public md_config_obs_t {
 public:
-  LockdepObs(CephContext *cct) : m_cct(cct), m_registered(false) {
+  explicit LockdepObs(CephContext *cct) : m_cct(cct), m_registered(false) {
   }
   virtual ~LockdepObs() {
     if (m_registered) {
@@ -80,7 +80,7 @@ private:
 class CephContextServiceThread : public Thread
 {
 public:
-  CephContextServiceThread(CephContext *cct)
+  explicit CephContextServiceThread(CephContext *cct)
     : _lock("CephContextServiceThread::_lock"),
       _reopen_logs(false), _exit_thread(false), _cct(cct)
   {
@@ -149,7 +149,7 @@ class LogObs : public md_config_obs_t {
   ceph::log::Log *log;
 
 public:
-  LogObs(ceph::log::Log *l) : log(l) {}
+  explicit LogObs(ceph::log::Log *l) : log(l) {}
 
   const char** get_tracked_conf_keys() const {
     static const char *KEYS[] = {
@@ -201,7 +201,7 @@ class CephContextObs : public md_config_obs_t {
   CephContext *cct;
 
 public:
-  CephContextObs(CephContext *cct) : cct(cct) {}
+  explicit CephContextObs(CephContext *cct) : cct(cct) {}
 
   const char** get_tracked_conf_keys() const {
     static const char *KEYS[] = {
@@ -264,7 +264,7 @@ class CephContextHook : public AdminSocketHook {
   CephContext *m_cct;
 
 public:
-  CephContextHook(CephContext *cct) : m_cct(cct) {}
+  explicit CephContextHook(CephContext *cct) : m_cct(cct) {}
 
   bool call(std::string command, cmdmap_t& cmdmap, std::string format,
            bufferlist& out) {
index d71554422895485d8fc53ce83f9a518edb053867..b823708441acc187a7e9e277d218cb5a1f8882b7 100644 (file)
@@ -285,7 +285,7 @@ public:
 
   struct Comparator {
     bool bitwise;
-    Comparator(bool b) : bitwise(b) {}
+    explicit Comparator(bool b) : bitwise(b) {}
     bool operator()(const hobject_t& l, const hobject_t& r) const {
       if (bitwise)
        return cmp_bitwise(l, r) < 0;
@@ -295,7 +295,7 @@ public:
   };
   struct ComparatorWithDefault {
     bool bitwise;
-    ComparatorWithDefault(bool b=true) : bitwise(b) {}
+    explicit ComparatorWithDefault(bool b=true) : bitwise(b) {}
     bool operator()(const hobject_t& l, const hobject_t& r) const {
       if (bitwise)
        return cmp_bitwise(l, r) < 0;
@@ -463,7 +463,7 @@ public:
 
   struct Comparator {
     bool bitwise;
-    Comparator(bool b) : bitwise(b) {}
+    explicit Comparator(bool b) : bitwise(b) {}
     bool operator()(const ghobject_t& l, const ghobject_t& r) const {
          if (bitwise)
        return cmp_bitwise(l, r) < 0;
index a77febc6cb81c2d3a944952b086221af09acddb3..c6b3eb26fab3bfaddd47ab0b09ef4be9bdaca3ef 100644 (file)
@@ -293,7 +293,7 @@ int ObjBencher::aio_bench(
 }
 
 struct lock_cond {
-  lock_cond(Mutex *_lock) : lock(_lock) {}
+  explicit lock_cond(Mutex *_lock) : lock(_lock) {}
   Mutex *lock;
   Cond cond;
 };
index a717c5da0edebbfbda9d939eacd4c8880b74f4b9..e39e7df157316a7779e066d850d46fa72cf65771 100644 (file)
@@ -105,7 +105,7 @@ protected:
   ostream& out(ostream& os);
   ostream& out(ostream& os, utime_t& t);
 public:
-  ObjBencher(CephContext *cct_) : show_time(false), cct(cct_), lock("ObjBencher::lock") {}
+  explicit ObjBencher(CephContext *cct_) : show_time(false), cct(cct_), lock("ObjBencher::lock") {}
   virtual ~ObjBencher() {}
   int aio_bench(
     int operation, int secondsToRun,
index f6853622ff9bb6336e5229b43c75c69580f512cb..a47a1d946a4cc276b5ee78389d2ef4d831dc344b 100644 (file)
@@ -51,7 +51,7 @@ static const struct sockaddr *find_ip_in_subnet_list(CephContext *cct,
 // observe this change
 struct Observer : public md_config_obs_t {
   const char *keys[2];
-  Observer(const char *c) {
+  explicit Observer(const char *c) {
     keys[0] = c;
     keys[1] = NULL;
   }
index cec2e961d4e3e4a5f59b9e8a9f052138803bdef8..8be4f4e55bfc9d1553b4e0c6b11f3d6bfb540e3e 100644 (file)
@@ -108,7 +108,7 @@ class AsyncCompressor {
   void _decompress(bufferlist &in, bufferlist &out);
 
  public:
-  AsyncCompressor(CephContext *c);
+  explicit AsyncCompressor(CephContext *c);
   virtual ~AsyncCompressor() {}
 
   int get_cpuid(int id) {
index d699d007fd6852023db2a2c54c5890cef959434c..be1f6b83a8baa82d0886375de0ee946faec71c67 100644 (file)
@@ -28,7 +28,7 @@ namespace ceph {
   public:
     CompressorRef compressor;
 
-    CompressionPlugin(CephContext *cct) : Plugin(cct),
+    explicit CompressionPlugin(CephContext *cct) : Plugin(cct),
                                           compressor(0) 
     {}
     
index 2030d56bf251bfa4393e804c50fa3b5b1151e310..d0780f38d31b4491dfe88fc4175febd2583ac7fa 100644 (file)
@@ -23,7 +23,7 @@ class CompressionPluginSnappy : public CompressionPlugin {
 
 public:
 
-  CompressionPluginSnappy(CephContext* cct) : CompressionPlugin(cct)
+  explicit CompressionPluginSnappy(CephContext* cct) : CompressionPlugin(cct)
   {}
 
   virtual int factory(CompressorRef *cs,
index 8a6166bd975bf14be56eff1dde5abb675987417e..ae2ca835fd536274eb8c0c6b97d15ee63c98674f 100644 (file)
@@ -26,7 +26,7 @@ class BufferlistSource : public snappy::Source {
   size_t left;
 
  public:
-  BufferlistSource(const bufferlist &data): pb(data.buffers().begin()), pb_off(0), left(data.length()) {}
+  explicit BufferlistSource(const bufferlist &data): pb(data.buffers().begin()), pb_off(0), left(data.length()) {}
   virtual ~BufferlistSource() {}
   virtual size_t Available() const { return left; }
   virtual const char* Peek(size_t* len) {
index abb5fca05ca36e4711801b3ee8f8d0f3fa07a108..41cf1a9af4eac6f958656137fb6c77b9a35a7f58 100644 (file)
@@ -63,7 +63,7 @@ namespace CrushTreeDumper {
   template <typename F>
   class Dumper : public list<Item> {
   public:
-    Dumper(const CrushWrapper *crush_) : crush(crush_) {
+    explicit Dumper(const CrushWrapper *crush_) : crush(crush_) {
       crush->find_roots(roots);
       root = roots.begin();
     }
@@ -155,7 +155,7 @@ namespace CrushTreeDumper {
 
   class FormattingDumper : public Dumper<Formatter> {
   public:
-    FormattingDumper(const CrushWrapper *crush) : Dumper<Formatter>(crush) {}
+    explicit FormattingDumper(const CrushWrapper *crush) : Dumper<Formatter>(crush) {}
 
   protected:
     virtual void dump_item(const Item &qi, Formatter *f) {
index 8a2d28b9455082cf8a488a249677e90f3f2dece5..96df08eac054e79998bbb5b3de70b7e32b814c29 100644 (file)
@@ -1498,7 +1498,7 @@ namespace {
     typedef CrushTreeDumper::Item Item;
     const CrushWrapper *crush;
   public:
-    TreeDumper(const CrushWrapper *crush)
+    explicit TreeDumper(const CrushWrapper *crush)
       : crush(crush) {}
 
     void dump(Formatter *f) {
@@ -1670,7 +1670,7 @@ class CrushTreePlainDumper : public CrushTreeDumper::Dumper<ostream> {
 public:
   typedef CrushTreeDumper::Dumper<ostream> Parent;
 
-  CrushTreePlainDumper(const CrushWrapper *crush)
+  explicit CrushTreePlainDumper(const CrushWrapper *crush)
     : Parent(crush) {}
 
   void dump(ostream *out) {
@@ -1704,7 +1704,7 @@ class CrushTreeFormattingDumper : public CrushTreeDumper::FormattingDumper {
 public:
   typedef CrushTreeDumper::FormattingDumper Parent;
 
-  CrushTreeFormattingDumper(const CrushWrapper *crush)
+  explicit CrushTreeFormattingDumper(const CrushWrapper *crush)
     : Parent(crush) {}
 
   void dump(Formatter *f) {
index df60dac6a35f15963070ffe58692daae3d3e53b4..67fc360a67e9702072342dab74538ac0729d94c7 100644 (file)
@@ -36,7 +36,7 @@ public:
   string ruleset_failure_domain;
   bool per_chunk_alignment;
 
-  ErasureCodeJerasure(const char *_technique) :
+  explicit ErasureCodeJerasure(const char *_technique) :
     k(0),
     DEFAULT_K("2"),
     m(0),
@@ -155,7 +155,7 @@ public:
   int **schedule;
   int packetsize;
 
-  ErasureCodeJerasureCauchy(const char *technique) :
+  explicit ErasureCodeJerasureCauchy(const char *technique) :
     ErasureCodeJerasure(technique),
     bitmatrix(0),
     schedule(0)
@@ -208,7 +208,7 @@ public:
   int **schedule;
   int packetsize;
 
-  ErasureCodeJerasureLiberation(const char *technique = "liberation") :
+  explicit ErasureCodeJerasureLiberation(const char *technique = "liberation") :
     ErasureCodeJerasure(technique),
     bitmatrix(0),
     schedule(0)
index ffc7748c0c91b11015610ca6db8519c1e884408e..e54688a97bb806ae81a3b38101d8304986138a5a 100644 (file)
@@ -49,7 +49,7 @@ public:
   static const string DEFAULT_KML;
 
   struct Layer {
-    Layer(string _chunks_map) : chunks_map(_chunks_map) { }
+    explicit Layer(string _chunks_map) : chunks_map(_chunks_map) { }
     ErasureCodeInterfaceRef erasure_code;
     vector<int> data;
     vector<int> coding;
@@ -74,7 +74,7 @@ public:
   };
   vector<Step> ruleset_steps;
 
-  ErasureCodeLrc(const std::string &dir)
+  explicit ErasureCodeLrc(const std::string &dir)
     : directory(dir),
       chunk_count(0), data_chunk_count(0), ruleset_root("default")
   {
index b78f29c10451ba8d4c565b75b34d27d8cef4a907..a2355f520635c8d699b74759c6a80d2b0ab4bdb7 100644 (file)
@@ -18,7 +18,7 @@ namespace {
 struct C_HandleComplete : public Context {
   ReplayHandler *replay_handler;
 
-  C_HandleComplete(ReplayHandler *_replay_handler)
+  explicit C_HandleComplete(ReplayHandler *_replay_handler)
     : replay_handler(_replay_handler) {
     replay_handler->get();
   }
@@ -33,7 +33,7 @@ struct C_HandleComplete : public Context {
 struct C_HandleEntriesAvailable : public Context {
   ReplayHandler *replay_handler;
 
-  C_HandleEntriesAvailable(ReplayHandler *_replay_handler)
+  explicit C_HandleEntriesAvailable(ReplayHandler *_replay_handler)
       : replay_handler(_replay_handler) {
     replay_handler->get();
   }
index 2d02c8c51eed8e7ecec17ef0151597b34d063a5c..c2be802dfab1d614c5bf4fc1ae2c928880b59905 100644 (file)
@@ -45,7 +45,7 @@ class KineticStore : public KeyValueDB {
   int do_open(ostream &out, bool create_if_missing);
 
 public:
-  KineticStore(CephContext *c);
+  explicit KineticStore(CephContext *c);
   ~KineticStore();
 
   static int _test_init(CephContext *c);
@@ -81,7 +81,7 @@ public:
     vector<KineticOp> ops;
     KineticStore *db;
 
-    KineticTransactionImpl(KineticStore *db) : db(db) {}
+    explicit KineticTransactionImpl(KineticStore *db) : db(db) {}
     void set(
       const string &prefix,
       const string &k,
@@ -115,7 +115,7 @@ public:
     kinetic::BlockingKineticConnection *kinetic_conn;
     kinetic::KineticStatus kinetic_status;
   public:
-    KineticWholeSpaceIteratorImpl(kinetic::BlockingKineticConnection *conn);
+    explicit KineticWholeSpaceIteratorImpl(kinetic::BlockingKineticConnection *conn);
     virtual ~KineticWholeSpaceIteratorImpl() { }
 
     int seek_to_first() {
index 5ea75b9252902eb3bf26b760d1efacfee6677ac5..c47532d826522cc34f5700d119003c5ac3b890c4 100644 (file)
@@ -18,7 +18,7 @@ using std::string;
 class CephLevelDBLogger : public leveldb::Logger {
   CephContext *cct;
 public:
-  CephLevelDBLogger(CephContext *c) : cct(c) {
+  explicit CephLevelDBLogger(CephContext *c) : cct(c) {
     cct->get();
   }
   ~CephLevelDBLogger() {
index 8a201dfa08d563d2c0250795fe5dbdc832c38eb3..8260f8b351ec89ee355485b2d1aa9206b91bf3e1 100644 (file)
@@ -73,7 +73,7 @@ class LevelDBStore : public KeyValueDB {
   class CompactThread : public Thread {
     LevelDBStore *db;
   public:
-    CompactThread(LevelDBStore *d) : db(d) {}
+    explicit CompactThread(LevelDBStore *d) : db(d) {}
     void *entry() {
       db->compact_thread_entry();
       return NULL;
@@ -185,7 +185,7 @@ public:
   public:
     leveldb::WriteBatch bat;
     LevelDBStore *db;
-    LevelDBTransactionImpl(LevelDBStore *db) : db(db) {}
+    explicit LevelDBTransactionImpl(LevelDBStore *db) : db(db) {}
     void set(
       const string &prefix,
       const string &k,
@@ -220,7 +220,7 @@ public:
   protected:
     boost::scoped_ptr<leveldb::Iterator> dbiter;
   public:
-    LevelDBWholeSpaceIteratorImpl(leveldb::Iterator *iter) :
+    explicit LevelDBWholeSpaceIteratorImpl(leveldb::Iterator *iter) :
       dbiter(iter) { }
     virtual ~LevelDBWholeSpaceIteratorImpl() { }
 
index 80f7fc4828915e2f4f60b959554ecc860b224f8f..63be34fd827bd055b53e97f2ef7a1d0b6b577dd7 100644 (file)
@@ -35,7 +35,7 @@ using std::string;
 class CephRocksdbLogger : public rocksdb::Logger {
   CephContext *cct;
 public:
-  CephRocksdbLogger(CephContext *c) : cct(c) {
+  explicit CephRocksdbLogger(CephContext *c) : cct(c) {
     cct->get();
   }
   ~CephRocksdbLogger() {
index d2caf8aac765fa2d46e7173f84ff2505898e5f9f..63cbc5ad6c2ba94cac8f368ca8dd430f2078299e 100644 (file)
@@ -72,7 +72,7 @@ class RocksDBStore : public KeyValueDB {
   class CompactThread : public Thread {
     RocksDBStore *db;
   public:
-    CompactThread(RocksDBStore *d) : db(d) {}
+    explicit CompactThread(RocksDBStore *d) : db(d) {}
     void *entry() {
       db->compact_thread_entry();
       return NULL;
@@ -142,7 +142,7 @@ public:
     rocksdb::WriteBatch *bat;
     RocksDBStore *db;
 
-    RocksDBTransactionImpl(RocksDBStore *_db);
+    explicit RocksDBTransactionImpl(RocksDBStore *_db);
     ~RocksDBTransactionImpl();
     void set(
       const string &prefix,
@@ -179,7 +179,7 @@ public:
   protected:
     rocksdb::Iterator *dbiter;
   public:
-    RocksDBWholeSpaceIteratorImpl(rocksdb::Iterator *iter) :
+    explicit RocksDBWholeSpaceIteratorImpl(rocksdb::Iterator *iter) :
       dbiter(iter) { }
     //virtual ~RocksDBWholeSpaceIteratorImpl() { }
     ~RocksDBWholeSpaceIteratorImpl();
index c5bb2d4d3a009346fa806a45ad399122f71fc438..400669abbaa8872287df0049f469ba69de121adc 100644 (file)
@@ -37,7 +37,7 @@
 struct ceph_mount_info
 {
 public:
-  ceph_mount_info(CephContext *cct_)
+  explicit ceph_mount_info(CephContext *cct_)
     : mounted(false),
       inited(false),
       client(NULL),
index efcd5962a80b9bb7798b595b67fc4ca0f903c527..aaadc1add0f51910a3bf7012748fce1cf2af60b7 100644 (file)
@@ -170,7 +170,7 @@ namespace librados {
 struct C_AioComplete : public Context {
   AioCompletionImpl *c;
 
-  C_AioComplete(AioCompletionImpl *cc) : c(cc) {
+  explicit C_AioComplete(AioCompletionImpl *cc) : c(cc) {
     c->_get();
   }
 
@@ -189,7 +189,7 @@ struct C_AioComplete : public Context {
 struct C_AioSafe : public Context {
   AioCompletionImpl *c;
 
-  C_AioSafe(AioCompletionImpl *cc) : c(cc) {
+  explicit C_AioSafe(AioCompletionImpl *cc) : c(cc) {
     c->_get();
   }
 
@@ -216,7 +216,7 @@ struct C_AioSafe : public Context {
 struct C_AioCompleteAndSafe : public Context {
   AioCompletionImpl *c;
 
-  C_AioCompleteAndSafe(AioCompletionImpl *cc) : c(cc) {
+  explicit C_AioCompleteAndSafe(AioCompletionImpl *cc) : c(cc) {
     c->get();
   }
 
index 24eda4f94377bf5caf5a4aad7e05b21239f9662d..f3186eceb62f10e79fdaf25a23133dfcdaf1a011 100644 (file)
@@ -762,7 +762,7 @@ int librados::IoCtxImpl::aio_read(const object_t oid, AioCompletionImpl *c,
 class C_ObjectOperation : public Context {
 public:
   ::ObjectOperation m_ops;
-  C_ObjectOperation(Context *c) : m_ctx(c) {}
+  explicit C_ObjectOperation(Context *c) : m_ctx(c) {}
   virtual void finish(int r) {
     m_ctx->complete(r);
   }
index 25166c01cf5542bcebd11e1baf66f33de114fa4c..19faf3341d339b4bad0e7f53c13233f2ee593194 100644 (file)
@@ -161,7 +161,7 @@ struct librados::IoCtxImpl {
 
   struct C_aio_Ack : public Context {
     librados::AioCompletionImpl *c;
-    C_aio_Ack(AioCompletionImpl *_c);
+    explicit C_aio_Ack(AioCompletionImpl *_c);
     void finish(int r);
   };
 
@@ -175,7 +175,7 @@ struct librados::IoCtxImpl {
 
   struct C_aio_Safe : public Context {
     AioCompletionImpl *c;
-    C_aio_Safe(AioCompletionImpl *_c);
+    explicit C_aio_Safe(AioCompletionImpl *_c);
     void finish(int r);
   };
 
index 443b2c23a17c8bf50fba93dee27f95da2837ca62..b3fba491b445c1cc1c9c5c235cb28adc99ee954a 100644 (file)
@@ -91,7 +91,7 @@ namespace librados {
     PoolAsyncCompletionImpl *c;
 
   public:
-    C_PoolAsync_Safe(PoolAsyncCompletionImpl *_c) : c(_c) {
+    explicit C_PoolAsync_Safe(PoolAsyncCompletionImpl *_c) : c(_c) {
       c->get();
     }
     ~C_PoolAsync_Safe() {
index a26e46f61fa1cf04bc15db805cd84a6385207d02..e190bfc90117030c12b5466baad5af8037b060ab 100644 (file)
@@ -75,7 +75,7 @@ private:
 public:
   Finisher finisher;
 
-  RadosClient(CephContext *cct_);
+  explicit RadosClient(CephContext *cct_);
   ~RadosClient();
   int ping_monitor(string mon_id, string *result);
   int connect();
index ed256dbc6497ba0166d886de546d0310791517fb..e9038b38e574dcf3c399c66ff15b5c7d7904032f 100644 (file)
@@ -188,7 +188,7 @@ class ObjectOpCompletionCtx : public Context {
   librados::ObjectOperationCompletion *completion;
   bufferlist bl;
 public:
-  ObjectOpCompletionCtx(librados::ObjectOperationCompletion *c) : completion(c) {}
+  explicit ObjectOpCompletionCtx(librados::ObjectOperationCompletion *c) : completion(c) {}
   void finish(int r) {
     completion->handle_completion(r, bl);
     delete completion;
@@ -4873,7 +4873,7 @@ struct RadosOmapIter {
 class C_OmapIter : public Context {
   RadosOmapIter *iter;
 public:
-  C_OmapIter(RadosOmapIter *iter) : iter(iter) {}
+  explicit C_OmapIter(RadosOmapIter *iter) : iter(iter) {}
   void finish(int r) {
     iter->i = iter->values.begin();
   }
@@ -4882,7 +4882,7 @@ public:
 class C_XattrsIter : public Context {
   librados::RadosXattrsIter *iter;
 public:
-  C_XattrsIter(librados::RadosXattrsIter *iter) : iter(iter) {}
+  explicit C_XattrsIter(librados::RadosXattrsIter *iter) : iter(iter) {}
   void finish(int r) {
     iter->i = iter->attrset.begin();
   }
@@ -4924,7 +4924,7 @@ extern "C" void rados_read_op_omap_get_vals(rados_read_op_t read_op,
 struct C_OmapKeysIter : public Context {
   RadosOmapIter *iter;
   std::set<std::string> keys;
-  C_OmapKeysIter(RadosOmapIter *iter) : iter(iter) {}
+  explicit C_OmapKeysIter(RadosOmapIter *iter) : iter(iter) {}
   void finish(int r) {
     // map each key to an empty bl
     for (std::set<std::string>::const_iterator i = keys.begin();
index fd315ad75f44d43a4b59fc68c2e8a92334cbad99..0c79d8ac3ca9f2234f18f8f0124dc368db7e5efe 100644 (file)
@@ -18,7 +18,7 @@ struct C_CompleteFlushes : public Context {
   ImageCtx *image_ctx;
   std::list<Context *> flush_contexts;
 
-  C_CompleteFlushes(ImageCtx *image_ctx, std::list<Context *> &&flush_contexts)
+  explicit C_CompleteFlushes(ImageCtx *image_ctx, std::list<Context *> &&flush_contexts)
     : image_ctx(image_ctx), flush_contexts(std::move(flush_contexts)) {
   }
   virtual void finish(int r) {
index cef72cceca797de89ae21ff1827aebb292fc1ca6..1d0d189eadb62dc964ce18767addf4fccb65ea25 100644 (file)
@@ -28,7 +28,7 @@ const std::string WATCHER_LOCK_COOKIE_PREFIX = "auto";
 template <typename I>
 struct C_SendReleaseRequest : public Context {
   ReleaseRequest<I>* request;
-  C_SendReleaseRequest(ReleaseRequest<I>* request) : request(request) {
+  explicit C_SendReleaseRequest(ReleaseRequest<I>* request) : request(request) {
   }
   virtual void finish(int r) override {
     request->send();
index 7e48e4f34bb9275bc4be96cb4d79380fa9009adf..0961d0e181718da87bb6f974b43b0dd5c1125af3 100644 (file)
@@ -48,7 +48,7 @@ namespace {
 
 class ThreadPoolSingleton : public ThreadPool {
 public:
-  ThreadPoolSingleton(CephContext *cct)
+  explicit ThreadPoolSingleton(CephContext *cct)
     : ThreadPool(cct, "librbd::thread_pool", "tp_librbd", cct->_conf->rbd_op_threads,
                  "rbd_op_threads") {
     start();
index 1aea29d8be6ee7a3444859773bf115f82c15dad5..5485ba5d62c51e1dffcd3566f0a071cb6a1a388e 100644 (file)
@@ -21,7 +21,7 @@ public:
 
 class FlushCacheCommand : public LibrbdAdminSocketCommand {
 public:
-  FlushCacheCommand(ImageCtx *ictx) : ictx(ictx) {}
+  explicit FlushCacheCommand(ImageCtx *ictx) : ictx(ictx) {}
 
   bool call(stringstream *ss) {
     int r = flush(ictx);
@@ -38,7 +38,7 @@ private:
 
 struct InvalidateCacheCommand : public LibrbdAdminSocketCommand {
 public:
-  InvalidateCacheCommand(ImageCtx *ictx) : ictx(ictx) {}
+  explicit InvalidateCacheCommand(ImageCtx *ictx) : ictx(ictx) {}
 
   bool call(stringstream *ss) {
     int r = invalidate_cache(ictx);
index 93b12ee40dd63a0313b1375d8e2affa485f23a64..f3a6f4bfe0ff86c5add360cc821c7c588a2f760f 100644 (file)
@@ -13,7 +13,7 @@ namespace {
 
 class EncodePayloadVisitor : public boost::static_visitor<void> {
 public:
-  EncodePayloadVisitor(bufferlist &bl) : m_bl(bl) {}
+  explicit EncodePayloadVisitor(bufferlist &bl) : m_bl(bl) {}
 
   template <typename Payload>
   inline void operator()(const Payload &payload) const {
@@ -42,7 +42,7 @@ private:
 
 class DumpPayloadVisitor : public boost::static_visitor<void> {
 public:
-  DumpPayloadVisitor(Formatter *formatter) : m_formatter(formatter) {}
+  explicit DumpPayloadVisitor(Formatter *formatter) : m_formatter(formatter) {}
 
   template <typename Payload>
   inline void operator()(const Payload &payload) const {
index 0663ea83cba5b02c793660880f797ebe7ba48bdc..928f4049d22c8cf9bab7278fe3f03ab9cd08ff24 100644 (file)
@@ -1729,7 +1729,7 @@ int validate_pool(IoCtx &io_ctx, CephContext *cct) {
   }
 
   struct CopyProgressCtx {
-    CopyProgressCtx(ProgressContext &p)
+    explicit CopyProgressCtx(ProgressContext &p)
       : destictx(NULL), src_size(0), prog_ctx(p)
     { }
 
index be350afd58a230d38556c06dd72659eaef31becb..5ed5cf3d071f2b259bd1105292d30e948138bcb1 100644 (file)
@@ -21,7 +21,7 @@ public:
 
 class EncodeEventVisitor : public boost::static_visitor<void> {
 public:
-  EncodeEventVisitor(bufferlist &bl) : m_bl(bl) {
+  explicit EncodeEventVisitor(bufferlist &bl) : m_bl(bl) {
   }
 
   template <typename Event>
@@ -50,7 +50,7 @@ private:
 
 class DumpEventVisitor : public boost::static_visitor<void> {
 public:
-  DumpEventVisitor(Formatter *formatter) : m_formatter(formatter) {}
+  explicit DumpEventVisitor(Formatter *formatter) : m_formatter(formatter) {}
 
   template <typename Event>
   inline void operator()(const Event &event) const {
index 57727d312bc913ec180053e537bd0e7e4ac59382..db8b6199a04c109cfe8c6302a3225546e87946cd 100644 (file)
@@ -51,7 +51,7 @@ class Log : private Thread
   void _log_message(const char *s, bool crash);
 
 public:
-  Log(SubsystemMap *s);
+  explicit Log(SubsystemMap *s);
   virtual ~Log();
 
   void set_flush_on_exit();
index a63daff8bbf355c8ce0f1d1686fe5b0e52ccbe5e..29efb4ad586684e2516819c37e14b06718483df8 100644 (file)
@@ -67,7 +67,7 @@ class Beacon : public Dispatcher
   class C_MDS_BeaconSender : public Context {
     Beacon *beacon;
   public:
-    C_MDS_BeaconSender(Beacon *beacon_) : beacon(beacon_) {}
+    explicit C_MDS_BeaconSender(Beacon *beacon_) : beacon(beacon_) {}
     void finish(int r) {
       assert(beacon->lock.is_locked_by_me());
       beacon->sender = NULL;
index 119fb32cca056cc0190288506b8aaa58c95e5dea..f43c768ad60cf59db92aa4549683b850182185a3 100644 (file)
@@ -51,7 +51,7 @@ protected:
   MDSRank* get_mds() {return dir->cache->mds;}
 
 public:
-  CDirContext(CDir *d) : dir(d) {
+  explicit CDirContext(CDir *d) : dir(d) {
     assert(dir != NULL);
   }
 };
@@ -64,7 +64,7 @@ protected:
   MDSRank* get_mds() {return dir->cache->mds;}
 
 public:
-  CDirIOContext(CDir *d) : dir(d) {
+  explicit CDirIOContext(CDir *d) : dir(d) {
     assert(dir != NULL);
   }
 };
@@ -2714,7 +2714,7 @@ CDir *CDir::get_frozen_tree_root()
 
 class C_Dir_AuthUnpin : public CDirContext {
   public:
-  C_Dir_AuthUnpin(CDir *d) : CDirContext(d) {}
+  explicit C_Dir_AuthUnpin(CDir *d) : CDirContext(d) {}
   void finish(int r) {
     dir->auth_unpin(dir->get_inode());
   }
index 038de0e7a9122fe9b96279f6e35a07b7c472e24b..68ebd76a7ae0a38e37c5c7fb2063d990f6d5f8ed 100644 (file)
@@ -58,7 +58,7 @@ protected:
   CInode *in;
   MDSRank *get_mds() {return in->mdcache->mds;}
 public:
-  CInodeIOContext(CInode *in_) : in(in_) {
+  explicit CInodeIOContext(CInode *in_) : in(in_) {
     assert(in != NULL);
   }
 };
index 02656b0ece72e722b14173a27604fd5401f7d44f..a767d46587ca8282ee0b4b5cb4223469e471ffe1 100644 (file)
@@ -26,7 +26,7 @@ class InoTable : public MDSTable {
   interval_set<inodeno_t> projected_free;
 
  public:
-  InoTable(MDSRank *m) : MDSTable(m, "inotable", true) { }
+  explicit InoTable(MDSRank *m) : MDSTable(m, "inotable", true) { }
 
   inodeno_t project_alloc_id(inodeno_t id=0);
   void apply_alloc_id(inodeno_t id);
index aea88f5b6830c303de1fb50d86c0338163174012..25977fbe26be3e21650276370d63307ebd6703bf 100644 (file)
@@ -64,7 +64,7 @@ class LockerContext : public MDSInternalContextBase {
   }
 
   public:
-  LockerContext(Locker *locker_) : locker(locker_) {
+  explicit LockerContext(Locker *locker_) : locker(locker_) {
     assert(locker != NULL);
   }
 };
index 26bf2797a515124e86f6f95a8bd8b648a9ced99d..bf57db00e33066c2a8e28ff7f96b1e2a27662785 100644 (file)
@@ -68,7 +68,7 @@ protected:
 public:
   LogSegment *_segment;
 
-  LogEvent(int t)
+  explicit LogEvent(int t)
     : _type(t), _start_off(0), _segment(0) { }
   virtual ~LogEvent() { }
 
index 263c21ad14e5967dd8892ff2516cc85a44f1b6c0..4c42568aa2607c36e99fb0c3dc35f5d5aea2e9f7 100644 (file)
@@ -113,7 +113,7 @@ void MDBalancer::tick()
 
 class C_Bal_SendHeartbeat : public MDSInternalContext {
 public:
-  C_Bal_SendHeartbeat(MDSRank *mds_) : MDSInternalContext(mds_) { }
+  explicit C_Bal_SendHeartbeat(MDSRank *mds_) : MDSInternalContext(mds_) { }
   virtual void finish(int f) {
     mds->balancer->send_heartbeat();
   }
index d63da01cdeaf9a73233c4ff50d062c58f1edaf8f..0441f84e120f17b1c01fd24e0202be15762f8712 100644 (file)
@@ -143,7 +143,7 @@ protected:
     return mdcache->mds;
   }
 public:
-  MDCacheContext(MDCache *mdc_) : mdcache(mdc_) {}
+  explicit MDCacheContext(MDCache *mdc_) : mdcache(mdc_) {}
 };
 
 
@@ -163,7 +163,7 @@ protected:
     return mdcache->mds;
   }
 public:
-  MDCacheIOContext(MDCache *mdc_) : mdcache(mdc_) {}
+  explicit MDCacheIOContext(MDCache *mdc_) : mdcache(mdc_) {}
 };
 
 
@@ -574,7 +574,7 @@ void MDCache::_create_system_file_finish(MutationRef& mut, CDentry *dn, version_
 
 struct C_MDS_RetryOpenRoot : public MDSInternalContext {
   MDCache *cache;
-  C_MDS_RetryOpenRoot(MDCache *c) : MDSInternalContext(c->mds), cache(c) {}
+  explicit C_MDS_RetryOpenRoot(MDCache *c) : MDSInternalContext(c->mds), cache(c) {}
   void finish(int r) {
     if (r < 0)
       cache->mds->suicide();
@@ -4475,7 +4475,7 @@ void MDCache::handle_cache_rejoin_weak(MMDSCacheRejoin *weak)
 
 class C_MDC_RejoinGatherFinish : public MDCacheContext {
 public:
-  C_MDC_RejoinGatherFinish(MDCache *c) : MDCacheContext(c) {}
+  explicit C_MDC_RejoinGatherFinish(MDCache *c) : MDCacheContext(c) {}
   void finish(int r) {
     mdcache->rejoin_gather_finish();
   }
@@ -5633,7 +5633,7 @@ void MDCache::do_delayed_cap_imports()
 }
 
 struct C_MDC_OpenSnapParents : public MDCacheContext {
-  C_MDC_OpenSnapParents(MDCache *c) : MDCacheContext(c) {}
+  explicit C_MDC_OpenSnapParents(MDCache *c) : MDCacheContext(c) {}
   void finish(int r) {
     mdcache->open_snap_parents();
   }
@@ -7251,7 +7251,7 @@ void MDCache::check_memory_usage()
 
 class C_MDC_ShutdownCheck : public MDCacheContext {
 public:
-  C_MDC_ShutdownCheck(MDCache *m) : MDCacheContext(m) {}
+  explicit C_MDC_ShutdownCheck(MDCache *m) : MDCacheContext(m) {}
   void finish(int) {
     mdcache->shutdown_check();
   }
index 1a7f89691f8eadb5206d04ae45f7566feaf9e444..3b44d0c7f672cb1212b849b9e8286def23719dc7 100644 (file)
@@ -629,7 +629,7 @@ public:
   Migrator *migrator;
 
  public:
-  MDCache(MDSRank *m);
+  explicit MDCache(MDSRank *m);
   ~MDCache();
   
   // debug
index bc27661df923685de9d868e4c533f8339ad6b0e5..86a19457859160897d00a3df92426e1bc0952208 100644 (file)
@@ -104,7 +104,7 @@ class C_MDL_WriteError : public MDSIOContextBase {
   }
 
   public:
-  C_MDL_WriteError(MDLog *m) : mdlog(m) {}
+  explicit C_MDL_WriteError(MDLog *m) : mdlog(m) {}
 };
 
 
index 558f7231c1abf911f36490c2f411526c561e74dc..663eac6dc0f09f19a1091d176bdfcc6faca1ca78 100644 (file)
@@ -87,7 +87,7 @@ protected:
   class ReplayThread : public Thread {
     MDLog *log;
   public:
-    ReplayThread(MDLog *l) : log(l) {}
+    explicit ReplayThread(MDLog *l) : log(l) {}
     void* entry() {
       log->_replay_thread();
       return 0;
@@ -109,7 +109,7 @@ protected:
     MDSInternalContextBase *completion;
   public:
     void set_completion(MDSInternalContextBase *c) {completion = c;}
-    RecoveryThread(MDLog *l) : log(l), completion(NULL) {}
+    explicit RecoveryThread(MDLog *l) : log(l), completion(NULL) {}
     void* entry() {
       log->_recovery_thread(completion);
       return 0;
@@ -141,7 +141,7 @@ protected:
   class SubmitThread : public Thread {
     MDLog *log;
   public:
-    SubmitThread(MDLog *l) : log(l) {}
+    explicit SubmitThread(MDLog *l) : log(l) {}
     void* entry() {
       log->_submit_thread();
       return 0;
@@ -182,7 +182,7 @@ public:
   void set_write_iohint(unsigned iohint_flags);
 
 public:
-  MDLog(MDSRank *m) : mds(m),
+  explicit MDLog(MDSRank *m) : mds(m),
                       num_events(0), 
                       unflushed(0),
                       capped(false),
index ccf2857b70bfe73de9dbed7fcbf050c291647951..eee7707fe03cc1d7cac5881dc99c4623f760c632 100644 (file)
@@ -74,7 +74,7 @@ struct MDSCapMatch {
 
   MDSCapMatch() : uid(MDS_AUTH_UID_ANY) {}
   MDSCapMatch(int64_t uid_, std::vector<gid_t>& gids_) : uid(uid_), gids(gids_) {}
-  MDSCapMatch(std::string path_)
+  explicit MDSCapMatch(std::string path_)
     : uid(MDS_AUTH_UID_ANY), path(path_) {
     normalize_path();
   }
@@ -119,11 +119,11 @@ class MDSAuthCaps
   std::vector<MDSCapGrant> grants;
 
 public:
-  MDSAuthCaps(CephContext *cct_=NULL)
+  explicit MDSAuthCaps(CephContext *cct_=NULL)
     : cct(cct_) { }
 
   // this ctor is used by spirit/phoenix; doesn't need cct.
-  MDSAuthCaps(const std::vector<MDSCapGrant> &grants_)
+  explicit MDSAuthCaps(const std::vector<MDSCapGrant> &grants_)
     : cct(NULL), grants(grants_) { }
 
   void set_allow_all();
index cd49f3e55f197eb4165a83da7b536b3789f02822..d26d1bdb783a6ccdeead1ea497bb9ba0e02550b6 100644 (file)
@@ -55,7 +55,7 @@ protected:
   virtual MDSRank* get_mds();
 
 public:
-  MDSInternalContext(MDSRank *mds_) : mds(mds_) {
+  explicit MDSInternalContext(MDSRank *mds_) : mds(mds_) {
     assert(mds != NULL);
   }
 };
@@ -91,7 +91,7 @@ protected:
   virtual MDSRank* get_mds();
 
 public:
-  MDSIOContext(MDSRank *mds_) : mds(mds_) {
+  explicit MDSIOContext(MDSRank *mds_) : mds(mds_) {
     assert(mds != NULL);
   }
 };
index 8873ca5a334652971590743ca6312150ce598b9e..c5f0a8db6f5b9f802b74beb67b980db1a8b489a6 100644 (file)
@@ -153,7 +153,7 @@ MDSDaemon::~MDSDaemon() {
 class MDSSocketHook : public AdminSocketHook {
   MDSDaemon *mds;
 public:
-  MDSSocketHook(MDSDaemon *m) : mds(m) {}
+  explicit MDSSocketHook(MDSDaemon *m) : mds(m) {}
   bool call(std::string command, cmdmap_t& cmdmap, std::string format,
            bufferlist& out) {
     stringstream ss;
@@ -700,7 +700,7 @@ int MDSDaemon::_handle_command(
     MDSDaemon *mds;
 
     public:
-    SuicideLater(MDSDaemon *mds_) : mds(mds_) {}
+    explicit SuicideLater(MDSDaemon *mds_) : mds(mds_) {}
     void finish(int r) {
       // Wait a little to improve chances of caller getting
       // our response before seeing us disappear from mdsmap
@@ -717,7 +717,7 @@ int MDSDaemon::_handle_command(
 
     public:
 
-    RespawnLater(MDSDaemon *mds_) : mds(mds_) {}
+    explicit RespawnLater(MDSDaemon *mds_) : mds(mds_) {}
     void finish(int r) {
       // Wait a little to improve chances of caller getting
       // our response before seeing us disappear from mdsmap
index 8c61ea9ca4ba9ae7b23cb2b918892e4158eafa6b..783f37e348fbfc3286e2350f84f07c3206f57ade 100644 (file)
@@ -130,7 +130,7 @@ class MDSDaemon : public Dispatcher, public md_config_obs_t {
     protected:
       MDSDaemon *mds_daemon;
   public:
-    C_MDS_Tick(MDSDaemon *m) : mds_daemon(m) {}
+    explicit C_MDS_Tick(MDSDaemon *m) : mds_daemon(m) {}
     void finish(int r) {
       assert(mds_daemon->mds_lock.is_locked_by_me());
 
index 943020bc79d0b4c8b7b8c12c6510918dca8c0887..6b8e2bb3a0f8107e9374186100e078a94f7ea38c 100644 (file)
@@ -1080,7 +1080,7 @@ inline void MDSRank::standby_replay_restart()
 
 class MDSRank::C_MDS_StandbyReplayRestart : public MDSInternalContext {
 public:
-  C_MDS_StandbyReplayRestart(MDSRank *m) : MDSInternalContext(m) {}
+  explicit C_MDS_StandbyReplayRestart(MDSRank *m) : MDSInternalContext(m) {}
   void finish(int r) {
     assert(!r);
     mds->standby_replay_restart();
index 5d334a21624108cd200065dad8b3f3d41d226f1f..a11f3b943eac813278d01fd3a569fb810fdaf70a 100644 (file)
@@ -205,7 +205,7 @@ class MDSRank {
       MDSRank *mds;
       Cond cond;
       public:
-      ProgressThread(MDSRank *mds_) : mds(mds_) {}
+      explicit ProgressThread(MDSRank *mds_) : mds(mds_) {}
       void * entry(); 
       void shutdown();
       void signal() {cond.Signal();}
index 5ff0dd0d9258e3ca3e65500c16abe1f4314d9f47..083eae9960c01b11d27360cef1764d7cd606b5b2 100644 (file)
@@ -39,7 +39,7 @@ class MDSTableIOContext : public MDSIOContextBase
     MDSTable *ida;
     MDSRank *get_mds() {return ida->mds;}
   public:
-    MDSTableIOContext(MDSTable *ida_) : ida(ida_) {
+    explicit MDSTableIOContext(MDSTable *ida_) : ida(ida_) {
       assert(ida != NULL);
     }
 };
index d807fb628840119f0493471025e3ea9b277817b4..4dce94fafff1e323e792bafd7ddb138f2fa5366c 100644 (file)
@@ -90,7 +90,7 @@ protected:
     return mig->mds;
   }
 public:
-  MigratorContext(Migrator *mig_) : mig(mig_) {
+  explicit MigratorContext(Migrator *mig_) : mig(mig_) {
     assert(mig != NULL);
   }
 };
index c0e2f7af1b1b6eb5d4f5596c1adbecb6ffc36509..6750c5fcb495828dd8716548eced306e93d634b7 100644 (file)
@@ -30,7 +30,7 @@ public:
   void enqueue(CInode *in);
   void advance();
   void prioritize(CInode *in);   ///< do this inode now/soon
-  RecoveryQueue(MDSRank *mds_);
+  explicit RecoveryQueue(MDSRank *mds_);
 
   void set_logger(PerfCounters *p) {logger=p;}
 
index c490b446a8228161a8c7e8c0009e1cad5b9d08f4..78bd474a2c82a992ab40a003319724f969347041 100644 (file)
@@ -26,7 +26,7 @@ class ScatterLock : public SimpleLock {
     xlist<ScatterLock*>::item item_updated;
     utime_t update_stamp;
 
-    more_bits_t(ScatterLock *lock) :
+    explicit more_bits_t(ScatterLock *lock) :
       state_flags(0),
       item_updated(lock)
     {}
index 46c08bd37c4d0962be42b4f5a5ae2960b9e88eb4..fd764cab5b60728e71fd71afd5ca1e3af5b15bd7 100644 (file)
@@ -80,7 +80,7 @@ class ServerContext : public MDSInternalContextBase {
   }
 
   public:
-  ServerContext(Server *s) : server(s) {
+  explicit ServerContext(Server *s) : server(s) {
     assert(server != NULL);
   }
 };
@@ -558,7 +558,7 @@ class C_MDS_TerminatedSessions : public ServerContext {
     server->terminating_sessions = false;
   }
   public:
-  C_MDS_TerminatedSessions(Server *s) : ServerContext(s) {}
+  explicit C_MDS_TerminatedSessions(Server *s) : ServerContext(s) {}
 };
 
 void Server::terminate_sessions()
index 44ee5b782ea663793b2f02d920f77218a7bbd01a..d194a2f0574e7196dc65c070b2ca024cab5bf44b 100644 (file)
@@ -63,7 +63,7 @@ private:
 public:
   bool terminating_sessions;
 
-  Server(MDSRank *m);
+  explicit Server(MDSRank *m);
   ~Server() {
     g_ceph_context->get_perfcounters_collection()->remove(logger);
     delete logger;
index 4552e5e91e9bfcd30ec134c542ab5b6c4c9b600a..9b4bc7fa2bec0beb33930b6805804c6760b90393 100644 (file)
@@ -35,7 +35,7 @@ class SessionMapIOContext : public MDSIOContextBase
     SessionMap *sessionmap;
     MDSRank *get_mds() {return sessionmap->mds;}
   public:
-    SessionMapIOContext(SessionMap *sessionmap_) : sessionmap(sessionmap_) {
+    explicit SessionMapIOContext(SessionMap *sessionmap_) : sessionmap(sessionmap_) {
       assert(sessionmap != NULL);
     }
 };
@@ -253,7 +253,7 @@ void SessionMap::load(MDSInternalContextBase *onload)
 class C_IO_SM_LoadLegacy : public SessionMapIOContext {
 public:
   bufferlist bl;
-  C_IO_SM_LoadLegacy(SessionMap *cm) : SessionMapIOContext(cm) {}
+  explicit C_IO_SM_LoadLegacy(SessionMap *cm) : SessionMapIOContext(cm) {}
   void finish(int r) {
     sessionmap->_load_legacy_finish(r, bl);
   }
index b6a3792707542bf1096593ee9c5752dca0ad07f2..75a7d0704e5550f2ef67506007742306010f4cf2 100644 (file)
@@ -428,7 +428,7 @@ public:
   uint64_t set_state(Session *session, int state);
   map<version_t, list<MDSInternalContextBase*> > commit_waiters;
 
-  SessionMap(MDSRank *m) : mds(m),
+  explicit SessionMap(MDSRank *m) : mds(m),
                       projected(0), committing(0), committed(0),
                        loaded_legacy(false)
   { }
index 085aec7f7b615b5cacd0e93f31faaf5b289b80d4..faec26ad5a473c6d0197b1d02c08e0772b13cf22 100644 (file)
@@ -58,7 +58,7 @@ struct LockType {
   int type;
   const sm_t *sm;
 
-  LockType(int t) : type(t) {
+  explicit LockType(int t) : type(t) {
     switch (type) {
     case CEPH_LOCK_DN:
     case CEPH_LOCK_IAUTH:
index 883699f2644828346bb6cbc31f7f285a2c456ce9..800538c8b136e8392dd94f2d0cf24926f0c5ea6d 100644 (file)
@@ -24,7 +24,7 @@ class LogSegment;
 
 class SnapClient : public MDSTableClient {
 public:
-  SnapClient(MDSRank *m) : MDSTableClient(m, TABLE_SNAP) {}
+  explicit SnapClient(MDSRank *m) : MDSTableClient(m, TABLE_SNAP) {}
 
   void resend_queries() {}
   void handle_query_result(MMDSTableRequest *m) {}
index da1a2fe2ce377442fa46b4435cb5c577722e2524..6c30b33e553988184654dc7d2fe44516fba8c90d 100644 (file)
@@ -42,7 +42,7 @@ protected:
     return sm->mds;
   }
 public:
-  StrayManagerIOContext(StrayManager *sm_) : sm(sm_) {}
+  explicit StrayManagerIOContext(StrayManager *sm_) : sm(sm_) {}
 };
 
 
@@ -54,7 +54,7 @@ protected:
     return sm->mds;
   }
 public:
-  StrayManagerContext(StrayManager *sm_) : sm(sm_) {}
+  explicit StrayManagerContext(StrayManager *sm_) : sm(sm_) {}
 };
 
 
index c62edd3e1b65199aef07405389730f9a2b23f17e..3576889ef892fb67e111fa0570a65c8ae4f30643 100644 (file)
@@ -150,7 +150,7 @@ class StrayManager
 
   // My public interface is for consumption by MDCache
   public:
-  StrayManager(MDSRank *mds);
+  explicit StrayManager(MDSRank *mds);
   void set_logger(PerfCounters *l) {logger = l;}
 
   bool eval_stray(CDentry *dn, bool delay=false);
index 48de756f7ae8a86af94ec4dfa44d9e7c9ea18147..4cdbbfbe44ffd215195d8f62f3a19018110ddd67 100644 (file)
@@ -23,7 +23,7 @@ public:
   metareqid_t reqid;
 
   ECommitted() : LogEvent(EVENT_COMMITTED) { }
-  ECommitted(metareqid_t r) : 
+  explicit ECommitted(metareqid_t r) :
     LogEvent(EVENT_COMMITTED), reqid(r) { }
 
   void print(ostream& out) const {
index 7d219e936391c8948be0b726fee3ac02ad51049f..8db8f6738c59caa0eaf9a3ddc2c34b7e61156c6f 100644 (file)
@@ -94,7 +94,7 @@ public:
        old_inodes = *oi;
       snapbl = sbl;
     }
-    fullbit(bufferlist::iterator &p) {
+    explicit fullbit(bufferlist::iterator &p) {
       decode(p);
     }
     fullbit() {}
@@ -144,7 +144,7 @@ public:
 
     remotebit(const string& d, snapid_t df, snapid_t dl, version_t v, inodeno_t i, unsigned char dt, bool dr) : 
       dn(d), dnfirst(df), dnlast(dl), dnv(v), ino(i), d_type(dt), dirty(dr) { }
-    remotebit(bufferlist::iterator &p) { decode(p); }
+    explicit remotebit(bufferlist::iterator &p) { decode(p); }
     remotebit(): dnfirst(0), dnlast(0), dnv(0), ino(0),
        d_type('\0'), dirty(false) {}
 
@@ -171,7 +171,7 @@ public:
 
     nullbit(const string& d, snapid_t df, snapid_t dl, version_t v, bool dr) : 
       dn(d), dnfirst(df), dnlast(dl), dnv(v), dirty(dr) { }
-    nullbit(bufferlist::iterator &p) { decode(p); }
+    explicit nullbit(bufferlist::iterator &p) { decode(p); }
     nullbit(): dnfirst(0), dnlast(0), dnv(0), dirty(false) {}
 
     void encode(bufferlist& bl) const;
@@ -333,7 +333,7 @@ private:
   // for replay, in certain cases
   //LogSegment *_segment;
 
-  EMetaBlob(MDLog *mdl = 0);  // defined in journal.cc
+  explicit EMetaBlob(MDLog *mdl = 0);  // defined in journal.cc
   ~EMetaBlob() { }
 
   void print(ostream& out) {
index 9a585c2d22f0120e1723ecadb195e2c11b7f9be3..ed825c6b8d4cf1ea56810fe11954ee59b27b3c73 100644 (file)
@@ -22,7 +22,7 @@ class ENoOp : public LogEvent {
 
 public:
   ENoOp() : LogEvent(EVENT_NOOP), pad_size(0) { }
-  ENoOp(uint32_t size_) : LogEvent(EVENT_NOOP), pad_size(size_){ }
+  explicit ENoOp(uint32_t size_) : LogEvent(EVENT_NOOP), pad_size(size_){ }
 
   void encode(bufferlist& bl) const;
   void decode(bufferlist::iterator& bl);
index c22a58510e5939153683ef6217a425ad23ad5e93..0c1175baf1a6d69dfa3d94ff5cf8a432b9a4df79 100644 (file)
@@ -24,7 +24,7 @@ public:
   vector<inodeno_t> inos;
 
   EOpen() : LogEvent(EVENT_OPEN) { }
-  EOpen(MDLog *mdlog) : 
+  explicit EOpen(MDLog *mdlog) :
     LogEvent(EVENT_OPEN), metablob(mdlog) { }
 
   void print(ostream& out) const {
index 37149eb7c4355a21956377ce826d432e3b095d74..55ba2b8367fe66b617b8b524d66fce77a55842bd 100644 (file)
@@ -39,7 +39,7 @@ inline bool operator==(ceph_filelock& l, ceph_filelock& r) {
 class ceph_lock_state_t {
   CephContext *cct;
 public:
-  ceph_lock_state_t(CephContext *cct_) : cct(cct_) {}
+  explicit ceph_lock_state_t(CephContext *cct_) : cct(cct_) {}
   multimap<uint64_t, ceph_filelock> held_locks;    // current locks
   multimap<uint64_t, ceph_filelock> waiting_locks; // locks waiting for other locks
   // both of the above are keyed by starting offset
index 669e8b9a702d170ad17d432fdede40325b9fcdf5..4e1b926d555836d99930e3fb3fc4384cab1dadb7 100644 (file)
@@ -980,7 +980,7 @@ class inode_load_vec_t {
   static const int NUM = 2;
   std::vector < DecayCounter > vec;
 public:
-  inode_load_vec_t(const utime_t &now)
+  explicit inode_load_vec_t(const utime_t &now)
      : vec(NUM, DecayCounter(now))
   {}
   // for dencoder infrastructure
@@ -1011,7 +1011,7 @@ class dirfrag_load_vec_t {
 public:
   static const int NUM = 5;
   std::vector < DecayCounter > vec;
-  dirfrag_load_vec_t(const utime_t &now)
+  explicit dirfrag_load_vec_t(const utime_t &now)
      : vec(NUM, DecayCounter(now))
   { }
   // for dencoder infrastructure
@@ -1115,7 +1115,7 @@ struct mds_load_t {
 
   double cpu_load_avg;
 
-  mds_load_t(const utime_t &t) : 
+  explicit mds_load_t(const utime_t &t) : 
     auth(t), all(t), req_rate(0), cache_hit_rate(0),
     queue_len(0), cpu_load_avg(0)
   {}
@@ -1227,7 +1227,7 @@ struct ClientLease {
 // print hack
 struct mdsco_db_line_prefix {
   MDSCacheObject *object;
-  mdsco_db_line_prefix(MDSCacheObject *o) : object(o) {}
+  explicit mdsco_db_line_prefix(MDSCacheObject *o) : object(o) {}
 };
 std::ostream& operator<<(std::ostream& out, mdsco_db_line_prefix o);
 
index 3e950fa6f63904b092658b618592623486e88337..808a7572d9caf54ff842bb14be842221d0e51499 100644 (file)
@@ -24,7 +24,7 @@ public:
   bufferlist monmapbl;
 
   MMonMap() : Message(CEPH_MSG_MON_MAP) { }
-  MMonMap(bufferlist &bl) : Message(CEPH_MSG_MON_MAP) { 
+  explicit MMonMap(bufferlist &bl) : Message(CEPH_MSG_MON_MAP) { 
     monmapbl.claim(bl);
   }
 private:
index ab84d0bf878a69fcf01dbd846861c1353bf3f8f2..03a9d17d9b27081b4538bceaf1f29a20db2a06d6 100644 (file)
@@ -169,7 +169,7 @@ class Elector {
   class C_ElectionExpire : public Context {
     Elector *elector;
   public:
-    C_ElectionExpire(Elector *e) : elector(e) { }
+    explicit C_ElectionExpire(Elector *e) : elector(e) { }
     void finish(int r) {
       elector->expire();
     }
@@ -348,7 +348,7 @@ class Elector {
    *
    * @param m A Monitor instance
    */
-  Elector(Monitor *m) : mon(m),
+  explicit Elector(Monitor *m) : mon(m),
                        expire_event(0),
                        epoch(0),
                        participating(true),
index 7dba641e703cb22748abd95d73513d0d1e99694a..400a4bbbe3ecd623d0fef32d93b3f6e9350eb42b 100644 (file)
@@ -118,7 +118,7 @@ struct MonCap {
   std::vector<MonCapGrant> grants;
 
   MonCap() {}
-  MonCap(std::vector<MonCapGrant> g) : grants(g) {}
+  explicit MonCap(std::vector<MonCapGrant> g) : grants(g) {}
 
   string get_str() const {
     return text;
index c3efd78f866601b98e052f2c8a9eea7fc5a0e418..d98a15b61aaba7fbe8ea6624a9df6b3cebedae72 100644 (file)
@@ -155,7 +155,7 @@ private:
 
   struct C_Tick : public Context {
     MonClient *monc;
-    C_Tick(MonClient *m) : monc(m) {}
+    explicit C_Tick(MonClient *m) : monc(m) {}
     void finish(int r) {
       monc->tick();
     }
@@ -300,7 +300,7 @@ public:
   RotatingKeyRing *rotating_secrets;
 
  public:
-  MonClient(CephContext *cct_);
+  explicit MonClient(CephContext *cct_);
   ~MonClient();
 
   int init();
@@ -406,7 +406,7 @@ private:
     int *prval;
     Context *onfinish, *ontimeout;
 
-    MonCommand(uint64_t t)
+    explicit MonCommand(uint64_t t)
       : target_rank(-1),
        tid(t),
        poutbl(NULL), prs(NULL), prval(NULL), onfinish(NULL), ontimeout(NULL)
index 1cacc5d7f1fad53f4242181b1c500cf2f4eec89d..267fd6e5783cf92281bedfe31984807dadb709ef 100644 (file)
@@ -266,7 +266,7 @@ Monitor::~Monitor()
 class AdminHook : public AdminSocketHook {
   Monitor *mon;
 public:
-  AdminHook(Monitor *m) : mon(m) {}
+  explicit AdminHook(Monitor *m) : mon(m) {}
   bool call(std::string command, cmdmap_t& cmdmap, std::string format,
            bufferlist& out) {
     stringstream ss;
@@ -3091,7 +3091,7 @@ void Monitor::forward_request_leader(MonOpRequestRef op)
 
 // fake connection attached to forwarded messages
 struct AnonConnection : public Connection {
-  AnonConnection(CephContext *cct) : Connection(cct, NULL) {}
+  explicit AnonConnection(CephContext *cct) : Connection(cct, NULL) {}
 
   int send_message(Message *m) override {
     assert(!"send_message on anonymous connection");
@@ -4692,7 +4692,7 @@ void Monitor::scrub_reset_timeout()
 class C_Mon_Tick : public Context {
   Monitor *mon;
 public:
-  C_Mon_Tick(Monitor *m) : mon(m) {}
+  explicit C_Mon_Tick(Monitor *m) : mon(m) {}
   void finish(int r) {
     mon->tick();
   }
index 9c2ced0d5ea10a186715dad877c639fbbe240b95..d506ebad36433808e6cbc561ca348dbdd07bd2a1 100644 (file)
@@ -260,14 +260,14 @@ private:
 
   struct C_Scrub : public Context {
     Monitor *mon;
-    C_Scrub(Monitor *m) : mon(m) { }
+    explicit C_Scrub(Monitor *m) : mon(m) { }
     void finish(int r) {
       mon->scrub_start();
     }
   };
   struct C_ScrubTimeout : public Context {
     Monitor *mon;
-    C_ScrubTimeout(Monitor *m) : mon(m) { }
+    explicit C_ScrubTimeout(Monitor *m) : mon(m) { }
     void finish(int r) {
       mon->scrub_timeout();
     }
@@ -351,7 +351,7 @@ private:
 
   struct C_SyncTimeout : public Context {
     Monitor *mon;
-    C_SyncTimeout(Monitor *m) : mon(m) {}
+    explicit C_SyncTimeout(Monitor *m) : mon(m) {}
     void finish(int r) {
       mon->sync_timeout();
     }
@@ -509,7 +509,7 @@ private:
 
   struct C_TimeCheck : public Context {
     Monitor *mon;
-    C_TimeCheck(Monitor *m) : mon(m) { }
+    explicit C_TimeCheck(Monitor *m) : mon(m) { }
     void finish(int r) {
       mon->timecheck_start_round();
     }
@@ -565,7 +565,7 @@ private:
 
   struct C_ProbeTimeout : public Context {
     Monitor *mon;
-    C_ProbeTimeout(Monitor *m) : mon(m) {}
+    explicit C_ProbeTimeout(Monitor *m) : mon(m) {}
     void finish(int r) {
       mon->probe_timeout(r);
     }
@@ -714,7 +714,7 @@ public:
 
   struct C_HealthToClogTick : public Context {
     Monitor *mon;
-    C_HealthToClogTick(Monitor *m) : mon(m) { }
+    explicit C_HealthToClogTick(Monitor *m) : mon(m) { }
     void finish(int r) {
       if (r < 0)
         return;
@@ -725,7 +725,7 @@ public:
 
   struct C_HealthToClogInterval : public Context {
     Monitor *mon;
-    C_HealthToClogInterval(Monitor *m) : mon(m) { }
+    explicit C_HealthToClogInterval(Monitor *m) : mon(m) { }
     void finish(int r) {
       if (r < 0)
         return;
index 082e1712dde9f563c690d6c7381397dce01a2c03..cbb0b33ed9b79fb0686b75712f7f856e08b6cbbf 100644 (file)
@@ -621,7 +621,7 @@ class MonitorDBStore
     return db->get_estimated_size(extras);
   }
 
-  MonitorDBStore(const string& path)
+  explicit MonitorDBStore(const string& path)
     : db(0),
       do_dump(false),
       dump_fd_binary(-1),
index df6e38840d88f2f63e023ff5a62d9a3582ca01ca..42c58a0111adcdeac39f947f4e3b57dbb5645a10 100644 (file)
@@ -781,7 +781,7 @@ public:
 protected:
   struct lowprecision_t {
     float v;
-    lowprecision_t(float _v) : v(_v) {}
+    explicit lowprecision_t(float _v) : v(_v) {}
   };
   friend std::ostream &operator<<(ostream& out, const lowprecision_t& v);
 
index 36d6ae7b8102705d7ce1295617ada89ee8c93412..3e50daeef8d80c10910deac0f1943f785546ab7a 100644 (file)
@@ -55,7 +55,7 @@ struct failure_reporter_t {
   MonOpRequestRef op;       ///< failure op request
 
   failure_reporter_t() {}
-  failure_reporter_t(utime_t s) : failed_since(s) {}
+  explicit failure_reporter_t(utime_t s) : failed_since(s) {}
   ~failure_reporter_t() { }
 };
 
index dfab30af7d8aa2d5a29d51565e041531686de0f5..52b0bda43c36b6a5f55519a9c4ebe6f2a403daec 100644 (file)
@@ -809,7 +809,7 @@ void Paxos::accept_timeout()
 
 struct C_Committed : public Context {
   Paxos *paxos;
-  C_Committed(Paxos *p) : paxos(p) {}
+  explicit C_Committed(Paxos *p) : paxos(p) {}
   void finish(int r) {
     assert(r >= 0);
     Mutex::Locker l(paxos->mon->lock);
index 4f570275d5dc0d015010b2941f69e8c2e37f19b3..052cd76aea0de2ac35d09f0587ba83e40b2cf221 100644 (file)
@@ -629,7 +629,7 @@ private:
   class C_CollectTimeout : public Context {
     Paxos *paxos;
   public:
-    C_CollectTimeout(Paxos *p) : paxos(p) {}
+    explicit C_CollectTimeout(Paxos *p) : paxos(p) {}
     void finish(int r) {
       if (r == -ECANCELED)
        return;
@@ -643,7 +643,7 @@ private:
   class C_AcceptTimeout : public Context {
     Paxos *paxos;
   public:
-    C_AcceptTimeout(Paxos *p) : paxos(p) {}
+    explicit C_AcceptTimeout(Paxos *p) : paxos(p) {}
     void finish(int r) {
       if (r == -ECANCELED)
        return;
@@ -657,7 +657,7 @@ private:
   class C_LeaseAckTimeout : public Context {
     Paxos *paxos;
   public:
-    C_LeaseAckTimeout(Paxos *p) : paxos(p) {}
+    explicit C_LeaseAckTimeout(Paxos *p) : paxos(p) {}
     void finish(int r) {
       if (r == -ECANCELED)
        return;
@@ -671,7 +671,7 @@ private:
   class C_LeaseTimeout : public Context {
     Paxos *paxos;
   public:
-    C_LeaseTimeout(Paxos *p) : paxos(p) {}
+    explicit C_LeaseTimeout(Paxos *p) : paxos(p) {}
     void finish(int r) {
       if (r == -ECANCELED)
        return;
@@ -685,7 +685,7 @@ private:
   class C_LeaseRenew : public Context {
     Paxos *paxos;
   public:
-    C_LeaseRenew(Paxos *p) : paxos(p) {}
+    explicit C_LeaseRenew(Paxos *p) : paxos(p) {}
     void finish(int r) {
       if (r == -ECANCELED)
        return;
@@ -696,7 +696,7 @@ private:
   class C_Trimmed : public Context {
     Paxos *paxos;
   public:
-    C_Trimmed(Paxos *p) : paxos(p) { }
+    explicit C_Trimmed(Paxos *p) : paxos(p) { }
     void finish(int r) {
       paxos->trimming = false;
     }
index 5ede654704356961989bdde5ee5308abf5910459..77c62253dbf2a6d410d0a63ef0d434ffd0b58944 100644 (file)
@@ -128,7 +128,7 @@ protected:
   class C_Active : public Context {
     PaxosService *svc;
   public:
-    C_Active(PaxosService *s) : svc(s) {}
+    explicit C_Active(PaxosService *s) : svc(s) {}
     void finish(int r) {
       if (r >= 0)
        svc->_active();
@@ -142,7 +142,7 @@ protected:
   class C_Propose : public Context {
     PaxosService *ps;
   public:
-    C_Propose(PaxosService *p) : ps(p) { }
+    explicit C_Propose(PaxosService *p) : ps(p) { }
     void finish(int r) {
       ps->proposal_timer = 0;
       if (r >= 0)
@@ -167,7 +167,7 @@ protected:
   class C_Committed : public Context {
     PaxosService *ps;
   public:
-    C_Committed(PaxosService *p) : ps(p) { }
+    explicit C_Committed(PaxosService *p) : ps(p) { }
     void finish(int r) {
       ps->proposing = false;
       if (r >= 0)
index a720075dae789b74394dd2f83b3f542c667e58d1..08dd11f58b2cf5c3347702847671156fbf4eeb1d 100644 (file)
@@ -212,7 +212,7 @@ struct C_MonOp : public Context
 {
   MonOpRequestRef op;
 
-  C_MonOp(MonOpRequestRef o) :
+  explicit C_MonOp(MonOpRequestRef o) :
     op(o) { }
 
   void finish(int r) {
index d6868edc18d9b8636bde988683e68737cc3765b4..80e4db4dd2c40e489754aa24ebeb9bf6fd8f022a 100644 (file)
@@ -28,7 +28,7 @@ class CephContext;
 
 class Dispatcher {
 public:
-  Dispatcher(CephContext *cct_)
+  explicit Dispatcher(CephContext *cct_)
     : cct(cct_)
   {
   }
index 9eddce1bfa742a10130685788475cdf6e5e95740..a79dbaa23bb31af6d4d7ced5e896594369a997d3 100644 (file)
@@ -231,7 +231,7 @@ public:
     Message *m;
     friend class Message;
   public:
-    CompletionHook(Message *_m) : m(_m) {}
+    explicit CompletionHook(Message *_m) : m(_m) {}
     virtual void set_message(Message *_m) { m = _m; }
   };
 
index 9c1b250fbcba53fd1c2d787e601710c0cbe47f02..89caaa23a7e978f690abfef00bfa804afa2ccf7e 100644 (file)
@@ -50,7 +50,7 @@ class C_time_wakeup : public EventCallback {
   AsyncConnectionRef conn;
 
  public:
-  C_time_wakeup(AsyncConnectionRef c): conn(c) {}
+  explicit C_time_wakeup(AsyncConnectionRef c): conn(c) {}
   void do_request(int fd_or_id) {
     conn->wakeup_from(fd_or_id);
   }
@@ -60,7 +60,7 @@ class C_handle_read : public EventCallback {
   AsyncConnectionRef conn;
 
  public:
-  C_handle_read(AsyncConnectionRef c): conn(c) {}
+  explicit C_handle_read(AsyncConnectionRef c): conn(c) {}
   void do_request(int fd_or_id) {
     conn->process();
   }
@@ -70,7 +70,7 @@ class C_handle_write : public EventCallback {
   AsyncConnectionRef conn;
 
  public:
-  C_handle_write(AsyncConnectionRef c): conn(c) {}
+  explicit C_handle_write(AsyncConnectionRef c): conn(c) {}
   void do_request(int fd) {
     conn->handle_write();
   }
@@ -136,7 +136,7 @@ class C_deliver_accept : public EventCallback {
 class C_local_deliver : public EventCallback {
   AsyncConnectionRef conn;
  public:
-  C_local_deliver(AsyncConnectionRef c): conn(c) {}
+  explicit C_local_deliver(AsyncConnectionRef c): conn(c) {}
   void do_request(int id) {
     conn->local_deliver();
   }
@@ -146,7 +146,7 @@ class C_local_deliver : public EventCallback {
 class C_clean_handler : public EventCallback {
   AsyncConnectionRef conn;
  public:
-  C_clean_handler(AsyncConnectionRef c): conn(c) {}
+  explicit C_clean_handler(AsyncConnectionRef c): conn(c) {}
   void do_request(int id) {
     conn->cleanup_handler();
     delete this;
index 5206a81f77678e7a148721e76075d24719a38f80..f1a07fd8d41ecc6f3ad914143a66bbc738077e15 100644 (file)
@@ -109,7 +109,7 @@ class Processor {
     Processor *pro;
 
    public:
-    C_processor_accept(Processor *p): pro(p) {}
+    explicit C_processor_accept(Processor *p): pro(p) {}
     void do_request(int id) {
       pro->accept();
     }
@@ -143,7 +143,7 @@ class WorkerPool {
   class C_barrier : public EventCallback {
     WorkerPool *pool;
    public:
-    C_barrier(WorkerPool *p): pool(p) {}
+    explicit C_barrier(WorkerPool *p): pool(p) {}
     void do_request(int id) {
       Mutex::Locker l(pool->barrier_lock);
       pool->barrier_count.dec();
@@ -153,7 +153,7 @@ class WorkerPool {
   };
   friend class C_barrier;
  public:
-  WorkerPool(CephContext *c);
+  explicit WorkerPool(CephContext *c);
   virtual ~WorkerPool();
   void start();
   Worker *get_worker() {
@@ -332,7 +332,7 @@ private:
     AsyncMessenger *msgr;
 
    public:
-    C_handle_reap(AsyncMessenger *m): msgr(m) {}
+    explicit C_handle_reap(AsyncMessenger *m): msgr(m) {}
     void do_request(int id) {
       // judge whether is a time event
       msgr->reap_dead();
index 2575130305b03d74492e5d751e929644278f0e9c..fd6f2098472a0c801380be0fed444c1885525d34 100644 (file)
@@ -127,7 +127,7 @@ class EventCenter {
  public:
   atomic_t already_wakeup;
 
-  EventCenter(CephContext *c):
+  explicit EventCenter(CephContext *c):
     cct(c), nevent(0),
     external_lock("AsyncMessenger::external_lock"),
     file_lock("AsyncMessenger::file_lock"),
index 7f01488feaf2fcc55da773c399429ae9f9097360..c9e5d5cd9b54b42c86683adbdc36e5c0971bfbf8 100644 (file)
@@ -29,7 +29,7 @@ class EpollDriver : public EventDriver {
   int size;
 
  public:
-  EpollDriver(CephContext *c): epfd(-1), events(NULL), cct(c), size(0) {}
+  explicit EpollDriver(CephContext *c): epfd(-1), events(NULL), cct(c), size(0) {}
   virtual ~EpollDriver() {
     if (epfd != -1)
       close(epfd);
index c7f99a73de6da3d9849c572e370d62bafcf2621f..8fb53dd698492a1a9683e8e2d44480c2dbf47f55 100644 (file)
@@ -30,7 +30,7 @@ class KqueueDriver : public EventDriver {
   int size;
 
  public:
-  KqueueDriver(CephContext *c): kqfd(-1), events(NULL), cct(c), size(0) {}
+  explicit KqueueDriver(CephContext *c): kqfd(-1), events(NULL), cct(c), size(0) {}
   virtual ~KqueueDriver() {
     if (kqfd != -1)
       close(kqfd);
index 96ec3229ed9600fbf442cc251475a23fd504919e..7cf42ffbe3dd7d25022d0cc5e7cc28a9b8dc3f31 100644 (file)
@@ -31,7 +31,7 @@ class SelectDriver : public EventDriver {
   CephContext *cct;
 
  public:
-  SelectDriver(CephContext *c): max_fd(0), cct(c) {}
+  explicit SelectDriver(CephContext *c): max_fd(0), cct(c) {}
   virtual ~SelectDriver() {}
 
   int init(int nevent);
index 64423dc5bf369a663d88ebc158463089ab1ad28e..980e009f7b8624e4064dcd32d5fef49e275e0314 100644 (file)
@@ -26,7 +26,7 @@ namespace ceph {
 
     CephContext *cct;
    public:
-    NetHandler(CephContext *c): cct(c) {}
+    explicit NetHandler(CephContext *c): cct(c) {}
     int set_nonblock(int sd);
     void set_socket_options(int sd);
     int connect(const entity_addr_t &addr);
index 8f98b88eb926f623dd56a658b0e8de85c6f361e9..55a865b7454ba473b18adde76b953f679454881d 100644 (file)
@@ -43,7 +43,7 @@ public:
   // cons
   entity_name_t() : _type(0), _num(0) { }
   entity_name_t(int t, int64_t n) : _type(t), _num(n) { }
-  entity_name_t(const ceph_entity_name &n) : 
+  explicit entity_name_t(const ceph_entity_name &n) : 
     _type(n.type), _num(n.num) { }
 
   // static cons
@@ -222,7 +222,7 @@ struct entity_addr_t {
   entity_addr_t() : type(0), nonce(0) { 
     memset(&addr, 0, sizeof(addr));
   }
-  entity_addr_t(const ceph_entity_addr &o) {
+  explicit entity_addr_t(const ceph_entity_addr &o) {
     type = o.type;
     nonce = o.nonce;
     addr = o.in_addr;
index d379f55881cf7b9ecb61b5c855166eb5fc955077..dca304a83c18a72c3ccc1eaee41245582a1f81c4 100644 (file)
@@ -44,7 +44,7 @@ class DispatchQueue {
     ConnectionRef con;
     MessageRef m;
   public:
-    QueueItem(Message *m) : type(-1), con(0), m(m) {}
+    explicit QueueItem(Message *m) : type(-1), con(0), m(m) {}
     QueueItem(int type, Connection *con) : type(type), con(con), m(0) {}
     bool is_code() const {
       return type != -1;
@@ -98,7 +98,7 @@ class DispatchQueue {
   class DispatchThread : public Thread {
     DispatchQueue *dq;
   public:
-    DispatchThread(DispatchQueue *dq) : dq(dq) {}
+    explicit DispatchThread(DispatchQueue *dq) : dq(dq) {}
     void *entry() {
       dq->entry();
       return 0;
@@ -112,7 +112,7 @@ class DispatchQueue {
   class LocalDeliveryThread : public Thread {
     DispatchQueue *dq;
   public:
-    LocalDeliveryThread(DispatchQueue *dq) : dq(dq) {}
+    explicit LocalDeliveryThread(DispatchQueue *dq) : dq(dq) {}
     void *entry() {
       dq->run_local_delivery();
       return 0;
index bbe8aa22b669dc551f4bf137bfe54720181861f9..664f733f4688f2db934ff9e8442da1789e7f0bf4 100644 (file)
@@ -46,7 +46,7 @@ class DispatchQueue;
     class Reader : public Thread {
       Pipe *pipe;
     public:
-      Reader(Pipe *p) : pipe(p) {}
+      explicit Reader(Pipe *p) : pipe(p) {}
       void *entry() { pipe->reader(); return 0; }
     } reader_thread;
 
@@ -57,7 +57,7 @@ class DispatchQueue;
     class Writer : public Thread {
       Pipe *pipe;
     public:
-      Writer(Pipe *p) : pipe(p) {}
+      explicit Writer(Pipe *p) : pipe(p) {}
       void *entry() { pipe->writer(); return 0; }
     } writer_thread;
 
@@ -81,7 +81,7 @@ class DispatchQueue;
       bool stop_fast_dispatching_flag; // we need to stop fast dispatching
 
     public:
-      DelayedDelivery(Pipe *p)
+      explicit DelayedDelivery(Pipe *p)
        : pipe(p),
          delay_lock("Pipe::DelayedDelivery::delay_lock"), flush_count(0),
          active_flush(false),
index c05ccc6712b0ced68863bbd5f8326127ee03a52a..5eb441e86ef6da785619c6f621d65a9448de848a 100644 (file)
@@ -191,7 +191,7 @@ private:
   class ReaperThread : public Thread {
     SimpleMessenger *msgr;
   public:
-    ReaperThread(SimpleMessenger *m) : msgr(m) {}
+    explicit ReaperThread(SimpleMessenger *m) : msgr(m) {}
     void *entry() {
       msgr->reaper_entry();
       return 0;
index b5f9e8aedd46c0d9528722b9e9628a21b4b1ccc4..7b23d8ff25ff31cccca27ab0ffd52791a58a26b7 100644 (file)
@@ -34,7 +34,7 @@ class QueueStrategy : public DispatchStrategy {
     bi::list_member_hook<> thread_q;
     QueueStrategy *dq;
     Cond cond;
-    QSThread(QueueStrategy *dq) : thread_q(), dq(dq), cond() {}
+    explicit QSThread(QueueStrategy *dq) : thread_q(), dq(dq), cond() {}
     void* entry() {
       dq->entry(this);
       delete(this);
@@ -50,7 +50,7 @@ class QueueStrategy : public DispatchStrategy {
   QSThread::Queue disp_threads;
 
 public:
-  QueueStrategy(int n_threads);
+  explicit QueueStrategy(int n_threads);
   virtual void ds_dispatch(Message *m);
   virtual void shutdown();
   virtual void start();
index da34d6e5520f72c3f0ecf4b93403fbec445a8d5a..a38728ae28a8112062b0396b8a2fae0c26b90a04 100644 (file)
@@ -142,7 +142,7 @@ private:
 
     uint32_t flags;
 
-    CState(XioConnection* _xcon)
+    explicit CState(XioConnection* _xcon)
       : xcon(_xcon),
        protocol_version(0),
        session_state(INIT),
@@ -322,7 +322,7 @@ class XioLoopbackConnection : public Connection
 private:
   atomic_t seq;
 public:
-  XioLoopbackConnection(Messenger *m) : Connection(m->cct, m), seq(0)
+  explicit XioLoopbackConnection(Messenger *m) : Connection(m->cct, m), seq(0)
     {
       const entity_inst_t& m_inst = m->get_myinst();
       peer_addr = m_inst.addr;
index 68d8ebe05afdd1bf40d706b22f75d064168feed6..0cba48a0d73ba3d9a0241a02648674839399d542 100644 (file)
@@ -34,7 +34,7 @@ public:
   __le32 msg_cnt;
   buffer::list bl;
 public:
-  XioMsgCnt(buffer::ptr p)
+  explicit XioMsgCnt(buffer::ptr p)
     {
       bl.append(p);
       buffer::list::iterator bl_iter = bl.begin();
@@ -145,7 +145,7 @@ struct xio_msg_ex
   struct xio_msg msg;
   struct xio_iovec_ex iovs[XIO_MSGR_IOVLEN];
 
-  xio_msg_ex(void* user_context) {
+  explicit xio_msg_ex(void* user_context) {
     // go in structure order
     msg.in.header.iov_len = 0;
     msg.in.header.iov_base = NULL;  /* XXX Accelio requires this currently */
index c8e7b87a76b36cc666dbcf076f9fae781f86ecaa..f7c950fb434da132b1cb4d0bcd843a21e1939e34 100644 (file)
@@ -48,7 +48,7 @@ public:
     char payload[MB];
   } *first;
 
-  XioPool(struct xio_mempool *_handle) :
+  explicit XioPool(struct xio_mempool *_handle) :
     handle(_handle), first(0)
     {
     }
index cb711c66d24cef6557ac8d5c1596fecd402b1681..ab5d132d407311945a09043a2eb5967de85b0591 100644 (file)
@@ -129,7 +129,7 @@ private:
   friend class XioMessenger;
 
 public:
-  XioPortal(Messenger *_msgr) :
+  explicit XioPortal(Messenger *_msgr) :
   msgr(_msgr), ctx(NULL), server(NULL), submit_q(), xio_uri(""),
   portal_id(NULL), _shutdown(false), drained(false),
   magic(0),
index 192b88bc9d5d092ea7491e1586a33ca8becbbfcf..751c52aa020a1f0206104912cbb725d6adfb5f03 100644 (file)
@@ -16,7 +16,7 @@ public:
   class FuseThread : public Thread {
     FuseStore *fs;
   public:
-    FuseThread(FuseStore *f) : fs(f) {}
+    explicit FuseThread(FuseStore *f) : fs(f) {}
     void *entry() {
       fs->loop();
       return NULL;
index cc8b78374ba872e525885e68cfaaa0e88d9daaed..3e32fd63dd77fb545f64c0df51fbee1f282e9e9b 100644 (file)
@@ -181,7 +181,7 @@ public:
     string name;
     Sequencer_implRef p;
 
-    Sequencer(string n)
+    explicit Sequencer(string n)
       : name(n), p(NULL) {}
     ~Sequencer() {
     }
@@ -214,7 +214,7 @@ public:
 
   struct CompatCollectionHandle : public CollectionImpl {
     coll_t cid;
-    CompatCollectionHandle(coll_t c) : cid(c) {}
+    explicit CompatCollectionHandle(coll_t c) : cid(c) {}
     const coll_t &get_cid() override {
       return cid;
     }
@@ -509,10 +509,10 @@ public:
   public:
     Transaction() = default;
 
-    Transaction(bufferlist::iterator &dp) {
+    explicit Transaction(bufferlist::iterator &dp) {
       decode(dp);
     }
-    Transaction(bufferlist &nbl) {
+    explicit Transaction(bufferlist &nbl) {
       bufferlist::iterator dp = nbl.begin();
       decode(dp);
     }
@@ -896,7 +896,7 @@ public:
       vector<ghobject_t> objects;
 
     private:
-      iterator(Transaction *t)
+      explicit iterator(Transaction *t)
         : t(t),
          data_bl_p(t->data_bl.begin()),
           colls(t->coll_index.size()),
@@ -1853,11 +1853,11 @@ public:
   }
 
  public:
-  ObjectStore(const std::string& path_) : path(path_), logger(NULL) {}
+  explicit ObjectStore(const std::string& path_) : path(path_), logger(NULL) {}
   virtual ~ObjectStore() {}
 
   // no copying
-  ObjectStore(const ObjectStore& o);
+  explicit ObjectStore(const ObjectStore& o);
   const ObjectStore& operator=(const ObjectStore& o);
 
   // versioning
index 77bb8eb49b1a1b2e0f9e1c42efd2eb6633b6c840..f8ecd28f10958819d09615fa00f0a6107ff0f9db 100644 (file)
@@ -22,7 +22,7 @@ struct IOContext {
   atomic_t num_reading;
   atomic_t num_waiting;
 
-  IOContext(void *p)
+  explicit IOContext(void *p)
     : priv(p),
       lock("IOContext::lock")
     {}
@@ -69,7 +69,7 @@ private:
 
   struct AioCompletionThread : public Thread {
     BlockDevice *bdev;
-    AioCompletionThread(BlockDevice *b) : bdev(b) {}
+    explicit AioCompletionThread(BlockDevice *b) : bdev(b) {}
     void *entry() {
       bdev->_aio_thread();
       return NULL;
index 474a63a97b682e0be6a0aa7c47fe62d53b97a349..4eb9c0d1eab565091c4854a2bc3ddcfd72ea3f15 100644 (file)
@@ -110,7 +110,7 @@ public:
     uint64_t pos;           ///< current logical offset
     uint64_t max_prefetch;  ///< max allowed prefetch
 
-    FileReaderBuffer(uint64_t mpf)
+    explicit FileReaderBuffer(uint64_t mpf)
       : bl_off(0),
        pos(0),
        max_prefetch(mpf) {}
@@ -152,7 +152,7 @@ public:
 
   struct FileLock {
     FileRef file;
-    FileLock(FileRef f) : file(f) {}
+    explicit FileLock(FileRef f) : file(f) {}
   };
 
 private:
index 252bdbd12a40c0dac2c8bfd53d1a3018a8af60a2..847cb19df431ceb03efac075ff3dd6cbdba8d5ce 100644 (file)
@@ -288,7 +288,7 @@ class BlueRocksWritableFile : public rocksdb::WritableFile {
 class BlueRocksDirectory : public rocksdb::Directory {
   BlueFS *fs;
  public:
-  BlueRocksDirectory(BlueFS *f) : fs(f) {}
+  explicit BlueRocksDirectory(BlueFS *f) : fs(f) {}
 
   // Fsync directory. Can be called concurrently from multiple threads.
   rocksdb::Status Fsync() {
index b67a2db815661c736a8d41fc2f208ae5dbaaab3f..a44aa9c1c04689c83d71ac7537694c611a4aacee 100644 (file)
@@ -150,7 +150,7 @@ public:
   rocksdb::Status GetAbsolutePath(const std::string& db_path,
       std::string* output_path);
 
-  BlueRocksEnv(BlueFS *f);
+  explicit BlueRocksEnv(BlueFS *f);
 private:
   BlueFS *fs;
 };
index 28ada142fb0b5e260e872c0d0bcc2f12f43c9d22..582085cbb7db21ff1ecafaf9c68877e6a363c950 100644 (file)
@@ -93,7 +93,7 @@ public:
 
     boost::intrusive::unordered_set<Enode> uset;
 
-    EnodeSet(unsigned n)
+    explicit EnodeSet(unsigned n)
       : num_buckets(n),
        buckets(n),
        uset(bucket_traits(buckets.data(), num_buckets)) {
@@ -286,7 +286,7 @@ public:
 
     CollectionRef first_collection;  ///< first referenced collection
 
-    TransContext(OpSequencer *o)
+    explicit TransContext(OpSequencer *o)
       : state(STATE_PREPARE),
        osr(o),
        ops(0),
@@ -448,7 +448,7 @@ public:
 
   struct KVSyncThread : public Thread {
     BlueStore *store;
-    KVSyncThread(BlueStore *s) : store(s) {}
+    explicit KVSyncThread(BlueStore *s) : store(s) {}
     void *entry() {
       store->_kv_sync_thread();
       return NULL;
index ceb403a08ae9e88718e9c95a9e156daa57c0d046..9fbc00763ac28cd6834c5fc84a11e2d11298fbc4 100644 (file)
@@ -45,7 +45,7 @@ ostream& operator<<(ostream& out, const bluestore_bdev_label_t& l);
 struct bluestore_cnode_t {
   uint32_t bits;   ///< how many bits of coll pgid are significant
 
-  bluestore_cnode_t(int b=0) : bits(b) {}
+  explicit bluestore_cnode_t(int b=0) : bits(b) {}
 
   void encode(bufferlist& bl) const;
   void decode(bufferlist::iterator& p);
index 9bc878f77676e0a30568e1794712e1d56493572f..2933eb1949cac6af18d6b2c57bcd7b309918fdf5 100644 (file)
@@ -29,7 +29,7 @@ private:
   bool m_filestore_btrfs_clone_range;
   bool m_filestore_btrfs_snap;
 public:
-  BtrfsFileStoreBackend(FileStore *fs);
+  explicit BtrfsFileStoreBackend(FileStore *fs);
   ~BtrfsFileStoreBackend() {}
   const char *get_name() {
     return "btrfs";
index a9947cce531d0691cd6df741a798d2f8d59b2b92..7e2fc55ce8f1d4000628dc88087e7b3f106657ec 100644 (file)
@@ -176,7 +176,7 @@ protected:
   /// Call prior to removing directory
   virtual int prep_delete() { return 0; }
 
-  CollectionIndex(coll_t collection):
+  explicit CollectionIndex(coll_t collection):
     access_lock_name ("CollectionIndex::access_lock::" + collection.to_str()),
     access_lock(access_lock_name.c_str()) {}
 
index 1b5748548232604a1208ebae8fa106dd6cba3d15..400c54a1f3866a2cf9cd2c7f6fbfba16bb9b11ae 100644 (file)
@@ -83,7 +83,7 @@ public:
     MapHeaderLock(const MapHeaderLock &);
     MapHeaderLock &operator=(const MapHeaderLock &);
   public:
-    MapHeaderLock(DBObjectMap *db) : db(db) {}
+    explicit MapHeaderLock(DBObjectMap *db) : db(db) {}
     MapHeaderLock(DBObjectMap *db, const ghobject_t &oid) : db(db), locked(oid) {
       Mutex::Locker l(db->header_lock);
       while (db->map_header_in_use.count(*locked))
@@ -115,9 +115,9 @@ public:
     }
   };
 
-  DBObjectMap(KeyValueDB *db) : db(db), header_lock("DBOBjectMap"),
-                                cache_lock("DBObjectMap::CacheLock"),
-                                caches(g_conf->filestore_omap_header_cache_size)
+  explicit DBObjectMap(KeyValueDB *db) : db(db), header_lock("DBOBjectMap"),
+                                        cache_lock("DBObjectMap::CacheLock"),
+                                        caches(g_conf->filestore_omap_header_cache_size)
     {}
 
   int set_keys(
@@ -241,7 +241,7 @@ public:
     __u8 v;
     uint64_t seq;
     State() : v(0), seq(1) {}
-    State(uint64_t seq) : v(0), seq(seq) {}
+    explicit State(uint64_t seq) : v(0), seq(seq) {}
 
     void encode(bufferlist &bl) const {
       ENCODE_START(2, 1, bl);
@@ -516,7 +516,7 @@ private:
   class RemoveOnDelete {
   public:
     DBObjectMap *db;
-    RemoveOnDelete(DBObjectMap *db) :
+    explicit RemoveOnDelete(DBObjectMap *db) :
       db(db) {}
     void operator() (_Header *header) {
       Mutex::Locker l(db->header_lock);
index 635043b7e0613b849cc5e151d0365d3b1681df64..566e65abbe9041d8217de4b4453ae305f228aaf1 100644 (file)
@@ -38,7 +38,7 @@ public:
   class FD {
   public:
     const int fd;
-    FD(int _fd) : fd(_fd) {
+    explicit FD(int _fd) : fd(_fd) {
       assert(_fd >= 0);
     }
     int operator*() const {
@@ -55,7 +55,7 @@ private:
   SharedLRU<ghobject_t, FD, ghobject_t::BitwiseComparator> *registry;
 
 public:
-  FDCache(CephContext *cct) : cct(cct),
+  explicit FDCache(CephContext *cct) : cct(cct),
   registry_shards(cct->_conf->filestore_fd_cache_shards) {
     assert(cct);
     cct->_conf->add_observer(this);
index 07d99f48ae5c8e7b9fda08101c58f3fa95e8cc62..92d8b4b25f7e0b3062c431fd2795db73247b0d59 100644 (file)
@@ -347,7 +347,7 @@ private:
   class Writer : public Thread {
     FileJournal *journal;
   public:
-    Writer(FileJournal *fj) : journal(fj) {}
+    explicit Writer(FileJournal *fj) : journal(fj) {}
     void *entry() {
       journal->write_thread_entry();
       return 0;
@@ -357,7 +357,7 @@ private:
   class WriteFinisher : public Thread {
     FileJournal *journal;
   public:
-    WriteFinisher(FileJournal *fj) : journal(fj) {}
+    explicit WriteFinisher(FileJournal *fj) : journal(fj) {}
     void *entry() {
       journal->write_finish_thread_entry();
       return 0;
index 6c7e0a38fea813264523a0a983e3d80941a5e013..3e63b48ecce41ff23311a6b7d4e19ba307f194a6 100644 (file)
@@ -3586,7 +3586,7 @@ int FileStore::_clone_range(coll_t cid, const ghobject_t& oldoid, const ghobject
 
 class SyncEntryTimeout : public Context {
 public:
-  SyncEntryTimeout(int commit_timeo)
+  explicit SyncEntryTimeout(int commit_timeo)
     : m_commit_timeo(commit_timeo)
   {
   }
index 93082fc3576fcff338f8a56822d001dade4be58b..0ddc87049d2492a332a0f7ac131c567a1edb7324 100644 (file)
@@ -174,7 +174,7 @@ private:
   void sync_entry();
   struct SyncThread : public Thread {
     FileStore *fs;
-    SyncThread(FileStore *f) : fs(f) {}
+    explicit SyncThread(FileStore *f) : fs(f) {}
     void *entry() {
       fs->sync_entry();
       return 0;
@@ -314,7 +314,7 @@ private:
       }
     }
 
-    OpSequencer(int i)
+    explicit OpSequencer(int i)
       : qlock("FileStore::OpSequencer::qlock", false, false),
        parent(0),
        apply_lock("FileStore::OpSequencer::apply_lock", false, false),
@@ -785,7 +785,7 @@ protected:
   }
 
 public:
-  FileStoreBackend(FileStore *fs) : filestore(fs) {}
+  explicit FileStoreBackend(FileStore *fs) : filestore(fs) {}
   virtual ~FileStoreBackend() {}
 
   static FileStoreBackend *create(long f_type, FileStore *fs);
index f31e2029a6526bf89e95c141408efebb3edab557..e2c4ec810daf5e83d53cd1f130aa86986084c0da 100644 (file)
@@ -28,7 +28,7 @@ private:
   bool m_filestore_fsync_flushes_journal_data;
   bool m_filestore_splice;
 public:
-  GenericFileStoreBackend(FileStore *fs);
+  explicit GenericFileStoreBackend(FileStore *fs);
   virtual ~GenericFileStoreBackend() {}
 
   virtual const char *get_name() {
index 2ed21860e62498b17d6d237be01dc55d2b013f56..d4222f912fa9aa59ecae4044529d701ab6a95e5f 100644 (file)
@@ -106,7 +106,7 @@ private:
     InProgressOp(int op, const vector<string> &path)
       : op(op), path(path) {}
 
-    InProgressOp(bufferlist::iterator &bl) {
+    explicit InProgressOp(bufferlist::iterator &bl) {
       decode(bl);
     }
 
index da71807dad1e84e0c7a77fde2fe9f6a80b55cbc1..5317d2bc1fe95f0071ed6d80c0abfa5dca2d49f7 100644 (file)
@@ -31,7 +31,7 @@ struct Index {
   CollectionIndex *index;
 
   Index() : index(NULL) {}
-  Index(CollectionIndex* index) : index(index) {}
+  explicit Index(CollectionIndex* index) : index(index) {}
 
   CollectionIndex *operator->() { return index; }
   CollectionIndex &operator*() { return *index; }
@@ -67,8 +67,8 @@ class IndexManager {
   int build_index(coll_t c, const char *path, CollectionIndex **index);
 public:
   /// Constructor
-  IndexManager(bool upgrade) : lock("IndexManager lock"),
-                              upgrade(upgrade) {}
+  explicit IndexManager(bool upgrade) : lock("IndexManager lock"),
+                                       upgrade(upgrade) {}
 
   ~IndexManager();
 
index e7e50503b39357e6adba5106c2a4c43606c596a0..8b3bdaaba17fd16897575e2c13a85cd2598094ce 100644 (file)
@@ -129,7 +129,7 @@ public:
   }
 
 public:
-  JournalingObjectStore(const std::string& path)
+  explicit JournalingObjectStore(const std::string& path)
     : ObjectStore(path),
       journal(NULL),
       finisher(g_ceph_context, "JournalObjectStore", "fn_jrn_objstore"),
index 7f8e6d00ffe5fcb4c636de1f06f89853efc8217b..4cc09c32cc12e816c3b754dfdd2b49bd8b1ea5e2 100644 (file)
@@ -65,7 +65,7 @@ void LFNIndex::maybe_inject_failure()
 // in combination with RetryException, thrown by the above.
 struct FDCloser {
   int fd;
-  FDCloser(int f) : fd(f) {}
+  explicit FDCloser(int f) : fd(f) {}
   ~FDCloser() {
     VOID_TEMP_FAILURE_RETRY(::close(fd));
   }
index f06ec877b2d45e45edf48f37c8a42bff7e0df939..9a3d0a788bfe708cc78d22e861530de10fa38ebf 100644 (file)
@@ -146,7 +146,7 @@ private:
   }
 
 public:
-  WBThrottle(CephContext *cct);
+  explicit WBThrottle(CephContext *cct);
   ~WBThrottle();
 
   void start();
index 84d4694368d441a039e740012998cf7add190fb8..29f412f934a73374e85ce6d7b459dff6349b428d 100644 (file)
@@ -24,7 +24,7 @@ private:
   bool m_has_extsize;
   int set_extsize(int fd, unsigned int val);
 public:
-  XfsFileStoreBackend(FileStore *fs);
+  explicit XfsFileStoreBackend(FileStore *fs);
   ~XfsFileStoreBackend() {}
   const char *get_name() {
     return "xfs";
index f68b8abd6c1299c5eea8724ecca05063451894cb..1c15bdaacc18a2cb479ef75b746ea185c35b41b5 100644 (file)
@@ -16,7 +16,7 @@ private:
   bool m_filestore_zfs_snap;
   int update_current_zh();
 public:
-  ZFSFileStoreBackend(FileStore *fs);
+  explicit ZFSFileStoreBackend(FileStore *fs);
   ~ZFSFileStoreBackend();
   int detect_features();
   bool can_checkpoint();
index e62d07e1779e5f92323acdeb3d59a0a8ddb0643d..4b09bcecd70ffc0f192dd6940ced437b1e0abb3c 100644 (file)
@@ -89,7 +89,7 @@ public:
     int max_iodepth;
     io_context_t ctx;
 
-    aio_queue_t(unsigned max_iodepth)
+    explicit aio_queue_t(unsigned max_iodepth)
       : max_iodepth(max_iodepth),
        ctx(0) {
     }
index 8bf70f0246abafe57c0d332907b7b16731079ab3..9073835540678c571789131f4d7c4afdc652b93c 100644 (file)
@@ -201,7 +201,7 @@ public:
 
     CollectionRef first_collection;  ///< first referenced collection
 
-    TransContext(OpSequencer *o)
+    explicit TransContext(OpSequencer *o)
       : state(STATE_PREPARE),
        osr(o),
        ops(0),
@@ -272,7 +272,7 @@ public:
 
   struct KVSyncThread : public Thread {
     KStore *store;
-    KVSyncThread(KStore *s) : store(s) {}
+    explicit KVSyncThread(KStore *s) : store(s) {}
     void *entry() {
       store->_kv_sync_thread();
       return NULL;
index 02c75cb3c1e20cf59043e7962b580421c695f9f9..8a880742dd4aa7068470a2a6edf0277b240ca27f 100644 (file)
@@ -28,7 +28,7 @@ namespace ceph {
 struct kstore_cnode_t {
   uint32_t bits;   ///< how many bits of coll pgid are significant
 
-  kstore_cnode_t(int b=0) : bits(b) {}
+  explicit kstore_cnode_t(int b=0) : bits(b) {}
 
   void encode(bufferlist& bl) const;
   void decode(bufferlist::iterator& p);
index 8b56ddc430876ba9f093da74c7ab58a02dfbe19c..5dad53760dcd0a69ea70fa3fa1992c5c0a1d60e4 100644 (file)
@@ -130,7 +130,7 @@ public:
     static thread_local PageSet::page_vector tls_pages;
 #endif
 
-    PageSetObject(size_t page_size) : data(page_size), data_len(0) {}
+    explicit PageSetObject(size_t page_size) : data(page_size), data_len(0) {}
 
     size_t get_size() const override { return data_len; }
 
@@ -243,7 +243,7 @@ public:
       return result;
     }
 
-    Collection(CephContext *cct)
+    explicit Collection(CephContext *cct)
       : cct(cct), use_page_set(cct->_conf->memstore_page_set),
         lock("MemStore::Collection::lock"), exists(true) {}
   };
index b7ef12b3c201be3f4a90b9cfd471ed615734c1c2..b3e1f131a22069d9bc60209b8ba6595211b1f540 100644 (file)
@@ -126,7 +126,7 @@ class PageSet {
   }
 
  public:
-  PageSet(size_t page_size) : page_size(page_size) {}
+  explicit PageSet(size_t page_size) : page_size(page_size) {}
   PageSet(PageSet &&rhs)
     : pages(std::move(rhs.pages)), page_size(rhs.page_size) {}
   ~PageSet() {
index a78c9e624640fa5eb42f293401aafc8f8207e1dc..3fe1f98d1a7ab671022656114641454f05a1aa42 100644 (file)
@@ -107,7 +107,7 @@ private:
   int _load_class(ClassData *cls);
 
 public:
-  ClassHandler(CephContext *cct_) : cct(cct_), mutex("ClassHandler") {}
+  explicit ClassHandler(CephContext *cct_) : cct(cct_), mutex("ClassHandler") {}
   
   int open_all_classes();
 
index 2f7b3b7cdfe4bdc1f571d864e757d9232106ea7c..bee32fd084685d57d533ca51a6e4bc12271760e5 100644 (file)
@@ -137,7 +137,7 @@ public:
   struct ClientAsyncReadStatus {
     bool complete;
     Context *on_complete;
-    ClientAsyncReadStatus(Context *on_complete)
+    explicit ClientAsyncReadStatus(Context *on_complete)
     : complete(false), on_complete(on_complete) {}
   };
   list<ClientAsyncReadStatus> in_progress_client_reads;
@@ -412,7 +412,7 @@ public:
     set<int> want;
     ErasureCodeInterfaceRef ec_impl;
   public:
-    ECRecPred(ErasureCodeInterfaceRef ec_impl) : ec_impl(ec_impl) {
+    explicit ECRecPred(ErasureCodeInterfaceRef ec_impl) : ec_impl(ec_impl) {
       for (unsigned i = 0; i < ec_impl->get_chunk_count(); ++i) {
        want.insert(i);
       }
index c5d39eb5010652b104c5182c3d03483f7c54d38b..64dd89feac2c93bfd58d1d8f3ea6853afaf7e181 100644 (file)
@@ -24,7 +24,7 @@
 
 struct AppendObjectsGenerator: public boost::static_visitor<void> {
   set<hobject_t, hobject_t::BitwiseComparator> *out;
-  AppendObjectsGenerator(set<hobject_t, hobject_t::BitwiseComparator> *out) : out(out) {}
+  explicit AppendObjectsGenerator(set<hobject_t, hobject_t::BitwiseComparator> *out) : out(out) {}
   void operator()(const ECTransaction::AppendOp &op) {
     out->insert(op.oid);
   }
index 2615226885d2094a35c96da5c509ac0cce853608..fd968caa660c0088cf64ea88431dfaae85ce6b35 100644 (file)
@@ -52,11 +52,11 @@ public:
   };
   struct TouchOp {
     hobject_t oid;
-    TouchOp(const hobject_t &oid) : oid(oid) {}
+    explicit TouchOp(const hobject_t &oid) : oid(oid) {}
   };
   struct RemoveOp {
     hobject_t oid;
-    RemoveOp(const hobject_t &oid) : oid(oid) {}
+    explicit RemoveOp(const hobject_t &oid) : oid(oid) {}
   };
   struct SetAttrsOp {
     hobject_t oid;
index 8e1261c5ebabd2266ad0109cc6c512beecfd14d8..968056ddf83d1ce1a87543b87ac121bfdd7011cd 100644 (file)
@@ -109,7 +109,7 @@ class HashInfo {
   vector<uint32_t> cumulative_shard_hashes;
 public:
   HashInfo() : total_chunk_size(0) {}
-  HashInfo(unsigned num_chunks)
+  explicit HashInfo(unsigned num_chunks)
   : total_chunk_size(0),
     cumulative_shard_hashes(num_chunks, -1) {}
   void append(uint64_t old_size, map<int, bufferlist> &to_append);
index 2b981a3eaacf4af96549c087d7a4cfecd2630b30..42292970f9730448e0c597f5f48a86de8ffec6d6 100644 (file)
@@ -92,7 +92,7 @@ public:
     };
 
     Params()  {}
-    Params(Impl *i) : impl(i) {}
+    explicit Params(Impl *i) : impl(i) {}
     virtual ~Params() {}
 
     boost::scoped_ptr<Params::Impl> impl;
@@ -115,8 +115,8 @@ public:
   };
 
   HitSet() : impl(NULL), sealed(false) {}
-  HitSet(Impl *i) : impl(i), sealed(false) {}
-  HitSet(const HitSet::Params& params);
+  explicit HitSet(Impl *i) : impl(i), sealed(false) {}
+  explicit HitSet(const HitSet::Params& params);
 
   HitSet(const HitSet& o) {
     sealed = o.sealed;
@@ -195,7 +195,7 @@ public:
   };
 
   ExplicitHashHitSet() : count(0) {}
-  ExplicitHashHitSet(const ExplicitHashHitSet::Params *p) : count(0) {}
+  explicit ExplicitHashHitSet(const ExplicitHashHitSet::Params *p) : count(0) {}
   ExplicitHashHitSet(const ExplicitHashHitSet &o) : count(o.count),
       hits(o.hits) {}
 
@@ -272,7 +272,7 @@ public:
   };
 
   ExplicitObjectHitSet() : count(0) {}
-  ExplicitObjectHitSet(const ExplicitObjectHitSet::Params *p) : count(0) {}
+  explicit ExplicitObjectHitSet(const ExplicitObjectHitSet::Params *p) : count(0) {}
   ExplicitObjectHitSet(const ExplicitObjectHitSet &o) : count(o.count),
       hits(o.hits) {}
 
@@ -409,7 +409,7 @@ public:
   BloomHitSet(unsigned inserts, double fpp, int seed)
     : bloom(inserts, fpp, seed)
   {}
-  BloomHitSet(const BloomHitSet::Params *p) : bloom(p->target_size,
+  explicit BloomHitSet(const BloomHitSet::Params *p) : bloom(p->target_size,
                                                     p->get_fpp(),
                                                     p->seed)
   {}
index 760fe49ac4d0a2a9618c519019e54caeb187f6c4..7fb5b6fbb1b5c90316343ca166fcd74aa7aaf0b0 100644 (file)
@@ -507,7 +507,7 @@ void OSDService::activate_map()
 class AgentTimeoutCB : public Context {
   PGRef pg;
 public:
-  AgentTimeoutCB(PGRef _pg) : pg(_pg) {}
+  explicit AgentTimeoutCB(PGRef _pg) : pg(_pg) {}
   void finish(int) {
     pg->agent_choose_mode_restart();
   }
@@ -1670,7 +1670,7 @@ int OSD::pre_init()
 class OSDSocketHook : public AdminSocketHook {
   OSD *osd;
 public:
-  OSDSocketHook(OSD *o) : osd(o) {}
+  explicit OSDSocketHook(OSD *o) : osd(o) {}
   bool call(std::string command, cmdmap_t& cmdmap, std::string format,
            bufferlist& out) {
     stringstream ss;
@@ -4500,7 +4500,7 @@ bool OSD::ms_handle_reset(Connection *con)
 struct C_OSD_GetVersion : public Context {
   OSD *osd;
   uint64_t oldest, newest;
-  C_OSD_GetVersion(OSD *o) : osd(o), oldest(0), newest(0) {}
+  explicit C_OSD_GetVersion(OSD *o) : osd(o), oldest(0), newest(0) {}
   void finish(int r) {
     if (r >= 0)
       osd->_got_mon_epochs(oldest, newest);
index 4d274cfb13993873c75fae6e7b7a758352ff36e2..9e149032a4ad7296c416f1e4124af07989e38a4b 100644 (file)
@@ -237,7 +237,7 @@ class DeletingState {
 public:
   const spg_t pgid;
   const PGRef old_pg_state;
-  DeletingState(const pair<spg_t, PGRef> &in) :
+  explicit DeletingState(const pair<spg_t, PGRef> &in) :
     lock("DeletingState::lock"), status(QUEUED), stop_deleting(false),
     pgid(in.first), old_pg_state(in.second) {
     }
@@ -328,7 +328,7 @@ class OSD;
 
 struct PGScrub {
   epoch_t epoch_queued;
-  PGScrub(epoch_t e) : epoch_queued(e) {}
+  explicit PGScrub(epoch_t e) : epoch_queued(e) {}
   ostream &operator<<(ostream &rhs) {
     return rhs << "PGScrub";
   }
@@ -336,7 +336,7 @@ struct PGScrub {
 
 struct PGSnapTrim {
   epoch_t epoch_queued;
-  PGSnapTrim(epoch_t e) : epoch_queued(e) {}
+  explicit PGSnapTrim(epoch_t e) : epoch_queued(e) {}
   ostream &operator<<(ostream &rhs) {
     return rhs << "PGSnapTrim";
   }
@@ -667,7 +667,7 @@ public:
   bool agent_active;
   struct AgentThread : public Thread {
     OSDService *osd;
-    AgentThread(OSDService *o) : osd(o) {}
+    explicit AgentThread(OSDService *o) : osd(o) {}
     void *entry() {
       osd->agent_entry();
       return NULL;
@@ -1032,7 +1032,7 @@ public:
   }
 #endif
 
-  OSDService(OSD *osd);
+  explicit OSDService(OSD *osd);
   ~OSDService();
 };
 
@@ -1092,7 +1092,7 @@ protected:
   class C_Tick : public Context {
     OSD *osd;
   public:
-    C_Tick(OSD *o) : osd(o) {}
+    explicit C_Tick(OSD *o) : osd(o) {}
     void finish(int r) {
       osd->tick();
     }
@@ -1101,7 +1101,7 @@ protected:
   class C_Tick_WithoutOSDLock : public Context {
     OSD *osd;
   public:
-    C_Tick_WithoutOSDLock(OSD *o) : osd(o) {}
+    explicit C_Tick_WithoutOSDLock(OSD *o) : osd(o) {}
     void finish(int r) {
       osd->tick_without_osd_lock();
     }
@@ -1316,7 +1316,7 @@ public:
     Spinlock received_map_lock;
     epoch_t received_map_epoch; // largest epoch seen in MOSDMap from here
 
-    Session(CephContext *cct) :
+    explicit Session(CephContext *cct) :
       RefCountedObject(cct),
       auid(-1), con(0),
       session_dispatch_lock("Session::session_dispatch_lock"), 
@@ -1509,7 +1509,7 @@ private:
   /// state attached to outgoing heartbeat connections
   struct HeartbeatSession : public RefCountedObject {
     int peer;
-    HeartbeatSession(int p) : peer(p) {}
+    explicit HeartbeatSession(int p) : peer(p) {}
   };
   Mutex heartbeat_lock;
   map<int, int> debug_heartbeat_drops_remaining;
@@ -1550,7 +1550,7 @@ private:
 
   struct T_Heartbeat : public Thread {
     OSD *osd;
-    T_Heartbeat(OSD *o) : osd(o) {}
+    explicit T_Heartbeat(OSD *o) : osd(o) {}
     void *entry() {
       osd->heartbeat_entry();
       return 0;
@@ -1562,7 +1562,7 @@ public:
 
   struct HeartbeatDispatcher : public Dispatcher {
     OSD *osd;
-    HeartbeatDispatcher(OSD *o) : Dispatcher(cct), osd(o) {}
+    explicit HeartbeatDispatcher(OSD *o) : Dispatcher(cct), osd(o) {}
     bool ms_dispatch(Message *m) {
       return osd->heartbeat_dispatch(m);
     }
@@ -1687,7 +1687,7 @@ private:
 
     struct Pred {
       PG *pg;
-      Pred(PG *pg) : pg(pg) {}
+      explicit Pred(PG *pg) : pg(pg) {}
       bool operator()(const pair<PGRef, PGQueueable> &op) {
        return op.first == pg;
       }
index 905fa55c548c1fecaa1846cca5c4273750d200b3..55f362692fc09fa519a5a50820c8cf8ac24eb670 100644 (file)
@@ -60,8 +60,8 @@ struct OSDCapSpec {
   std::string class_allow;
 
   OSDCapSpec() : allow(0) {}
-  OSDCapSpec(osd_rwxa_t v) : allow(v) {}
-  OSDCapSpec(std::string n) : allow(0), class_name(n) {}
+  explicit OSDCapSpec(osd_rwxa_t v) : allow(v) {}
+  explicit OSDCapSpec(std::string n) : allow(0), class_name(n) {}
   OSDCapSpec(std::string n, std::string a) : allow(0), class_name(n), class_allow(a) {}
 
   bool allow_all() const {
@@ -119,7 +119,7 @@ struct OSDCap {
   std::vector<OSDCapGrant> grants;
 
   OSDCap() {}
-  OSDCap(std::vector<OSDCapGrant> g) : grants(g) {}
+  explicit OSDCap(std::vector<OSDCapGrant> g) : grants(g) {}
 
   bool allow_all() const;
   void set_allow_all();
index 24c287f4aa81af37edf7784349bde6aeb4f50ba7..55b4ec1367dadb7bbd656bb80e2344daa6287fe1 100644 (file)
@@ -171,17 +171,17 @@ public:
     void dump(Formatter *f) const;
     static void generate_test_instances(list<Incremental*>& o);
 
-    Incremental(epoch_t e=0) :
+    explicit Incremental(epoch_t e=0) :
       encode_features(0),
       epoch(e), new_pool_max(-1), new_flags(-1), new_max_osd(-1),
       have_crc(false), full_crc(0), inc_crc(0) {
       memset(&fsid, 0, sizeof(fsid));
     }
-    Incremental(bufferlist &bl) {
+    explicit Incremental(bufferlist &bl) {
       bufferlist::iterator p = bl.begin();
       decode(p);
     }
-    Incremental(bufferlist::iterator &p) {
+    explicit Incremental(bufferlist::iterator &p) {
       decode(p);
     }
 
index 210f15388ddcd33a8d5d08f678295780f7c055a3..8609467e0902d3581bc84f3d17adbce4cfff5945 100644 (file)
@@ -2069,7 +2069,7 @@ bool PG::queue_scrub()
 
 struct C_PG_FinishRecovery : public Context {
   PGRef pg;
-  C_PG_FinishRecovery(PG *p) : pg(p) {}
+  explicit C_PG_FinishRecovery(PG *p) : pg(p) {}
   void finish(int r) {
     pg->_finish_recovery(this);
   }
index 8265f463cddef581d124812b88371821fcd06dfd..381059899566d9cb897ec318f8364d61e0613cfc 100644 (file)
@@ -320,7 +320,7 @@ public:
   public:
     boost::scoped_ptr<IsPGReadablePredicate> is_readable;
     boost::scoped_ptr<IsPGRecoverablePredicate> is_recoverable;
-    MissingLoc(PG *pg)
+    explicit MissingLoc(PG *pg)
       : pg(pg) {}
     void set_backend_predicates(
       IsPGReadablePredicate *_is_readable,
@@ -658,7 +658,7 @@ public:
     hobject_t begin;
     hobject_t end;
 
-    BackfillInterval(bool bitwise=true)
+    explicit BackfillInterval(bool bitwise=true)
       : objects(hobject_t::Comparator(bitwise)),
        sort_bitwise(bitwise)
     {}
@@ -1333,7 +1333,7 @@ public:
 
   struct QueryState : boost::statechart::event< QueryState > {
     Formatter *f;
-    QueryState(Formatter *f) : f(f) {}
+    explicit QueryState(Formatter *f) : f(f) {}
     void print(std::ostream *out) const {
       *out << "Query";
     }
@@ -1412,7 +1412,7 @@ public:
   };
   struct Activate : boost::statechart::event< Activate > {
     epoch_t activation_epoch;
-    Activate(epoch_t q) : boost::statechart::event< Activate >(),
+    explicit Activate(epoch_t q) : boost::statechart::event< Activate >(),
                          activation_epoch(q) {}
     void print(std::ostream *out) const {
       *out << "Activate from " << activation_epoch;
@@ -1420,7 +1420,7 @@ public:
   };
   struct RequestBackfillPrio : boost::statechart::event< RequestBackfillPrio > {
     unsigned priority;
-    RequestBackfillPrio(unsigned prio) :
+    explicit RequestBackfillPrio(unsigned prio) :
               boost::statechart::event< RequestBackfillPrio >(),
                          priority(prio) {}
     void print(std::ostream *out) const {
@@ -1544,14 +1544,14 @@ public:
     /* States */
 
     struct Crashed : boost::statechart::state< Crashed, RecoveryMachine >, NamedState {
-      Crashed(my_context ctx);
+      explicit Crashed(my_context ctx);
     };
 
     struct Started;
     struct Reset;
 
     struct Initial : boost::statechart::state< Initial, RecoveryMachine >, NamedState {
-      Initial(my_context ctx);
+      explicit Initial(my_context ctx);
       void exit();
 
       typedef boost::mpl::list <
@@ -1571,7 +1571,7 @@ public:
     };
 
     struct Reset : boost::statechart::state< Reset, RecoveryMachine >, NamedState {
-      Reset(my_context ctx);
+      explicit Reset(my_context ctx);
       void exit();
 
       typedef boost::mpl::list <
@@ -1596,7 +1596,7 @@ public:
     struct Start;
 
     struct Started : boost::statechart::state< Started, RecoveryMachine, Start >, NamedState {
-      Started(my_context ctx);
+      explicit Started(my_context ctx);
       void exit();
 
       typedef boost::mpl::list <
@@ -1626,7 +1626,7 @@ public:
     struct Stray;
 
     struct Start : boost::statechart::state< Start, Started >, NamedState {
-      Start(my_context ctx);
+      explicit Start(my_context ctx);
       void exit();
 
       typedef boost::mpl::list <
@@ -1646,7 +1646,7 @@ public:
     };
 
     struct Primary : boost::statechart::state< Primary, Started, Peering >, NamedState {
-      Primary(my_context ctx);
+      explicit Primary(my_context ctx);
       void exit();
 
       typedef boost::mpl::list <
@@ -1667,7 +1667,7 @@ public:
        boost::statechart::custom_reaction< MInfoRec >,
        boost::statechart::custom_reaction< MNotifyRec >
        > reactions;
-      WaitActingChange(my_context ctx);
+      explicit WaitActingChange(my_context ctx);
       boost::statechart::result react(const QueryState& q);
       boost::statechart::result react(const AdvMap&);
       boost::statechart::result react(const MLogRec&);
@@ -1682,7 +1682,7 @@ public:
     struct Peering : boost::statechart::state< Peering, Primary, GetInfo >, NamedState {
       std::unique_ptr< PriorSet > prior_set;
 
-      Peering(my_context ctx);
+      explicit Peering(my_context ctx);
       void exit();
 
       typedef boost::mpl::list <
@@ -1697,7 +1697,7 @@ public:
     struct WaitLocalRecoveryReserved;
     struct Activating;
     struct Active : boost::statechart::state< Active, Primary, Activating >, NamedState {
-      Active(my_context ctx);
+      explicit Active(my_context ctx);
       void exit();
 
       const set<pg_shard_t> remote_shards_to_reserve_recovery;
@@ -1730,7 +1730,7 @@ public:
       typedef boost::mpl::list<
        boost::statechart::transition< DoRecovery, WaitLocalRecoveryReserved >
       > reactions;
-      Clean(my_context ctx);
+      explicit Clean(my_context ctx);
       void exit();
     };
 
@@ -1739,7 +1739,7 @@ public:
        boost::statechart::transition< GoClean, Clean >,
        boost::statechart::custom_reaction< AllReplicasActivated >
       > reactions;
-      Recovered(my_context ctx);
+      explicit Recovered(my_context ctx);
       void exit();
       boost::statechart::result react(const AllReplicasActivated&) {
        post_event(GoClean());
@@ -1752,7 +1752,7 @@ public:
        boost::statechart::transition< Backfilled, Recovered >,
        boost::statechart::custom_reaction< RemoteReservationRejected >
        > reactions;
-      Backfilling(my_context ctx);
+      explicit Backfilling(my_context ctx);
       boost::statechart::result react(const RemoteReservationRejected& evt);
       void exit();
     };
@@ -1764,7 +1764,7 @@ public:
        boost::statechart::transition< AllBackfillsReserved, Backfilling >
        > reactions;
       set<pg_shard_t>::const_iterator backfill_osd_it;
-      WaitRemoteBackfillReserved(my_context ctx);
+      explicit WaitRemoteBackfillReserved(my_context ctx);
       void exit();
       boost::statechart::result react(const RemoteBackfillReserved& evt);
       boost::statechart::result react(const RemoteReservationRejected& evt);
@@ -1774,7 +1774,7 @@ public:
       typedef boost::mpl::list<
        boost::statechart::transition< LocalBackfillReserved, WaitRemoteBackfillReserved >
        > reactions;
-      WaitLocalBackfillReserved(my_context ctx);
+      explicit WaitLocalBackfillReserved(my_context ctx);
       void exit();
     };
 
@@ -1784,7 +1784,7 @@ public:
        boost::statechart::custom_reaction< RemoteBackfillReserved >,
        boost::statechart::custom_reaction< RemoteReservationRejected >
        > reactions;
-      NotBackfilling(my_context ctx);
+      explicit NotBackfilling(my_context ctx);
       void exit();
       boost::statechart::result react(const RemoteBackfillReserved& evt);
       boost::statechart::result react(const RemoteReservationRejected& evt);
@@ -1792,7 +1792,7 @@ public:
 
     struct RepNotRecovering;
     struct ReplicaActive : boost::statechart::state< ReplicaActive, Started, RepNotRecovering >, NamedState {
-      ReplicaActive(my_context ctx);
+      explicit ReplicaActive(my_context ctx);
       void exit();
 
       typedef boost::mpl::list <
@@ -1817,7 +1817,7 @@ public:
        boost::statechart::transition< RemoteReservationRejected, RepNotRecovering >,
        boost::statechart::custom_reaction< BackfillTooFull >
        > reactions;
-      RepRecovering(my_context ctx);
+      explicit RepRecovering(my_context ctx);
       boost::statechart::result react(const BackfillTooFull &evt);
       void exit();
     };
@@ -1827,7 +1827,7 @@ public:
        boost::statechart::custom_reaction< RemoteBackfillReserved >,
        boost::statechart::custom_reaction< RemoteReservationRejected >
        > reactions;
-      RepWaitBackfillReserved(my_context ctx);
+      explicit RepWaitBackfillReserved(my_context ctx);
       void exit();
       boost::statechart::result react(const RemoteBackfillReserved &evt);
       boost::statechart::result react(const RemoteReservationRejected &evt);
@@ -1837,7 +1837,7 @@ public:
       typedef boost::mpl::list<
        boost::statechart::custom_reaction< RemoteRecoveryReserved >
        > reactions;
-      RepWaitRecoveryReserved(my_context ctx);
+      explicit RepWaitRecoveryReserved(my_context ctx);
       void exit();
       boost::statechart::result react(const RemoteRecoveryReserved &evt);
     };
@@ -1848,7 +1848,7 @@ public:
         boost::statechart::transition< RequestRecovery, RepWaitRecoveryReserved >,
        boost::statechart::transition< RecoveryDone, RepNotRecovering >  // for compat with pre-reservation peers
        > reactions;
-      RepNotRecovering(my_context ctx);
+      explicit RepNotRecovering(my_context ctx);
       boost::statechart::result react(const RequestBackfillPrio &evt);
       void exit();
     };
@@ -1858,7 +1858,7 @@ public:
        boost::statechart::custom_reaction< AllReplicasRecovered >,
        boost::statechart::custom_reaction< RequestBackfill >
        > reactions;
-      Recovering(my_context ctx);
+      explicit Recovering(my_context ctx);
       void exit();
       void release_reservations();
       boost::statechart::result react(const AllReplicasRecovered &evt);
@@ -1871,7 +1871,7 @@ public:
        boost::statechart::transition< AllRemotesReserved, Recovering >
        > reactions;
       set<pg_shard_t>::const_iterator remote_recovery_reservation_it;
-      WaitRemoteRecoveryReserved(my_context ctx);
+      explicit WaitRemoteRecoveryReserved(my_context ctx);
       boost::statechart::result react(const RemoteRecoveryReserved &evt);
       void exit();
     };
@@ -1880,7 +1880,7 @@ public:
       typedef boost::mpl::list <
        boost::statechart::transition< LocalRecoveryReserved, WaitRemoteRecoveryReserved >
        > reactions;
-      WaitLocalRecoveryReserved(my_context ctx);
+      explicit WaitLocalRecoveryReserved(my_context ctx);
       void exit();
     };
 
@@ -1890,14 +1890,14 @@ public:
        boost::statechart::transition< DoRecovery, WaitLocalRecoveryReserved >,
        boost::statechart::transition< RequestBackfill, WaitLocalBackfillReserved >
        > reactions;
-      Activating(my_context ctx);
+      explicit Activating(my_context ctx);
       void exit();
     };
 
     struct Stray : boost::statechart::state< Stray, Started >, NamedState {
       map<int, pair<pg_query_t, epoch_t> > pending_queries;
 
-      Stray(my_context ctx);
+      explicit Stray(my_context ctx);
       void exit();
 
       typedef boost::mpl::list <
@@ -1921,7 +1921,7 @@ public:
     struct GetInfo : boost::statechart::state< GetInfo, Peering >, NamedState {
       set<pg_shard_t> peer_info_requested;
 
-      GetInfo(my_context ctx);
+      explicit GetInfo(my_context ctx);
       void exit();
       void get_infos();
 
@@ -1943,7 +1943,7 @@ public:
       pg_shard_t auth_log_shard;
       boost::intrusive_ptr<MOSDPGLog> msg;
 
-      GetLog(my_context ctx);
+      explicit GetLog(my_context ctx);
       void exit();
 
       typedef boost::mpl::list <
@@ -1964,7 +1964,7 @@ public:
     struct GetMissing : boost::statechart::state< GetMissing, Peering >, NamedState {
       set<pg_shard_t> peer_missing_requested;
 
-      GetMissing(my_context ctx);
+      explicit GetMissing(my_context ctx);
       void exit();
 
       typedef boost::mpl::list <
@@ -1977,7 +1977,7 @@ public:
     };
 
     struct WaitUpThru : boost::statechart::state< WaitUpThru, Peering >, NamedState {
-      WaitUpThru(my_context ctx);
+      explicit WaitUpThru(my_context ctx);
       void exit();
 
       typedef boost::mpl::list <
@@ -1995,7 +1995,7 @@ public:
        boost::statechart::custom_reaction< AdvMap >,
        boost::statechart::custom_reaction< MNotifyRec >
        > reactions;
-      Incomplete(my_context ctx);
+      explicit Incomplete(my_context ctx);
       boost::statechart::result react(const AdvMap &advmap);
       boost::statechart::result react(const MNotifyRec& infoevt);
       void exit();
@@ -2019,7 +2019,7 @@ public:
     boost::optional<RecoveryCtx> rctx;
 
   public:
-    RecoveryState(PG *pg)
+    explicit RecoveryState(PG *pg)
       : machine(this, pg), pg(pg), orig_ctx(0) {
       machine.initiate();
     }
index 2be5975e860d330cc6e9ffad1433e3ab01954ca2..4ff5b48d79b8a10a3dd36d7cb4d565789ff6e5ab 100644 (file)
@@ -86,7 +86,7 @@ public:
   class RPCReadPred : public IsPGReadablePredicate {
     pg_shard_t whoami;
   public:
-    RPCReadPred(pg_shard_t whoami) : whoami(whoami) {}
+    explicit RPCReadPred(pg_shard_t whoami) : whoami(whoami) {}
     bool operator()(const set<pg_shard_t> &have) const {
       return have.count(whoami);
     }
index 752ef73b5c1c493e189908e3b0c53ff2d171ce90..464c8a6bf6c524fad3cf22730c65eb88e25d5881 100644 (file)
@@ -132,7 +132,7 @@ public:
   ReplicatedPG::CopyResults *results;
   int retval;
   ReplicatedPG::OpContext *ctx;
-  CopyFromCallback(ReplicatedPG::OpContext *ctx_)
+  explicit CopyFromCallback(ReplicatedPG::OpContext *ctx_)
     : results(NULL),
       retval(0),
       ctx(ctx_) {}
@@ -9364,7 +9364,7 @@ ObjectContextRef ReplicatedPG::mark_object_lost(ObjectStore::Transaction *t,
 struct C_PG_MarkUnfoundLost : public Context {
   ReplicatedPGRef pg;
   list<ObjectContextRef> obcs;
-  C_PG_MarkUnfoundLost(ReplicatedPG *p) : pg(p) {}
+  explicit C_PG_MarkUnfoundLost(ReplicatedPG *p) : pg(p) {}
   void finish(int r) {
     pg->_finish_mark_all_unfound_lost(obcs);
   }
@@ -11729,7 +11729,7 @@ bool ReplicatedPG::agent_maybe_flush(ObjectContextRef& obc)
 
 struct C_AgentEvictStartStop : public Context {
   ReplicatedPGRef pg;
-  C_AgentEvictStartStop(ReplicatedPG *p) : pg(p) {
+  explicit C_AgentEvictStartStop(ReplicatedPG *p) : pg(p) {
     pg->osd->agent_start_evict_op();
   }
   void finish(int r) {
@@ -12120,7 +12120,7 @@ bool ReplicatedPG::_range_available_for_scrub(
 
 struct C_ScrubDigestUpdated : public Context {
   ReplicatedPGRef pg;
-  C_ScrubDigestUpdated(ReplicatedPG *pg) : pg(pg) {}
+  explicit C_ScrubDigestUpdated(ReplicatedPG *pg) : pg(pg) {}
   void finish(int r) {
     pg->_scrub_digest_updated();
   }
index 1e6fcb2002fed2b58470345cd9b876e7406e473b..265967a456afde3edeca72783ce5cf94b099b372 100644 (file)
@@ -509,7 +509,7 @@ public:
       boost::optional<uint64_t> watch_cookie;
       uint64_t notify_id;
       bufferlist reply_bl;
-      NotifyAck(uint64_t notify_id) : notify_id(notify_id) {}
+      explicit NotifyAck(uint64_t notify_id) : notify_id(notify_id) {}
       NotifyAck(uint64_t notify_id, uint64_t cookie, bufferlist& rbl)
        : watch_cookie(cookie), notify_id(notify_id) {
        reply_bl.claim(rbl);
@@ -1298,7 +1298,7 @@ protected:
   };
   struct C_OSD_OndiskWriteUnlockList : public Context {
     list<ObjectContextRef> *pls;
-    C_OSD_OndiskWriteUnlockList(list<ObjectContextRef> *l) : pls(l) {}
+    explicit C_OSD_OndiskWriteUnlockList(list<ObjectContextRef> *l) : pls(l) {}
     void finish(int r) {
       for (list<ObjectContextRef>::iterator p = pls->begin(); p != pls->end(); ++p)
        (*p)->ondisk_write_unlock();
@@ -1327,7 +1327,7 @@ protected:
   };
   struct C_OSD_AppliedRecoveredObjectReplica : public Context {
     ReplicatedPGRef pg;
-    C_OSD_AppliedRecoveredObjectReplica(ReplicatedPG *p) :
+    explicit C_OSD_AppliedRecoveredObjectReplica(ReplicatedPG *p) :
       pg(p) {}
     void finish(int r) {
       pg->_applied_recovered_object_replica();
@@ -1543,7 +1543,7 @@ private:
     set<RepGather *> repops;
     snapid_t snap_to_trim;
     bool need_share_pg_info;
-    SnapTrimmer(ReplicatedPG *pg) : pg(pg), need_share_pg_info(false) {}
+    explicit SnapTrimmer(ReplicatedPG *pg) : pg(pg), need_share_pg_info(false) {}
     ~SnapTrimmer();
     void log_enter(const char *state_name);
     void log_exit(const char *state_name, utime_t duration);
@@ -1556,7 +1556,7 @@ private:
       boost::statechart::transition< Reset, NotTrimming >
       > reactions;
     hobject_t pos;
-    TrimmingObjects(my_context ctx);
+    explicit TrimmingObjects(my_context ctx);
     void exit();
     boost::statechart::result react(const SnapTrim&);
   };
@@ -1566,7 +1566,7 @@ private:
       boost::statechart::custom_reaction< SnapTrim >,
       boost::statechart::transition< Reset, NotTrimming >
       > reactions;
-    WaitingOnReplicas(my_context ctx);
+    explicit WaitingOnReplicas(my_context ctx);
     void exit();
     boost::statechart::result react(const SnapTrim&);
   };
@@ -1576,7 +1576,7 @@ private:
       boost::statechart::custom_reaction< SnapTrim >,
       boost::statechart::transition< Reset, NotTrimming >
       > reactions;
-    NotTrimming(my_context ctx);
+    explicit NotTrimming(my_context ctx);
     void exit();
     boost::statechart::result react(const SnapTrim&);
   };
index ea25b4e2dc4e6207bba23029bb1327471b46bf66..6be5018d9a9ea369ebacce1d0073b89b3953957f 100644 (file)
@@ -53,7 +53,7 @@ int OSDriver::get_next(
 struct Mapping {
   snapid_t snap;
   hobject_t hoid;
-  Mapping(const pair<snapid_t, hobject_t> &in)
+  explicit Mapping(const pair<snapid_t, hobject_t> &in)
     : snap(in.first), hoid(in.second) {}
   Mapping() : snap(0) {}
   void encode(bufferlist &bl) const {
index 3e440b782355490da210ee13a4c8f92dc06b6960..dc665e02d09ca53b5af6889175b75a38c7ee79b8 100644 (file)
@@ -71,7 +71,7 @@ class NotifyTimeoutCB : public CancelableContext {
   NotifyRef notif;
   bool canceled; // protected by notif lock
 public:
-  NotifyTimeoutCB(NotifyRef notif) : notif(notif), canceled(false) {}
+  explicit NotifyTimeoutCB(NotifyRef notif) : notif(notif), canceled(false) {}
   void finish(int) {
     notif->osd->watch_lock.Unlock();
     notif->lock.Lock();
@@ -234,7 +234,7 @@ class HandleWatchTimeout : public CancelableContext {
   WatchRef watch;
 public:
   bool canceled; // protected by watch->pg->lock
-  HandleWatchTimeout(WatchRef watch) : watch(watch), canceled(false) {}
+  explicit HandleWatchTimeout(WatchRef watch) : watch(watch), canceled(false) {}
   void cancel() {
     canceled = true;
   }
@@ -258,7 +258,7 @@ class HandleDelayedWatchTimeout : public CancelableContext {
   WatchRef watch;
 public:
   bool canceled;
-  HandleDelayedWatchTimeout(WatchRef watch) : watch(watch), canceled(false) {}
+  explicit HandleDelayedWatchTimeout(WatchRef watch) : watch(watch), canceled(false) {}
   void cancel() {
     canceled = true;
   }
index 8537f3daa744c84e5276dd7a59f669b5a18a7790..2d874e5fd8261e36193dd63bcbfbb9afdc821c75 100644 (file)
@@ -1021,7 +1021,7 @@ void pool_opts_t::dump(Formatter* f) const
 class pool_opts_encoder_t : public boost::static_visitor<>
 {
 public:
-  pool_opts_encoder_t(bufferlist& bl_) : bl(bl_) {}
+  explicit pool_opts_encoder_t(bufferlist& bl_) : bl(bl_) {}
 
   void operator()(std::string s) const {
     ::encode(static_cast<int32_t>(pool_opts_t::STR), bl);
@@ -3284,7 +3284,7 @@ void ObjectModDesc::visit(Visitor *visitor) const
 
 struct DumpVisitor : public ObjectModDesc::Visitor {
   Formatter *f;
-  DumpVisitor(Formatter *f) : f(f) {}
+  explicit DumpVisitor(Formatter *f) : f(f) {}
   void append(uint64_t old_size) {
     f->open_object_section("op");
     f->dump_string("code", "APPEND");
index 1134ffd542f9b891b9012981499e7c8196c1e245..5b1330608c1b9e01a8218b83f41e240b65b0f93f 100644 (file)
@@ -717,7 +717,7 @@ public:
     epoch(ce.epoch),
     __pad(0) { }
 
-  eversion_t(bufferlist& bl) : __pad(0) { decode(bl); }
+  explicit eversion_t(bufferlist& bl) : __pad(0) { decode(bl); }
 
   static eversion_t max() {
     eversion_t max;
@@ -1939,7 +1939,7 @@ struct pg_hit_set_info_t {
   utime_t begin, end;   ///< time interval
   eversion_t version;   ///< version this HitSet object was written
   bool using_gmt;      ///< use gmt for creating the hit_set archive object name
-  pg_hit_set_info_t(bool using_gmt = true)
+  explicit pg_hit_set_info_t(bool using_gmt = true)
     : using_gmt(using_gmt) {}
 
   void encode(bufferlist &bl) const;
@@ -2716,7 +2716,7 @@ struct pg_missing_t {
   struct item {
     eversion_t need, have;
     item() {}
-    item(eversion_t n) : need(n) {}  // have no old version
+    explicit item(eversion_t n) : need(n) {}  // have no old version
     item(eversion_t n, eversion_t h) : need(n), have(h) {}
 
     void encode(bufferlist& bl) const {
@@ -3108,7 +3108,7 @@ struct SnapSet {
   map<snapid_t, uint64_t> clone_size;
 
   SnapSet() : seq(0), head_exists(false) {}
-  SnapSet(bufferlist& bl) {
+  explicit SnapSet(bufferlist& bl) {
     bufferlist::iterator p = bl.begin();
     decode(p);
   }
@@ -3332,14 +3332,14 @@ struct object_info_t {
       data_digest(-1), omap_digest(-1)
   {}
 
-  object_info_t(const hobject_t& s)
+  explicit object_info_t(const hobject_t& s)
     : soid(s),
       user_version(0), size(0), flags((flag_t)0),
       truncate_seq(0), truncate_size(0),
       data_digest(-1), omap_digest(-1)
   {}
 
-  object_info_t(bufferlist& bl) {
+  explicit object_info_t(bufferlist& bl) {
     decode(bl);
   }
   object_info_t operator=(bufferlist& bl) {
@@ -3366,7 +3366,7 @@ struct SnapSetContext {
   bool registered : 1;
   bool exists : 1;
 
-  SnapSetContext(const hobject_t& o) :
+  explicit SnapSetContext(const hobject_t& o) :
     oid(o), ref(0), registered(false), exists(true) { }
 };
 
index 02f93d35ae4df41c33328a373ac68105a78081db..f2dd275aff083119e60f53181600137fa1021b50 100644 (file)
@@ -103,7 +103,7 @@ class Journaler::C_ReadHead : public Context {
   Journaler *ls;
 public:
   bufferlist bl;
-  C_ReadHead(Journaler *l) : ls(l) {}
+  explicit C_ReadHead(Journaler *l) : ls(l) {}
   void finish(int r) {
     ls->_finish_read_head(r, bl);
   }
@@ -125,7 +125,7 @@ class Journaler::C_ProbeEnd : public Context {
   Journaler *ls;
 public:
   uint64_t end;
-  C_ProbeEnd(Journaler *l) : ls(l), end(-1) {}
+  explicit C_ProbeEnd(Journaler *l) : ls(l), end(-1) {}
   void finish(int r) {
     ls->_finish_probe_end(r, end);
   }
@@ -849,7 +849,8 @@ public:
 class Journaler::C_RetryRead : public Context {
   Journaler *ls;
 public:
-  C_RetryRead(Journaler *l) : ls(l) {}
+  explicit C_RetryRead(Journaler *l) : ls(l) {}
+
   void finish(int r) {
     // Should only be called from waitfor_safe i.e. already inside lock
     assert(ls->lock.is_locked_by_me());
index 791412ee7f19d77055acba568c27579dd5333781..b2ec73d20f522398c1ed81644b04893a33200894 100644 (file)
@@ -130,7 +130,7 @@ class ObjectCacher {
     map<loff_t, list<Context*> > waitfor_read;
 
     // cons
-    BufferHead(Object *o) :
+    explicit BufferHead(Object *o) :
       state(STATE_MISSING),
       ref(0),
       dontneed(false),
@@ -424,7 +424,7 @@ class ObjectCacher {
   class FlusherThread : public Thread {
     ObjectCacher *oc;
   public:
-    FlusherThread(ObjectCacher *o) : oc(o) {}
+    explicit FlusherThread(ObjectCacher *o) : oc(o) {}
     void *entry() {
       oc->flusher_entry();
       return 0;
index 16d8c0af8b5f399515b2d9c492b1e521343949a8..a8bfbdb031a9c3539bc5f0d0490a5acef4a616be 100644 (file)
@@ -1142,7 +1142,7 @@ private:
   class RequestStateHook : public AdminSocketHook {
     Objecter *m_objecter;
   public:
-    RequestStateHook(Objecter *objecter);
+    explicit RequestStateHook(Objecter *objecter);
     bool call(std::string command, cmdmap_t& cmdmap, std::string format,
              bufferlist& out);
   };
index e879384343a944432db7edf91921288e7ede18b5..dc5388f241ede98c8e0316e37e2bd47a4a0a9d10 100644 (file)
@@ -36,7 +36,7 @@ void decode_big_endian_string(std::string &str, bufferlist::iterator &it) {
 
 class EncodeVisitor : public boost::static_visitor<void> {
 public:
-  EncodeVisitor(bufferlist &bl) : m_bl(bl) {
+  explicit EncodeVisitor(bufferlist &bl) : m_bl(bl) {
   }
 
   template <typename Action>
@@ -65,7 +65,7 @@ private:
 
 class DumpVisitor : public boost::static_visitor<void> {
 public:
-  DumpVisitor(Formatter *formatter) : m_formatter(formatter) {}
+  explicit DumpVisitor(Formatter *formatter) : m_formatter(formatter) {}
 
   template <typename Action>
   inline void operator()(const Action &action) const {
index acad7258fccd4c8ff7c21a52310c88699343b00f..5cb5ee57eeb4a19728c13da97f07b67f55207e1c 100644 (file)
@@ -77,7 +77,7 @@ private:
 
 class Replayer {
 public:
-  Replayer(int num_action_trackers);
+  explicit Replayer(int num_action_trackers);
 
   ~Replayer();
 
index 9f0acec90c3e52fb830d3a59e364fc078a313e69..eec655a3bd7e42e67e5928941c9bf299bfd6a76c 100644 (file)
@@ -124,7 +124,7 @@ public:
 template <typename ActionType>
 class TypedAction : public Action {
 public:
-  TypedAction(const ActionType &action) : m_action(action) {
+  explicit TypedAction(const ActionType &action) : m_action(action) {
   }
 
   virtual action_id_t id() const {
@@ -193,7 +193,7 @@ protected:
 
 class AioReadAction : public TypedAction<action::AioReadAction> {
 public:
-  AioReadAction(const action::AioReadAction &action)
+  explicit AioReadAction(const action::AioReadAction &action)
     : TypedAction<action::AioReadAction>(action) {
   }
 
@@ -208,7 +208,7 @@ protected:
 
 class ReadAction : public TypedAction<action::ReadAction> {
 public:
-  ReadAction(const action::ReadAction &action)
+  explicit ReadAction(const action::ReadAction &action)
     : TypedAction<action::ReadAction>(action) {
   }
 
@@ -223,7 +223,7 @@ protected:
 
 class AioWriteAction : public TypedAction<action::AioWriteAction> {
 public:
-  AioWriteAction(const action::AioWriteAction &action)
+  explicit AioWriteAction(const action::AioWriteAction &action)
     : TypedAction<action::AioWriteAction>(action) {
   }
 
@@ -238,7 +238,7 @@ protected:
 
 class WriteAction : public TypedAction<action::WriteAction> {
 public:
-  WriteAction(const action::WriteAction &action)
+  explicit WriteAction(const action::WriteAction &action)
     : TypedAction<action::WriteAction>(action) {
   }
 
@@ -253,7 +253,7 @@ protected:
 
 class OpenImageAction : public TypedAction<action::OpenImageAction> {
 public:
-  OpenImageAction(const action::OpenImageAction &action)
+  explicit OpenImageAction(const action::OpenImageAction &action)
     : TypedAction<action::OpenImageAction>(action) {
   }
 
@@ -268,7 +268,7 @@ protected:
 
 class CloseImageAction : public TypedAction<action::CloseImageAction> {
 public:
-  CloseImageAction(const action::CloseImageAction &action)
+  explicit CloseImageAction(const action::CloseImageAction &action)
     : TypedAction<action::CloseImageAction>(action) {
   }
 
@@ -282,7 +282,7 @@ protected:
 
 class AioOpenImageAction : public TypedAction<action::AioOpenImageAction> {
 public:
-  AioOpenImageAction(const action::AioOpenImageAction &action)
+  explicit AioOpenImageAction(const action::AioOpenImageAction &action)
     : TypedAction<action::AioOpenImageAction>(action) {
   }
 
@@ -297,7 +297,7 @@ protected:
 
 class AioCloseImageAction : public TypedAction<action::AioCloseImageAction> {
 public:
-  AioCloseImageAction(const action::AioCloseImageAction &action)
+  explicit AioCloseImageAction(const action::AioCloseImageAction &action)
     : TypedAction<action::AioCloseImageAction>(action) {
   }
 
index fc2a7ef28de22e51df2a179d907e4cf003c87ca6..fe7249c3c1e068749d62002b29e72ddbdfcdbee8 100644 (file)
@@ -195,7 +195,7 @@ protected:
   multimap<string, ACLGrant> grant_map;
   void _add_grant(ACLGrant *grant);
 public:
-  RGWAccessControlList(CephContext *_cct) : cct(_cct) {}
+  explicit RGWAccessControlList(CephContext *_cct) : cct(_cct) {}
   RGWAccessControlList() : cct(NULL) {}
 
   void set_ctx(CephContext *ctx) {
@@ -293,7 +293,7 @@ protected:
   ACLOwner owner;
 
 public:
-  RGWAccessControlPolicy(CephContext *_cct) : cct(_cct), acl(_cct) {}
+  explicit RGWAccessControlPolicy(CephContext *_cct) : cct(_cct), acl(_cct) {}
   RGWAccessControlPolicy() : cct(NULL), acl(NULL) {}
   virtual ~RGWAccessControlPolicy() {}
 
index 694cc1d4a0701b92e3bd3bc4d873a98a658309f6..a21417ddaeaa2811c98625d20c39f4ffbdd92aaa 100644 (file)
@@ -57,7 +57,7 @@ public:
 class RGWAccessControlList_S3 : public RGWAccessControlList, public XMLObj
 {
 public:
-  RGWAccessControlList_S3(CephContext *_cct) : RGWAccessControlList(_cct) {}
+  explicit RGWAccessControlList_S3(CephContext *_cct) : RGWAccessControlList(_cct) {}
   ~RGWAccessControlList_S3() {}
 
   bool xml_end(const char *el);
@@ -82,7 +82,7 @@ class RGWEnv;
 class RGWAccessControlPolicy_S3 : public RGWAccessControlPolicy, public XMLObj
 {
 public:
-  RGWAccessControlPolicy_S3(CephContext *_cct) : RGWAccessControlPolicy(_cct) {}
+  explicit RGWAccessControlPolicy_S3(CephContext *_cct) : RGWAccessControlPolicy(_cct) {}
   ~RGWAccessControlPolicy_S3() {}
 
   bool xml_end(const char *el);
@@ -110,7 +110,7 @@ class RGWACLXMLParser_S3 : public RGWXMLParser
 
   XMLObj *alloc_obj(const char *el);
 public:
-  RGWACLXMLParser_S3(CephContext *_cct) : cct(_cct) {}
+  explicit RGWACLXMLParser_S3(CephContext *_cct) : cct(_cct) {}
 };
 
 #endif
index cbadfaa6884a8d95ad20d311b7ff8da18c89b17a..ba72d7b914dc818a28a497ab3804b02d2c89f3c8 100644 (file)
@@ -16,7 +16,7 @@ using namespace std;
 class RGWAccessControlPolicy_SWIFT : public RGWAccessControlPolicy
 {
 public:
-  RGWAccessControlPolicy_SWIFT(CephContext *_cct) : RGWAccessControlPolicy(_cct) {}
+  explicit RGWAccessControlPolicy_SWIFT(CephContext *_cct) : RGWAccessControlPolicy(_cct) {}
   ~RGWAccessControlPolicy_SWIFT() {}
 
   void add_grants(RGWRados *store, list<string>& uids, int perm);
index c9365fabfe176b3927d7d8ea2d7c45779482c54f..9e92234b0c2e040c300ff08d40d96baa4b3ecf25 100644 (file)
@@ -625,7 +625,7 @@ int bucket_stats(rgw_bucket& bucket, Formatter *formatter)
 class StoreDestructor {
   RGWRados *store;
 public:
-  StoreDestructor(RGWRados *_s) : store(_s) {}
+  explicit StoreDestructor(RGWRados *_s) : store(_s) {}
   ~StoreDestructor() {
     RGWStoreManager::close_storage(store);
   }
index 46e6684930ced9f673336d53f05c3db05ee91b95..ac610c6215f3d3bb805d7dec46a516ebf1bc467e 100644 (file)
@@ -107,7 +107,7 @@ class RGWClientIOStream : private RGWClientIOStreamBuf, public std::istream {
  * ctor is being called prior to construction of any member of this class. */
 
 public:
-  RGWClientIOStream(RGWClientIO &c)
+  explicit RGWClientIOStream(RGWClientIO &c)
     : RGWClientIOStreamBuf(c, 1, 2),
       istream(static_cast<RGWClientIOStreamBuf *>(this)) {
   }
index 823c0cb819fb35aa060760d34316ffcea278b785..302767eb14c53806b85cf7bcbb73fc16bdacbb54 100644 (file)
@@ -260,7 +260,7 @@ class NameVal
    string name;
    string val;
  public:
-    NameVal(string nv) : str(nv) {}
+    explicit NameVal(string nv) : str(nv) {}
 
     int parse();
 
@@ -1183,11 +1183,11 @@ struct RGWBucketEnt {
 
   RGWBucketEnt() : size(0), size_rounded(0), creation_time(0), count(0) {}
 
-  RGWBucketEnt(const cls_user_bucket_entry& e) : bucket(e.bucket),
-                                                size(e.size), 
-                                                size_rounded(e.size_rounded),
-                                                creation_time(e.creation_time),
-                                                count(e.count) {}
+  explicit RGWBucketEnt(const cls_user_bucket_entry& e) : bucket(e.bucket),
+                                                         size(e.size), 
+                                                         size_rounded(e.size_rounded),
+                                                         creation_time(e.creation_time),
+                                                         count(e.count) {}
 
   void convert(cls_user_bucket_entry *b) {
     bucket.convert(&b->bucket);
index 3a9616006959e7d58c7c375850eb507096fca652..818d02ffb470348f0c3501a337fcb31f2aa08600 100644 (file)
@@ -53,6 +53,6 @@ class RGWCORSXMLParser_S3 : public RGWXMLParser
 
   XMLObj *alloc_obj(const char *el);
 public:
-  RGWCORSXMLParser_S3(CephContext *_cct) : cct(_cct) {}
+  explicit RGWCORSXMLParser_S3(CephContext *_cct) : cct(_cct) {}
 };
 #endif /*CEPH_RGW_CORS_S3_H*/
index 88889b5085a0af477d204e8d7e5fd87d33be4fdb..92171f4780d236bbe08dc59ea8dcdf2403a790b6 100644 (file)
@@ -27,7 +27,7 @@ protected:
   int complete_request() { return 0; }
   int send_content_length(uint64_t len);
 public:
-  RGWFCGX(FCGX_Request *_fcgx) : fcgx(_fcgx), status_num(0) {}
+  explicit RGWFCGX(FCGX_Request *_fcgx) : fcgx(_fcgx), status_num(0) {}
   void flush();
 };
 
index 9ce841a5548151b9e7bd4bbbd6fe15bf9ffe056e..9df5251fb19a8c40a7b04e1436693801f3183232 100644 (file)
@@ -22,7 +22,7 @@ struct plain_stack_entry {
 class RGWFormatter_Plain : public Formatter {
   void reset_buf();
 public:
-  RGWFormatter_Plain(bool use_kv = false);
+  explicit RGWFormatter_Plain(bool use_kv = false);
   virtual ~RGWFormatter_Plain();
 
   virtual void set_status(int status, const char* status_name) {};
@@ -69,7 +69,7 @@ protected:
     formatter = f;
   }
 public:
-  RGWFormatterFlusher(Formatter *f) : formatter(f), flushed(false), started(false) {}
+  explicit RGWFormatterFlusher(Formatter *f) : formatter(f), flushed(false), started(false) {}
   virtual ~RGWFormatterFlusher() {}
 
   void flush() {
index 9e0e314db38597ccdc46a8bbd091885a56e578b9..705b848d1fbce6d85c84ea8a6963593ebeef68ca 100644 (file)
@@ -18,7 +18,7 @@ protected:
   list<pair<string, string> > headers;
 public:
   virtual ~RGWHTTPClient() {}
-  RGWHTTPClient(CephContext *_cct): send_len (0), has_send_len(false), cct(_cct) {}
+  explicit RGWHTTPClient(CephContext *_cct): send_len (0), has_send_len(false), cct(_cct) {}
 
   void append_header(const string& name, const string& val) {
     headers.push_back(pair<string, string>(name, val));
index e5636ed380cd592dbdb6ba44ff2830634d7218e3..87513157c346ebcd503da6f7cc90aecde61afadb 100644 (file)
@@ -40,7 +40,7 @@ public:
   int complete_request();
   int send_content_length(uint64_t len);
 
-  RGWLoadGenIO(RGWLoadGenRequestEnv *_re) : left_to_read(0), req(_re) {}
+  explicit RGWLoadGenIO(RGWLoadGenRequestEnv *_re) : left_to_read(0), req(_re) {}
   void flush();
 };
 
index 8f85fdec17fbbd2ad52e202c348fcb5b8033415a..c600386f4b32f63eeb317da7c948da222ddc44b2 100644 (file)
@@ -95,7 +95,7 @@ class UsageLogger {
   class C_UsageLogTimeout : public Context {
     UsageLogger *logger;
   public:
-    C_UsageLogTimeout(UsageLogger *_l) : logger(_l) {}
+    explicit C_UsageLogTimeout(UsageLogger *_l) : logger(_l) {}
     void finish(int r) {
       logger->flush();
       logger->set_timer();
index 181d943c921a1a8d2af7aad7f84e32ab6a47c440..e04202a9fae230d3c2081588d9c0e378ccfe7781 100644 (file)
@@ -96,7 +96,7 @@ struct RGWRequest
   RGWOp *op;
   utime_t ts;
 
-  RGWRequest(uint64_t id) : id(id), s(NULL), op(NULL) {
+  explicit RGWRequest(uint64_t id) : id(id), s(NULL), op(NULL) {
   }
 
   virtual ~RGWRequest() {}
@@ -139,7 +139,7 @@ class RGWFrontendConfig {
   int parse_config(const string& config, map<string, string>& config_map);
   string framework;
 public:
-  RGWFrontendConfig(const string& _conf) : config(_conf) {}
+  explicit RGWFrontendConfig(const string& _conf) : config(_conf) {}
   int init() {
     int ret = parse_config(config, config_map);
     if (ret < 0)
@@ -901,7 +901,7 @@ public:
 class RGWProcessControlThread : public Thread {
   RGWProcess *pprocess;
 public:
-  RGWProcessControlThread(RGWProcess *_pprocess) : pprocess(_pprocess) {}
+  explicit RGWProcessControlThread(RGWProcess *_pprocess) : pprocess(_pprocess) {}
 
   void *entry() {
     pprocess->run();
index 80ed8224e6d5fbf2958aab6c5dd4222fc40e5313..783cc6155d18724ee3026aa7e942657a155bc0f2 100644 (file)
@@ -13,7 +13,7 @@
 struct LogStatusDump {
   RGWMDLogStatus status;
 
-  LogStatusDump(RGWMDLogStatus _status) : status(_status) {}
+  explicit LogStatusDump(RGWMDLogStatus _status) : status(_status) {}
   void dump(Formatter *f) const {
     string s;
     switch (status) {
index dcbfbc1d3a43ad3b7e258726fc1e490561a4bcc6..ae7424d35a5befc36c927560ff291f75361848ee 100644 (file)
@@ -41,7 +41,7 @@ class StoreDestructor {
   RGWRados *store;
 
 public:
-  StoreDestructor(RGWRados *_s) : store(_s) {}
+  explicit StoreDestructor(RGWRados *_s) : store(_s) {}
   ~StoreDestructor() {
     if (store) {
       RGWStoreManager::close_storage(store);
index c9d56da2eeb95026da411f50067a481be6a30b8b..284dc14df8d45734ebe36b8ad40a08bd332ff407 100644 (file)
@@ -62,7 +62,7 @@ protected:
   atomic_t down_flag;
 
 public:
-  RGWObjectExpirer(RGWRados *_store)
+  explicit RGWObjectExpirer(RGWRados *_store)
     : store(_store)
   {}
 
index 148e75093e8b32e0f962a2cc1780df794741984e..254fbd4f5f70aa242b245ebca9d8cce3b3ad3598 100644 (file)
@@ -207,7 +207,7 @@ class RGWGetObj_CB : public RGWGetDataCB
 {
   RGWGetObj *op;
 public:
-  RGWGetObj_CB(RGWGetObj *_op) : op(_op) {}
+  explicit RGWGetObj_CB(RGWGetObj *_op) : op(_op) {}
   virtual ~RGWGetObj_CB() {}
 
   int handle_data(bufferlist& bl, off_t bl_ofs, off_t bl_len) {
index 9b70508e941fc5fc9e04418a5526cb34c5805bf1..8d5086621d6d25f38b3d6c93cedb806ecf961bb0 100644 (file)
@@ -43,7 +43,7 @@ struct RGWOrphanSearchStage {
   string marker;
 
   RGWOrphanSearchStage() : stage(ORPHAN_SEARCH_STAGE_UNKNOWN), shard(0) {}
-  RGWOrphanSearchStage(RGWOrphanSearchStageId _stage) : stage(_stage), shard(0) {}
+  explicit RGWOrphanSearchStage(RGWOrphanSearchStageId _stage) : stage(_stage), shard(0) {}
   RGWOrphanSearchStage(RGWOrphanSearchStageId _stage, int _shard, const string& _marker) : stage(_stage), shard(_shard), marker(_marker) {}
 
   void encode(bufferlist& bl) const {
@@ -127,7 +127,7 @@ class RGWOrphanStore {
   string oid;
 
 public:
-  RGWOrphanStore(RGWRados *_store) : store(_store), oid(RGW_ORPHAN_INDEX_OID) {}
+  explicit RGWOrphanStore(RGWRados *_store) : store(_store), oid(RGW_ORPHAN_INDEX_OID) {}
 
   librados::IoCtx& get_ioctx() { return ioctx; }
 
index c300c4432a0040cc75b5eb6373ee6ea755e45195..c6c62e7b7b9c7b9d3adf79ca68947db1b02adbcd 100644 (file)
@@ -306,7 +306,7 @@ protected:
   int fetch_stats_from_storage(const rgw_user& user, rgw_bucket& bucket, RGWStorageStats& stats);
 
 public:
-  RGWBucketStatsCache(RGWRados *_store) : RGWQuotaCache<rgw_bucket>(_store, _store->ctx()->_conf->rgw_bucket_quota_cache_size) {
+  explicit RGWBucketStatsCache(RGWRados *_store) : RGWQuotaCache<rgw_bucket>(_store, _store->ctx()->_conf->rgw_bucket_quota_cache_size) {
   }
 
   AsyncRefreshHandler *allocate_refresh_handler(const rgw_user& user, rgw_bucket& bucket) {
index c6f99ca0afef4a1c3565420dd2aa725f6ff2deb5..a75b69e89fdaea447459a94f744a8386e98edd40 100644 (file)
@@ -1300,7 +1300,7 @@ class RGWWatcher : public librados::WatchCtx2 {
   class C_ReinitWatch : public Context {
     RGWWatcher *watcher;
     public:
-      C_ReinitWatch(RGWWatcher *_watcher) : watcher(_watcher) {}
+      explicit C_ReinitWatch(RGWWatcher *_watcher) : watcher(_watcher) {}
       void finish(int r) {
         watcher->reinit();
       }
@@ -6121,7 +6121,7 @@ struct get_obj_data : public RefCountedObject {
   Throttle throttle;
   list<bufferlist> read_list;
 
-  get_obj_data(CephContext *_cct)
+  explicit get_obj_data(CephContext *_cct)
     : cct(_cct),
       rados(NULL), ctx(NULL),
       total_read(0), lock("get_obj_data"), data_lock("get_obj_data::data_lock"),
@@ -7421,7 +7421,7 @@ class RGWGetUserStatsContext : public RGWGetUserHeader_CB {
   RGWGetUserStats_CB *cb;
 
 public:
-  RGWGetUserStatsContext(RGWGetUserStats_CB *_cb) : cb(_cb) {}
+  explicit RGWGetUserStatsContext(RGWGetUserStats_CB *_cb) : cb(_cb) {}
   void handle_response(int r, cls_user_header& header) {
     cls_user_stats& hs = header.stats;
     if (r >= 0) {
@@ -7942,7 +7942,7 @@ int RGWRados::pool_iterate(RGWPoolIterCtx& ctx, uint32_t num, vector<RGWObjEnt>&
 struct RGWAccessListFilterPrefix : public RGWAccessListFilter {
   string prefix;
 
-  RGWAccessListFilterPrefix(const string& _prefix) : prefix(_prefix) {}
+  explicit RGWAccessListFilterPrefix(const string& _prefix) : prefix(_prefix) {}
   virtual bool filter(string& name, string& key) {
     return (prefix.compare(key.substr(0, prefix.size())) == 0);
   }
index f57d34f86bc1598d8eba571d85051e332925c3ce..cb3c880cfa2b10403d225aa4d0f705f9fac86903 100644 (file)
@@ -464,7 +464,7 @@ public:
     obj_iterator() : manifest(NULL) {
       init();
     }
-    obj_iterator(RGWObjManifest *_m) : manifest(_m) {
+    explicit obj_iterator(RGWObjManifest *_m) : manifest(_m) {
       init();
       if (!manifest->empty()) {
         seek(0);
@@ -1130,7 +1130,7 @@ public:
     OPSTATE_CANCELLED   = 5,
   };
 
-  RGWOpState(RGWRados *_store);
+  explicit RGWOpState(RGWRados *_store);
 
   int state_from_str(const string& s, OpState *state);
   int set_state(const string& client_id, const string& op_id, const string& object, OpState state);
@@ -1161,7 +1161,7 @@ protected:
   rgw_bucket bucket;
   map<RGWObjCategory, RGWStorageStats> *stats;
 public:
-  RGWGetBucketStats_CB(rgw_bucket& _bucket) : bucket(_bucket), stats(NULL) {}
+  explicit RGWGetBucketStats_CB(rgw_bucket& _bucket) : bucket(_bucket), stats(NULL) {}
   virtual ~RGWGetBucketStats_CB() {}
   virtual void handle_response(int r) = 0;
   virtual void set_response(map<RGWObjCategory, RGWStorageStats> *_stats) {
@@ -1174,7 +1174,7 @@ protected:
   rgw_user user;
   RGWStorageStats stats;
 public:
-  RGWGetUserStats_CB(const rgw_user& _user) : user(_user) {}
+  explicit RGWGetUserStats_CB(const rgw_user& _user) : user(_user) {}
   virtual ~RGWGetUserStats_CB() {}
   virtual void handle_response(int r) = 0;
   virtual void set_response(RGWStorageStats& _stats) {
@@ -1213,7 +1213,7 @@ struct RGWObjectCtx {
   map<rgw_obj, RGWObjState> objs_state;
   void *user_ctx;
 
-  RGWObjectCtx(RGWRados *_store) : store(_store), user_ctx(NULL) { }
+  explicit RGWObjectCtx(RGWRados *_store) : store(_store), user_ctx(NULL) { }
   RGWObjectCtx(RGWRados *_store, void *_user_ctx) : store(_store), user_ctx(_user_ctx) { }
 
   RGWObjState *get_state(rgw_obj& obj);
@@ -1264,7 +1264,7 @@ class RGWRados
   class C_Tick : public Context {
     RGWRados *rados;
   public:
-    C_Tick(RGWRados *_r) : rados(_r) {}
+    explicit C_Tick(RGWRados *_r) : rados(_r) {}
     void finish(int r) {
       rados->tick();
     }
@@ -1509,7 +1509,7 @@ public:
         rgw_cache_entry_info *cache_info;
       } read_params;
 
-      Read(RGWRados::SystemObject *_source) : source(_source) {}
+      explicit Read(RGWRados::SystemObject *_source) : source(_source) {}
 
       int stat(RGWObjVersionTracker *objv_tracker);
       int read(int64_t ofs, int64_t end, bufferlist& bl, RGWObjVersionTracker *objv_tracker);
@@ -1524,7 +1524,7 @@ public:
     librados::IoCtx index_ctx;
     string bucket_obj;
 
-    BucketShard(RGWRados *_store) : store(_store), shard_id(-1) {}
+    explicit BucketShard(RGWRados *_store) : store(_store), shard_id(-1) {}
     int init(rgw_bucket& _bucket, rgw_obj& obj);
   };
 
@@ -1609,7 +1609,7 @@ public:
         Params() : lastmod(NULL), read_size(NULL), obj_size(NULL), attrs(NULL), perr(NULL) {}
       } params;
 
-      Read(RGWRados::Object *_source) : source(_source) {}
+      explicit Read(RGWRados::Object *_source) : source(_source) {}
 
       int prepare(int64_t *pofs, int64_t *pend);
       int read(int64_t ofs, int64_t end, bufferlist& bl);
@@ -1641,7 +1641,7 @@ public:
                  if_match(NULL), if_nomatch(NULL), olh_epoch(0), delete_at(0) {}
       } meta;
 
-      Write(RGWRados::Object *_target) : target(_target) {}
+      explicit Write(RGWRados::Object *_target) : target(_target) {}
 
       int write_meta(uint64_t size,  map<std::string, bufferlist>& attrs);
       int write_data(const char *data, uint64_t ofs, uint64_t len, bool exclusive);
@@ -1670,7 +1670,7 @@ public:
         DeleteResult() : delete_marker(false) {}
       } result;
       
-      Delete(RGWRados::Object *_target) : target(_target) {}
+      explicit Delete(RGWRados::Object *_target) : target(_target) {}
 
       int delete_obj();
     };
@@ -1698,7 +1698,7 @@ public:
       } state;
 
 
-      Stat(RGWRados::Object *_source) : source(_source) {}
+      explicit Stat(RGWRados::Object *_source) : source(_source) {}
 
       int stat_async();
       int wait();
@@ -1775,7 +1775,7 @@ public:
       } params;
 
     public:
-      List(RGWRados::Bucket *_target) : target(_target) {}
+      explicit List(RGWRados::Bucket *_target) : target(_target) {}
 
       int list_objects(int max, vector<RGWObjEnt> *result, map<string, bool> *common_prefixes, bool *is_truncated);
       rgw_obj_key& get_next_marker() {
index 9ea3982ee559366efd10922d584c2c5d5194d552..794a5d9139169d4b4240d4c597c2ea83a93c4ed9 100644 (file)
@@ -45,7 +45,7 @@ protected:
   RGWRados *store;
   int open_ioctx(librados::IoCtx& ctx, const string& pool);
 
-  RGWReplicaLogger(RGWRados *_store);
+  explicit RGWReplicaLogger(RGWRados *_store);
 
   int update_bound(const string& oid, const string& pool,
                    const string& daemon_id, const string& marker,
@@ -105,7 +105,7 @@ class RGWReplicaBucketLogger : private RGWReplicaLogger {
   string obj_name(const rgw_bucket& bucket, int shard_id, bool index_by_instance);
 
 public:
-  RGWReplicaBucketLogger(RGWRados *_store);
+  explicit RGWReplicaBucketLogger(RGWRados *_store);
   int update_bound(const rgw_bucket& bucket, int shard_id, const string& daemon_id,
                    const string& marker, const utime_t& time,
                    const list<RGWReplicaItemMarker> *entries);
index 4eaf42e8ac6a81e414a0b99dd74a68a641bb0e48..4ca88abbc8b818872bc49bbb3f7a8f9f2679f472 100644 (file)
@@ -272,7 +272,7 @@ int RGWRESTSimpleRequest::forward_request(RGWAccessKey& key, req_info& info, siz
 class RGWRESTStreamOutCB : public RGWGetDataCB {
   RGWRESTStreamWriteRequest *req;
 public:
-  RGWRESTStreamOutCB(RGWRESTStreamWriteRequest *_req) : req(_req) {}
+  explicit RGWRESTStreamOutCB(RGWRESTStreamWriteRequest *_req) : req(_req) {}
   int handle_data(bufferlist& bl, off_t bl_ofs, off_t bl_len); /* callback for object iteration when sending data */
 };
 
index f15d6491a9391d2e716cc33e73663ee7af37d868..e278ad2d3cf7a2367bb29c7419ead12e4317c7a3 100644 (file)
@@ -53,7 +53,7 @@ int RGWRESTConn::forward(const rgw_user& uid, req_info& info, obj_version *objv,
 class StreamObjData : public RGWGetDataCB {
   rgw_obj obj;
 public:
-    StreamObjData(rgw_obj& _obj) : obj(_obj) {}
+    explicit StreamObjData(rgw_obj& _obj) : obj(_obj) {}
 };
 
 int RGWRESTConn::put_obj_init(const rgw_user& uid, rgw_obj& obj, uint64_t obj_size,
index 9e7d15b20275c682471768d8f05485e86b6c6c45..ada556290f771d411282b64af5ee57ef43e432e2 100644 (file)
@@ -351,7 +351,7 @@ private:
   }
 
 public:
-  RGW_Auth_S3_Keystone_ValidateToken(CephContext *_cct)
+  explicit RGW_Auth_S3_Keystone_ValidateToken(CephContext *_cct)
       : RGWHTTPClient(_cct) {
     get_str_list(cct->_conf->rgw_keystone_accepted_roles, roles_list);
   }
@@ -493,7 +493,7 @@ class RGWRESTMgr_S3 : public RGWRESTMgr {
 private:
   bool enable_s3website;
 public:
-  RGWRESTMgr_S3(bool enable_s3website) : enable_s3website(false) { this->enable_s3website = enable_s3website; }
+  explicit RGWRESTMgr_S3(bool enable_s3website) : enable_s3website(false) { this->enable_s3website = enable_s3website; }
   virtual ~RGWRESTMgr_S3() {}
 
   virtual RGWHandler *get_handler(struct req_state *s);
index 06a22ccda22d7867b3e8c208ba3aaa5638fab199..d6cd7d8b0810322c3ef48f10d0a87c9354527038 100644 (file)
@@ -73,7 +73,7 @@ private:
    bool is_errordoc_request;
 public:
   RGWGetObj_ObjStore_S3Website() : is_errordoc_request(false) {}
-  RGWGetObj_ObjStore_S3Website(bool is_errordoc_request) : is_errordoc_request(false) { this->is_errordoc_request = is_errordoc_request; }
+  explicit RGWGetObj_ObjStore_S3Website(bool is_errordoc_request) : is_errordoc_request(false) { this->is_errordoc_request = is_errordoc_request; }
   ~RGWGetObj_ObjStore_S3Website() {}
   int send_response_data_error();
   int send_response_data(bufferlist& bl, off_t ofs, off_t len);
index 6086e763fdab0f9fa2dd7a4429d0eeb252d6a921..46132b0582a35d3c1b4222f8ee26b760798fe4ef 100644 (file)
@@ -646,7 +646,7 @@ struct UserQuotas {
 
   UserQuotas() {}
 
-  UserQuotas(RGWUserInfo& info) : bucket_quota(info.bucket_quota), 
+  explicit UserQuotas(RGWUserInfo& info) : bucket_quota(info.bucket_quota), 
                                  user_quota(info.user_quota) {}
 
   void dump(Formatter *f) const {
index 8a081aaa1a15eab413530417b1df816969b48cf8..ff449e91b9e420e64d5f9e4a937ce3faf7ed719d 100644 (file)
@@ -61,7 +61,7 @@ protected:
   int check_revoked();
 public:
 
-  RGWSwift(CephContext *_cct) : cct(_cct), keystone_revoke_thread(NULL) {
+  explicit RGWSwift(CephContext *_cct) : cct(_cct), keystone_revoke_thread(NULL) {
     init();
   }
   ~RGWSwift() {
index 57d40faaf30633b10d211359c59e74a0952ca51a..bff4a52912e8172eefde432a5d056716bdf9c338 100644 (file)
@@ -526,7 +526,7 @@ private:
   int add(RGWUserAdminOpState& op_state, std::string *err_msg, bool defer_save);
   int remove(RGWUserAdminOpState& op_state, std::string *err_msg, bool defer_save);
 public:
-  RGWAccessKeyPool(RGWUser* usr);
+  explicit RGWAccessKeyPool(RGWUser* usr);
   ~RGWAccessKeyPool();
 
   int init(RGWUserAdminOpState& op_state);
@@ -561,7 +561,7 @@ private:
   int remove(RGWUserAdminOpState& op_state, std::string *err_msg, bool defer_save);
   int modify(RGWUserAdminOpState& op_state, std::string *err_msg, bool defer_save);
 public:
-  RGWSubUserPool(RGWUser *user);
+  explicit RGWSubUserPool(RGWUser *user);
   ~RGWSubUserPool();
 
   bool exists(std::string subuser);
@@ -586,7 +586,7 @@ private:
   int remove(RGWUserAdminOpState& op_state, std::string *err_msg, bool defer_save);
 
 public:
-  RGWUserCapPool(RGWUser *user);
+  explicit RGWUserCapPool(RGWUser *user);
   ~RGWUserCapPool();
 
   int init(RGWUserAdminOpState& op_state);
index 661e97cc77e95bd59e829ceca259a8a94bcd3ef7..21f03731a6f4f5421755e9e06a45b2bfafefe4f5 100644 (file)
@@ -95,7 +95,7 @@ public:
   struct err {
     string message;
 
-    err(const string& m) : message(m) {}
+    explicit err(const string& m) : message(m) {}
   };
 
   class XMLParser : public RGWXMLParser {
@@ -104,7 +104,7 @@ public:
     virtual ~XMLParser() {}
   } parser;
 
-  RGWXMLDecoder(bufferlist& bl) {
+  explicit RGWXMLDecoder(bufferlist& bl) {
     if (!parser.parse(bl.c_str(), bl.length(), 1)) {
       cout << "RGWXMLDecoder::err()" << std::endl;
       throw RGWXMLDecoder::err("failed to parse XML input");
index fc59b7db3a0f62cf21b0e2f933d8d720724db74f..a99641f72f2cc071325cd177b13f703a08f187ec 100644 (file)
@@ -26,7 +26,7 @@ protected:
   map<pair<string,string>, bufferlist>::iterator it;
 
 public:
-  WholeSpaceMemIterator(KeyValueDBMemory *db) : db(db), ready(false) { }
+  explicit WholeSpaceMemIterator(KeyValueDBMemory *db) : db(db), ready(false) { }
   virtual ~WholeSpaceMemIterator() { }
 
   int seek_to_first() {
@@ -238,7 +238,7 @@ public:
    * keep it in mind.
    */
 
-  WholeSpaceSnapshotMemIterator(KeyValueDBMemory *db) :
+  explicit WholeSpaceSnapshotMemIterator(KeyValueDBMemory *db) :
     WholeSpaceMemIterator(db) { }
   ~WholeSpaceSnapshotMemIterator() {
     delete db;
index 563e7bdc32e8f4e542b78eb6a3cc7748ab627215..0712fa0344a4fa7d4a496a9a15416501341ee313 100644 (file)
@@ -16,7 +16,7 @@ public:
   std::map<std::pair<string,string>,bufferlist> db;
 
   KeyValueDBMemory() { }
-  KeyValueDBMemory(KeyValueDBMemory *db) : db(db->db) { }
+  explicit KeyValueDBMemory(KeyValueDBMemory *db) : db(db->db) { }
   virtual ~KeyValueDBMemory() { }
 
   virtual int init(string _opt) {
@@ -62,7 +62,7 @@ public:
     list<Context *> on_commit;
     KeyValueDBMemory *db;
 
-    TransactionImpl_(KeyValueDBMemory *db) : db(db) {}
+    explicit TransactionImpl_(KeyValueDBMemory *db) : db(db) {}
 
 
     struct SetOp : public Context {
index 0dc8a066e41226027c046b9c9a897724ebbff50e..5e2b6b973956ec1d32aa9f4839302e81cb44fa68 100644 (file)
@@ -26,7 +26,7 @@ namespace
 class TestContext : public Context
 {
 public:
-  TestContext(int num_)
+  explicit TestContext(int num_)
     : num(num_)
   {
   }
@@ -50,7 +50,7 @@ protected:
 class StrictOrderTestContext : public TestContext
 {
 public:
-  StrictOrderTestContext (int num_)
+  explicit StrictOrderTestContext (int num_)
     : TestContext(num_)
   {
   }
index cee215d2e96f6da8550df5b63119830aff4e4830..212d754f379d52e7d21052bf1d19622b6a0c4df3 100644 (file)
@@ -30,7 +30,7 @@
 class AdminSocketTest
 {
 public:
-  AdminSocketTest(AdminSocket *asokc)
+  explicit AdminSocketTest(AdminSocket *asokc)
     : m_asokc(asokc)
   {
   }
index aebe729a72a2abf4e0f3aeb37373ec4a2dc14338..90f888d7793614d83799d7fcd04cf3acdc88bc97 100644 (file)
@@ -10,7 +10,7 @@
 template<typename T>
 struct C_Holder : public Context {
   T obj;
-  C_Holder(
+  explicit C_Holder(
     T obj)
     : obj(obj) {}
   void finish(int r) {
@@ -20,13 +20,13 @@ struct C_Holder : public Context {
 
 struct OnDelete {
   Context *c;
-  OnDelete(Context *c) : c(c) {}
+  explicit OnDelete(Context *c) : c(c) {}
   ~OnDelete() { c->complete(0); }
 };
 
 struct Cleanup : public Context {
   Bencher *bench;
-  Cleanup(Bencher *bench) : bench(bench) {}
+  explicit Cleanup(Bencher *bench) : bench(bench) {}
   void finish(int r) {
     bench->complete_op();
   }
index d3525b8b66cc6af19eee752ccedabce2d6d6ae32..545195fc8b43eac9df746b5828dd03c15a1f846e 100644 (file)
@@ -127,7 +127,7 @@ public:
 class Uniform : public Distribution<uint64_t> {
   uint64_t val;
 public:
-  Uniform(uint64_t val) : val(val) {}
+  explicit Uniform(uint64_t val) : val(val) {}
   virtual uint64_t operator()() {
     return val;
   }
index 38e160db76f7ac5bd7721c9729333f411df332bd..203ddf2983641e3ca8a01c9825515669ecbc57c0 100644 (file)
@@ -42,7 +42,7 @@ class DumbBackend : public Backend {
   class SyncThread : public Thread {
     DumbBackend *backend;
   public:
-    SyncThread(DumbBackend *backend) : backend(backend) {}
+    explicit SyncThread(DumbBackend *backend) : backend(backend) {}
     void *entry() {
       backend->sync_loop();
       return 0;
index 911d6c7d487fc326c57fcbca3f3999c87f980610..a607ae7c8cc583ee4c33065b981eda6e41baa87a 100644 (file)
@@ -10,7 +10,7 @@
 class RadosBackend : public Backend {
   librados::IoCtx *ioctx;
 public:
-  RadosBackend(
+  explicit RadosBackend(
     librados::IoCtx *ioctx)
     : ioctx(ioctx) {}
   void write(
index 9c3bc8bbc1c9bcb99d8b2d06ba07446328700bb7..9994bc727b526a08b8531bb88f1de5d9db93a0ea 100644 (file)
@@ -10,7 +10,7 @@
 class RBDBackend : public Backend {
   map<string, ceph::shared_ptr<librbd::Image> > *m_images;
 public:
-  RBDBackend(map<string, ceph::shared_ptr<librbd::Image> > *images)
+  explicit RBDBackend(map<string, ceph::shared_ptr<librbd::Image> > *images)
     : m_images(images) {}
   void write(
     const string &oid,
index 75f0ded006c02d5ef283a21bb5f2385edb106a9a..9466bd4d87a5164f793c31e11c8940fc1a535917 100644 (file)
@@ -29,7 +29,7 @@ using namespace std;
 
 struct MorePrinting : public DetailedStatCollector::AdditionalPrinting {
   CephContext *cct;
-  MorePrinting(CephContext *cct) : cct(cct) {}
+  explicit MorePrinting(CephContext *cct) : cct(cct) {}
   void operator()(std::ostream *out) {
     bufferlist bl;
     Formatter *f = Formatter::create("json-pretty");
index a80e14a5e81158240aed0d3c8af4a5bdd080aa13..39e8813ae756260bcfebffa4417a3bf6b95c0dfd 100644 (file)
@@ -13,7 +13,7 @@ struct T : public Thread {
   int num;
   set<int> myset;
   map<int,string> mymap;
-  T(int n) : num(n) {
+  explicit T(int n) : num(n) {
     myset.insert(123);
     myset.insert(456);
     mymap[1] = "foo";
index f846db7291890bfba7063c67d5c99c755d635e63..c4f99c8ba1123742f9a8db2b6775b153e7ba910f 100644 (file)
@@ -27,7 +27,7 @@
 class VectorContainer
 {
 public:
-  VectorContainer(const char** arr_) {
+  explicit VectorContainer(const char** arr_) {
     for (const char **a = arr_; *a; ++a) {
       const char *str = (const char*)strdup(*a);
       arr.push_back(str);
index 768915957401cf361897c9a1d1fec05d0fe8776b..3892c75bb59da0d8a4ca62e546e6cce7f7acf96f 100644 (file)
@@ -29,7 +29,7 @@ public:
   private:
     unsigned int get_state(uint64_t pos);
   public:
-    Iterator(ObjectContents *parent) :
+    explicit Iterator(ObjectContents *parent) :
       parent(parent), iter(parent->seeds.end()),
       current_state(0), current_val(0), pos(-1) {
       seek_to_first();
@@ -77,7 +77,7 @@ public:
     seeds[0] = 0;
   }
 
-  ObjectContents(bufferlist::iterator &bp) {
+  explicit ObjectContents(bufferlist::iterator &bp) {
     ::decode(_size, bp);
     ::decode(seeds, bp);
     ::decode(written, bp);
index 1655596d1a03802bb899a8e34508bbfe01879bef..e80a499cb711832c399dcbc9bd42bd492171ea5c 100644 (file)
@@ -102,7 +102,7 @@ class SyntheticWorkload {
   static const uint64_t MAX_INFLIGHT = 128;
 
  public:
-  SyntheticWorkload(AsyncCompressor *ac): async_compressor(ac), rng(time(NULL)) {
+  explicit SyntheticWorkload(AsyncCompressor *ac): async_compressor(ac), rng(time(NULL)) {
     for (int i = 0; i < 100; i++) {
       bufferlist bl;
       boost::uniform_int<> u(4096, 1<<24);
index 7483718f5f62ca9fabb516818f71603a8bc8b74e..b3630792aef81bd61750fee4557ffc13cfa13ba9 100644 (file)
@@ -23,7 +23,7 @@
 class Item : public LRUObject {
 public:
   int id;
-  Item(int v) : id(v) {}
+  explicit Item(int v) : id(v) {}
 };
 
 
index 00709a1ecbb214bb35f0f9f81e3773cb5ac61449..0508e2aa56321888fcf3ea6e864685e40ea6fd28 100644 (file)
@@ -164,7 +164,7 @@ TEST_F(PrioritizedQueueTest, fairness_by_class) {
 template <typename T>
 struct Greater {
   const T rhs;
-  Greater(const T& v) : rhs(v)
+  explicit Greater(const T& v) : rhs(v)
   {}
   bool operator()(const T& lhs) const {
     return lhs > rhs;
index 96914ee58dd5be4994b90bbac9a4bac651cc3d43..19135532a8f186e36eb6218f30f723b4218b5906 100644 (file)
@@ -23,7 +23,7 @@
 class CompressorPluginExample : public CompressionPlugin {
 public:
 
-  CompressorPluginExample(CephContext* cct) : CompressionPlugin(cct)
+  explicit CompressorPluginExample(CephContext* cct) : CompressionPlugin(cct)
   {}
 
   virtual int factory(CompressorRef *cs,
index 4f2b26c522799b49f50ad547277fdee75837c110..da4d6fb04ef077e9248799c81120cc8de9e96b5c 100644 (file)
@@ -69,7 +69,7 @@ public:
     default_ctor++;
   }
 
-  ConstructorCounter(const T& data_)
+  explicit ConstructorCounter(const T& data_)
     : data(data_)
   {
     one_arg_ctor++;
index c816853ac4d8039e92f72590f37e31769299aa92..7ae6643bc46584eebe888a4e4672e824d210ea97 100644 (file)
@@ -47,7 +47,7 @@ public:
 
   class WatchCtx : public librados::WatchCtx2 {
   public:
-    WatchCtx(TestImageWatcher &parent) : m_parent(parent), m_handle(0) {}
+    explicit WatchCtx(TestImageWatcher &parent) : m_parent(parent), m_handle(0) {}
 
     int watch(const librbd::ImageCtx &ictx) {
       m_header_oid = ictx.header_oid;
index e8b21d6ee5c1af34a2d5ea49d073f0833428c961..883bdad3e0ce30193db4759f767934e259393eb6 100644 (file)
@@ -3316,7 +3316,7 @@ TEST_F(TestLibRBD, ResizeViaLockOwner)
 
 class RBDWriter : public Thread {
  public:
-   RBDWriter(librbd::Image &image) : m_image(image) {};
+   explicit RBDWriter(librbd::Image &image) : m_image(image) {};
  protected:
   void *entry() {
     librbd::image_info_t info;
index e2397902906e40ebb3d457b6b15efbb83219d821..0c08003b761011283cb18afa5d5cfe28edd167a3 100644 (file)
@@ -24,7 +24,7 @@ private:
   Messenger *messenger;
   uint64_t dcount;
 public:
-  SimpleDispatcher(Messenger *msgr);
+  explicit SimpleDispatcher(Messenger *msgr);
   virtual ~SimpleDispatcher();
 
   uint64_t get_dcount() { return dcount; }
index f8b76d3242be4f79affebd1bcf9d16dc70c62a4c..29c71a0ba17ac39c30b9e49d7c36b9730f7e7485 100644 (file)
@@ -24,7 +24,7 @@ private:
   Messenger *messenger;
   uint64_t dcount;
 public:
-  XioDispatcher(Messenger *msgr);
+  explicit XioDispatcher(Messenger *msgr);
   virtual ~XioDispatcher();
 
   uint64_t get_dcount() { return dcount; }
index a20741a99c22ca671a2198b2959477971dd7e729..3e4e0505ded1479db40377a503f7f2475e4f525e 100644 (file)
@@ -59,7 +59,7 @@ protected:
 
 public:
 
-  MonClientHelper(CephContext *cct_)
+  explicit MonClientHelper(CephContext *cct_)
     : Dispatcher(cct_),
       cct(cct_),
       monc(cct_),
index 64575fe5e92b6baab4af65f68fb2d75402d57fa9..4ad26c31e1fa170afbdaf9eff48f69aa2edc7e16 100644 (file)
@@ -90,7 +90,7 @@ class TestStub : public Dispatcher
 
   struct C_Tick : public Context {
     TestStub *s;
-    C_Tick(TestStub *stub) : s(stub) {}
+    explicit C_Tick(TestStub *stub) : s(stub) {}
     void finish(int r) {
       generic_dout(20) << "C_Tick::" << __func__ << dendl;
       if (r == -ECANCELED) {
@@ -230,7 +230,7 @@ class ClientStub : public TestStub
   }
 
  public:
-  ClientStub(CephContext *cct)
+  explicit ClientStub(CephContext *cct)
     : TestStub(cct, "client"),
       gen((int) time(NULL))
   { }
@@ -328,7 +328,7 @@ class OSDStub : public TestStub
 
   struct C_CreatePGs : public Context {
     OSDStub *s;
-    C_CreatePGs(OSDStub *stub) : s(stub) {}
+    explicit C_CreatePGs(OSDStub *stub) : s(stub) {}
     void finish(int r) {
       if (r == -ECANCELED) {
        generic_dout(20) << "C_CreatePGs::" << __func__
index fb4637426447804facd7fcf2306f5ecb157471e3..873adeda2dc0983018cd2e92ad8c215cd65664b9 100644 (file)
@@ -272,7 +272,7 @@ class Worker : public Thread {
 
  public:
   EventCenter center;
-  Worker(CephContext *c): cct(c), done(false), center(c) {
+  explicit Worker(CephContext *c): cct(c), done(false), center(c) {
     center.init(100);
   }
   void stop() {
index 8829c1e54a642a641e6aff47c686e56ae07dc471..b195349609863039daf190451179283e1d3f9c87 100644 (file)
@@ -76,7 +76,7 @@ class FakeDispatcher : public Dispatcher {
     uint64_t count;
     ConnectionRef con;
 
-    Session(ConnectionRef c): RefCountedObject(g_ceph_context), lock("FakeDispatcher::Session::lock"), count(0), con(c) {
+    explicit Session(ConnectionRef c): RefCountedObject(g_ceph_context), lock("FakeDispatcher::Session::lock"), count(0), con(c) {
     }
     uint64_t get_count() { return count; }
   };
@@ -89,7 +89,7 @@ class FakeDispatcher : public Dispatcher {
   bool got_connect;
   bool loopback;
 
-  FakeDispatcher(bool s): Dispatcher(g_ceph_context), lock("FakeDispatcher::lock"),
+  explicit FakeDispatcher(bool s): Dispatcher(g_ceph_context), lock("FakeDispatcher::lock"),
                           is_server(s), got_new(false), got_remote_reset(false),
                           got_connect(false), loopback(false) {}
   bool ms_can_fast_dispatch_any() const { return true; }
@@ -1238,7 +1238,7 @@ class MarkdownDispatcher : public Dispatcher {
   bool last_mark;
  public:
   atomic_t count;
-  MarkdownDispatcher(bool s): Dispatcher(g_ceph_context), lock("MarkdownDispatcher::lock"),
+  explicit MarkdownDispatcher(bool s): Dispatcher(g_ceph_context), lock("MarkdownDispatcher::lock"),
                               last_mark(false), count(0) {}
   bool ms_can_fast_dispatch_any() const { return false; }
   bool ms_can_fast_dispatch(Message *m) const {
index 66a604731ea3da047fc63ef4cb36a4df5f535ccd..80164c3bf7c15b5a5fbcb756c43d4053c927032f 100644 (file)
@@ -98,7 +98,7 @@ public:
   int m_next_pool;
 
  public:
-  TestObjectStoreState(ObjectStore *store) :
+  explicit TestObjectStoreState(ObjectStore *store) :
     m_next_coll_nr(0), m_num_objs_per_coll(10), m_num_objects(0),
     m_max_in_flight(0), m_finished_lock("Finished Lock"), m_next_pool(1) {
     m_in_flight.set(0);
@@ -133,7 +133,7 @@ public:
     TestObjectStoreState *m_state;
 
    public:
-    C_OnFinished(TestObjectStoreState *state) : m_state(state) { }
+    explicit C_OnFinished(TestObjectStoreState *state) : m_state(state) { }
 
     void finish(int r) {
       Mutex::Locker locker(m_state->m_finished_lock);
index 4f7daf13a860748305f8568f05c87d456717539a..e13a1dc7e9ed4eb098f8c643225b837b3ac2beee 100644 (file)
@@ -1617,7 +1617,7 @@ class MixedGenerator : public ObjectGenerator {
 public:
   unsigned seq;
   int64_t poolid;
-  MixedGenerator(int64_t p) : seq(0), poolid(p) {}
+  explicit MixedGenerator(int64_t p) : seq(0), poolid(p) {}
   ghobject_t create_object(gen_type *gen) {
     char buf[100];
     snprintf(buf, sizeof(buf), "OBJ_%u", seq);
@@ -1672,7 +1672,7 @@ public:
 
   struct EnterExit {
     const char *msg;
-    EnterExit(const char *m) : msg(m) {
+    explicit EnterExit(const char *m) : msg(m) {
       //cout << pthread_self() << " enter " << msg << std::endl;
     }
     ~EnterExit() {
index 3b1557499a2297d62356a5abae614d0dbc74f11b..0d5360ee20ef5e6daff89c3a8bb5c24bc85114df 100644 (file)
@@ -120,7 +120,7 @@ class WorkloadGenerator : public TestObjectStoreState {
   void do_stats();
 
 public:
-  WorkloadGenerator(vector<const char*> args);
+  explicit WorkloadGenerator(vector<const char*> args);
   ~WorkloadGenerator() {
     m_store->umount();
   }
@@ -129,7 +129,7 @@ public:
     WorkloadGenerator *wrkldgen_state;
 
   public:
-    C_OnReadable(WorkloadGenerator *state)
+    explicit C_OnReadable(WorkloadGenerator *state)
      :TestObjectStoreState::C_OnFinished(state), wrkldgen_state(state) { }
 
     void finish(int r)
index 9d6700185b0ba5ee502246b6953ea92621ab400f..68969b5b08881640279bf4df16ea836b7dc81535 100644 (file)
@@ -12,7 +12,7 @@ using namespace std;
 class Pinger : public Dispatcher {
 public:
   Messenger *messenger;
-  Pinger(Messenger *m) : messenger(m) {
+  explicit Pinger(Messenger *m) : messenger(m) {
     m->set_dispatcher(this);
   }
   void dispatch(Message *m) {
index 0fea7571a4572d2d670e41d6d4717bf5d21c61cc..69e037c7df202392997803da5e49bd9e0f20d110 100644 (file)
@@ -13,7 +13,7 @@ using namespace std;
   class Th : public Thread {
   public:
        bufferlist bl;
-       Th(bufferlist& o) : bl(o) { }
+       explicit Th(bufferlist& o) : bl(o) { }
        
        void *entry() {
          //cout << "start" << endl;
index 561685a44b0349acf872fb47a8801f91c9f244d4..ad8800471a263618e2a4522e9b28cc917688873e 100644 (file)
@@ -127,7 +127,7 @@ public:
   class RandWrap {
   public:
     unsigned int state;
-    RandWrap(unsigned int seed)
+    explicit RandWrap(unsigned int seed)
     {
       state = seed;
     }
@@ -305,7 +305,7 @@ public:
     std::list<std::pair<ceph::shared_ptr<ContentsGenerator>,
              ContDesc> >::iterator cur_cont;
     
-    iterator(ObjectDesc &obj) :
+    explicit iterator(ObjectDesc &obj) :
       pos(0), obj(obj) {
       limit = obj.layers.begin()->first->get_length(obj.layers.begin()->second);
       cur_cont = obj.layers.begin();
index f023aeacc3cac937c98826e28a0c51c8271fd265..53dfdcea5b4e96cfe01fdcd0645b4519979fbf80 100644 (file)
@@ -122,7 +122,7 @@ public:
    */
   struct CallbackInfo {
     uint64_t id;
-    CallbackInfo(uint64_t id) : id(id) {}
+    explicit CallbackInfo(uint64_t id) : id(id) {}
     virtual ~CallbackInfo() {};
   };
 
index a7f074e4075ec7a6c1c716ef0229de10b6532476..f3c61211bb229d8b8d8b1a7b5b689ac12137f172 100644 (file)
@@ -265,7 +265,7 @@ public:
 
 struct TestHandler : public PGLog::LogEntryHandler {
   list<hobject_t> &removed;
-  TestHandler(list<hobject_t> &removed) : removed(removed) {}
+  explicit TestHandler(list<hobject_t> &removed) : removed(removed) {}
 
   void rollback(
     const pg_log_entry_t &entry) {}
index 7fab186944a70a3f3cdbfc56b07aa46f2f04c9f6..414064058dbc41d80b953a64832a28d67796e93b 100644 (file)
@@ -18,7 +18,7 @@ class HitSetTestStrap {
 public:
   HitSet *hitset;
 
-  HitSetTestStrap(HitSet *h) : hitset(h) {}
+  explicit HitSetTestStrap(HitSet *h) : hitset(h) {}
 
   void fill(unsigned count) {
     char buf[50];
index 276083db560cd14cb03aaa20e075ddd4524b0eb6..ca1e56a0c3fde6fee63b2f571ffe9e047b594344 100644 (file)
@@ -1074,7 +1074,7 @@ protected:
   public:
     ObjectContext &obc;
 
-    Thread_read_lock(ObjectContext& _obc) :
+    explicit Thread_read_lock(ObjectContext& _obc) :
       obc(_obc)
     {
     }
@@ -1089,7 +1089,7 @@ protected:
   public:
     ObjectContext &obc;
 
-    Thread_write_lock(ObjectContext& _obc) :
+    explicit Thread_write_lock(ObjectContext& _obc) :
       obc(_obc)
     {
     }
index fe642588f4c660742a24f12c7e8080535c831093..5ec36215464bfa012c857eb98b2f6a079658d398 100644 (file)
@@ -329,7 +329,7 @@ class CondPingPong {
   class Consumer : public Thread {
     CondPingPong *p;
    public:
-    Consumer(CondPingPong *p): p(p) {}
+    explicit Consumer(CondPingPong *p): p(p) {}
     void* entry() {
       p->consume();
       return 0;
@@ -466,7 +466,7 @@ class CenterWorker : public Thread {
 
  public:
   EventCenter center;
-  CenterWorker(CephContext *c): cct(c), done(false), center(c) {
+  explicit CenterWorker(CephContext *c): cct(c), done(false), center(c) {
     center.init(100);
   }
   void stop() {
@@ -486,7 +486,7 @@ class CountEvent: public EventCallback {
   atomic_t *count;
 
  public:
-  CountEvent(atomic_t *atomic): count(atomic) {}
+  explicit CountEvent(atomic_t *atomic): count(atomic) {}
   void do_request(int id) {
     count->dec();
   }
index d087d2929918b0cf164caaeef3f7c6b18b9f4ece..0cbedf475b903dc69ee31f13f6b43f872238656e 100644 (file)
@@ -35,6 +35,6 @@ public:
   int reinit(int dval);
 
 private:
-  CrossProcessSem(struct cross_process_sem_data_t *data);
+  explicit CrossProcessSem(struct cross_process_sem_data_t *data);
   struct cross_process_sem_data_t *m_data;
 };
index 17cb898c7608d89a9ac09f9806aafad15b5cd4db..93c87abe41c8b9bc0ed879170e55b2ef5608143e 100644 (file)
@@ -45,7 +45,7 @@ class PausyAsyncMap : public MapCacher::StoreDriver<string, bufferlist> {
   typedef ceph::shared_ptr<_Op> Op;
   struct Remove : public _Op {
     set<string> to_remove;
-    Remove(const set<string> &to_remove) : to_remove(to_remove) {}
+    explicit Remove(const set<string> &to_remove) : to_remove(to_remove) {}
     void operate(map<string, bufferlist> *store) {
       for (set<string>::iterator i = to_remove.begin();
           i != to_remove.end();
@@ -56,7 +56,7 @@ class PausyAsyncMap : public MapCacher::StoreDriver<string, bufferlist> {
   };
   struct Insert : public _Op {
     map<string, bufferlist> to_insert;
-    Insert(const map<string, bufferlist> &to_insert) : to_insert(to_insert) {}
+    explicit Insert(const map<string, bufferlist> &to_insert) : to_insert(to_insert) {}
     void operate(map<string, bufferlist> *store) {
       for (map<string, bufferlist>::iterator i = to_insert.begin();
           i != to_insert.end();
@@ -68,7 +68,7 @@ class PausyAsyncMap : public MapCacher::StoreDriver<string, bufferlist> {
   };
   struct Callback : public _Op {
     Context *context;
-    Callback(Context *c) : context(c) {}
+    explicit Callback(Context *c) : context(c) {}
     void operate(map<string, bufferlist> *store) {
       context->complete(0);
     }
@@ -103,7 +103,7 @@ private:
     bool paused;
     list<Op> queue;
   public:
-    Doer(PausyAsyncMap *parent) :
+    explicit Doer(PausyAsyncMap *parent) :
       parent(parent), lock("Doer lock"), stopping(0), paused(false) {}
     virtual void *entry() {
       while (1) {
index cafdc20e6e8e1344691d3bad7bc99a4520d25ed4..1dd3738c0f0bf0e8015d2c91f7a00cb73c51483f 100644 (file)
@@ -40,7 +40,7 @@ public:
 
 struct WatcherUnwatcher : public Thread {
   string pool;
-  WatcherUnwatcher(string& _pool) : pool(_pool) {}
+  explicit WatcherUnwatcher(string& _pool) : pool(_pool) {}
 
   void *entry() {
     Rados cluster;
index 9d5eadd0e9755e803f267b2e1db99e18fdd2dbff..c34f8c54042079c06d853dc3aa23cd6faed65320 100644 (file)
@@ -10,7 +10,7 @@ struct Item {
   xlist<Item*>::item xitem;
   int val;
 
-  Item(int v) :
+  explicit Item(int v) :
     xitem(this),
     val(v)
   {}
index 92c0eeb85b45ac2c84319d7b608c4fe0b2bcd0c4..54cec998a0ac44e42bd3d08d89f0d7f909bf5a1a 100644 (file)
@@ -161,7 +161,7 @@ struct object_begin {
   // of object processing.
   object_info_t oi;
 
-  object_begin(const ghobject_t &hoid): hoid(hoid) { }
+  explicit object_begin(const ghobject_t &hoid): hoid(hoid) { }
   object_begin() { }
 
   // If superblock doesn't include CEPH_FS_FEATURE_INCOMPAT_SHARDS then
@@ -218,8 +218,8 @@ struct data_section {
 
 struct attr_section {
   map<string,bufferlist> data;
-  attr_section(const map<string,bufferlist> &data) : data(data) { }
-  attr_section(map<string, bufferptr> &data_)
+  explicit attr_section(const map<string,bufferlist> &data) : data(data) { }
+  explicit attr_section(map<string, bufferptr> &data_)
   {
     for (std::map<std::string, bufferptr>::iterator i = data_.begin();
          i != data_.end(); ++i) {
@@ -245,7 +245,7 @@ struct attr_section {
 
 struct omap_hdr_section {
   bufferlist hdr;
-  omap_hdr_section(bufferlist hdr) : hdr(hdr) { }
+  explicit omap_hdr_section(bufferlist hdr) : hdr(hdr) { }
   omap_hdr_section() { }
 
   void encode(bufferlist& bl) const {
@@ -262,7 +262,7 @@ struct omap_hdr_section {
 
 struct omap_section {
   map<string, bufferlist> omap;
-  omap_section(const map<string, bufferlist> &omap) :
+  explicit omap_section(const map<string, bufferlist> &omap) :
     omap(omap) { }
   omap_section() { }
 
index c37c3af529359d6d63bafb9488d4055e040a677f..f9b4696c527d1c6e1d2362801f950f9a019d9de4 100644 (file)
@@ -37,7 +37,7 @@ class TraceIter {
   unsigned idx;
   MonitorDBStore::TransactionRef t;
 public:
-  TraceIter(string fname) : fd(-1), idx(-1) {
+  explicit TraceIter(string fname) : fd(-1), idx(-1) {
     fd = ::open(fname.c_str(), O_RDONLY);
     t.reset(new MonitorDBStore::Transaction);
   }
index 236dc0efb3221c0e6c0e663c37d05290a7b97264..9a44cfc1d99fac7f2edb240df5e4c4df334ee757 100644 (file)
@@ -1795,7 +1795,7 @@ int do_set_omaphdr(ObjectStore *store, coll_t coll,
 struct do_fix_lost : public action_on_object_t {
   ObjectStore::Sequencer *osr;
 
-  do_fix_lost(ObjectStore::Sequencer *_osr) : osr(_osr) {}
+  explicit do_fix_lost(ObjectStore::Sequencer *_osr) : osr(_osr) {}
 
   virtual int call(ObjectStore *store, coll_t coll,
                   ghobject_t &ghobj, object_info_t &oi) {
index ebfcd0a0d583c1fb5a4dc7f4452eb930e7c32e46..2d14a4f9286f901d7998a3068cc89e528feb58c3 100644 (file)
@@ -277,7 +277,7 @@ public:
 class InoTableHandler : public TableHandler<InoTable>
 {
   public:
-  InoTableHandler(mds_rank_t r)
+  explicit InoTableHandler(mds_rank_t r)
     : TableHandler(r, "inotable", true)
   {}
 
index 6b4eae50d9b5f3dcc604faedf93c3b77005a3044..0415050f9780717761c3e6ec7ce4494b82470d04 100644 (file)
@@ -25,7 +25,7 @@ namespace librados {
 class PoolDump : public RadosDump
 {
   public:
-    PoolDump(int file_fd_) : RadosDump(file_fd_, false) {}
+    explicit PoolDump(int file_fd_) : RadosDump(file_fd_, false) {}
     int dump(librados::IoCtx *io_ctx);
 };
 
index 85aeb0187abe32b2df43cb7164f5453471eac38a..8df20f344e8c99d98dfa06fddaa89fa6108af8d0 100644 (file)
@@ -542,7 +542,7 @@ public:
     librados::AioCompletion *completion;
 
     LoadGenOp() : id(0), type(0), off(0), len(0), lg(NULL), completion(NULL) {}
-    LoadGenOp(LoadGen *_lg) : id(0), type(0), off(0), len(0), lg(_lg), completion(NULL) {}
+    explicit LoadGenOp(LoadGen *_lg) : id(0), type(0), off(0), len(0), lg(_lg), completion(NULL) {}
   };
 
   int max_op;
@@ -577,7 +577,7 @@ public:
   Mutex lock;
   Cond cond;
 
-  LoadGen(Rados *_rados) : rados(_rados), going_down(false), lock("LoadGen") {
+  explicit LoadGen(Rados *_rados) : rados(_rados), going_down(false), lock("LoadGen") {
     read_percent = 80;
     min_obj_len = 1024;
     max_obj_len = 5ull * 1024ull * 1024ull * 1024ull;
index d767c087991cac5c36d82ab39b8b4696b535500c..849340b50457060422fee18774b0b2eedf5c4005 100644 (file)
@@ -64,7 +64,7 @@ struct rbd_bencher {
   Cond cond;
   int in_flight;
 
-  rbd_bencher(librbd::Image *i)
+  explicit rbd_bencher(librbd::Image *i)
     : image(i),
       lock("rbd_bencher::lock"),
       in_flight(0)
index 39666cba6c53fca0eacc0d1828927b751281c597..14d1453a50feae1418f5a8906342d44a291ff345 100644 (file)
@@ -262,7 +262,7 @@ public:
 protected:
   struct ReplayHandler : public ::journal::ReplayHandler {
     JournalPlayer *journal;
-    ReplayHandler(JournalPlayer *_journal) : journal(_journal) {}
+    explicit ReplayHandler(JournalPlayer *_journal) : journal(_journal) {}
 
     virtual void get() {}
     virtual void put() {}