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() {}
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() { }
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) {}
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) {}
public:
uint64_t nonce;
- CephXAuthorizer(CephContext *cct_)
+ explicit CephXAuthorizer(CephContext *cct_)
: AuthAuthorizer(CEPH_AUTH_CEPHX), cct(cct_), nonce(0) {}
bool build_authorizer();
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);
class AuthNoneServiceHandler : public AuthServiceHandler {
public:
- AuthNoneServiceHandler(CephContext *cct_)
+ explicit AuthNoneServiceHandler(CephContext *cct_)
: AuthServiceHandler(cct_) {}
~AuthNoneServiceHandler() {}
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);
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());
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) {}
};
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; }
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);
};
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) { }
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(); }
};
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),
}
~QuotaTree() {}
public:
- QuotaTree(Inode *i) :
+ explicit QuotaTree(Inode *i) :
_in(i),
_ancestor_ref(0),
_ancestor(NULL),
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),
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;
}
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()); }
};
*/
class CephBroker : public DfsBroker::Broker {
public:
- CephBroker(PropertiesPtr& cfg);
+ explicit CephBroker(PropertiesPtr& cfg);
virtual ~CephBroker();
virtual void open(ResponseCallbackOpen *cb, const char *fname,
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;
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);
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 {
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();
}
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;
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);
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)
{
}
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;
/// 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),
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() {};
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() {};
namespace ceph {
class HTMLFormatter : public XMLFormatter {
public:
- HTMLFormatter(bool pretty = false);
+ explicit HTMLFormatter(bool pretty = false);
~HTMLFormatter();
void reset();
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)
{ }
};
// get the number of total workers
int get_total_workers() const;
- HeartbeatMap(CephContext *cct);
+ explicit HeartbeatMap(CephContext *cct);
~HeartbeatMap();
private:
* 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)();
}
void _sample(snap *p);
public:
- MemoryModel(CephContext *cct);
+ explicit MemoryModel(CephContext *cct);
void sample(snap *p = 0) {
_sample(&last);
if (p)
Mutex &mutex;
public:
- Locker(Mutex& m) : mutex(m) {
+ explicit Locker(Mutex& m) : mutex(m) {
mutex.Lock();
}
~Locker() {
void *library;
CephContext *cct;
- Plugin(CephContext *cct) : cct(cct) {}
+ explicit Plugin(CephContext *cct) : cct(cct) {}
virtual ~Plugin() {}
};
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,
bool locked;
public:
- RLocker(const RWLock& lock) : m_lock(lock) {
+ explicit RLocker(const RWLock& lock) : m_lock(lock) {
m_lock.get_read();
locked = true;
}
bool locked;
public:
- WLocker(RWLock& lock) : m_lock(lock) {
+ explicit WLocker(RWLock& lock) : m_lock(lock) {
m_lock.get_write();
locked = true;
}
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() {
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;
template <const Traits &traits>
class TypedSingleton : public Singleton {
public:
- TypedSingleton(CephContext *cct)
+ explicit TypedSingleton(CephContext *cct)
: Singleton(cct, traits.library, traits.config_key) {
}
};
class RemoveOnDelete {
OpTracker *tracker;
public:
- RemoveOnDelete(OpTracker *tracker) : tracker(tracker) {}
+ explicit RemoveOnDelete(OpTracker *tracker) : tracker(tracker) {}
void operator()(TrackedOp *op);
};
friend class RemoveOnDelete;
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;
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");
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);
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)
{ }
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)
#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();
#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
*/
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
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
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;
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) {
class CephContextServiceThread : public Thread
{
public:
- CephContextServiceThread(CephContext *cct)
+ explicit CephContextServiceThread(CephContext *cct)
: _lock("CephContextServiceThread::_lock"),
_reopen_logs(false), _exit_thread(false), _cct(cct)
{
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[] = {
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[] = {
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) {
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;
};
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;
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;
}
struct lock_cond {
- lock_cond(Mutex *_lock) : lock(_lock) {}
+ explicit lock_cond(Mutex *_lock) : lock(_lock) {}
Mutex *lock;
Cond cond;
};
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,
// 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;
}
void _decompress(bufferlist &in, bufferlist &out);
public:
- AsyncCompressor(CephContext *c);
+ explicit AsyncCompressor(CephContext *c);
virtual ~AsyncCompressor() {}
int get_cpuid(int id) {
public:
CompressorRef compressor;
- CompressionPlugin(CephContext *cct) : Plugin(cct),
+ explicit CompressionPlugin(CephContext *cct) : Plugin(cct),
compressor(0)
{}
public:
- CompressionPluginSnappy(CephContext* cct) : CompressionPlugin(cct)
+ explicit CompressionPluginSnappy(CephContext* cct) : CompressionPlugin(cct)
{}
virtual int factory(CompressorRef *cs,
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) {
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();
}
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) {
typedef CrushTreeDumper::Item Item;
const CrushWrapper *crush;
public:
- TreeDumper(const CrushWrapper *crush)
+ explicit TreeDumper(const CrushWrapper *crush)
: crush(crush) {}
void dump(Formatter *f) {
public:
typedef CrushTreeDumper::Dumper<ostream> Parent;
- CrushTreePlainDumper(const CrushWrapper *crush)
+ explicit CrushTreePlainDumper(const CrushWrapper *crush)
: Parent(crush) {}
void dump(ostream *out) {
public:
typedef CrushTreeDumper::FormattingDumper Parent;
- CrushTreeFormattingDumper(const CrushWrapper *crush)
+ explicit CrushTreeFormattingDumper(const CrushWrapper *crush)
: Parent(crush) {}
void dump(Formatter *f) {
string ruleset_failure_domain;
bool per_chunk_alignment;
- ErasureCodeJerasure(const char *_technique) :
+ explicit ErasureCodeJerasure(const char *_technique) :
k(0),
DEFAULT_K("2"),
m(0),
int **schedule;
int packetsize;
- ErasureCodeJerasureCauchy(const char *technique) :
+ explicit ErasureCodeJerasureCauchy(const char *technique) :
ErasureCodeJerasure(technique),
bitmatrix(0),
schedule(0)
int **schedule;
int packetsize;
- ErasureCodeJerasureLiberation(const char *technique = "liberation") :
+ explicit ErasureCodeJerasureLiberation(const char *technique = "liberation") :
ErasureCodeJerasure(technique),
bitmatrix(0),
schedule(0)
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;
};
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")
{
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();
}
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();
}
int do_open(ostream &out, bool create_if_missing);
public:
- KineticStore(CephContext *c);
+ explicit KineticStore(CephContext *c);
~KineticStore();
static int _test_init(CephContext *c);
vector<KineticOp> ops;
KineticStore *db;
- KineticTransactionImpl(KineticStore *db) : db(db) {}
+ explicit KineticTransactionImpl(KineticStore *db) : db(db) {}
void set(
const string &prefix,
const string &k,
kinetic::BlockingKineticConnection *kinetic_conn;
kinetic::KineticStatus kinetic_status;
public:
- KineticWholeSpaceIteratorImpl(kinetic::BlockingKineticConnection *conn);
+ explicit KineticWholeSpaceIteratorImpl(kinetic::BlockingKineticConnection *conn);
virtual ~KineticWholeSpaceIteratorImpl() { }
int seek_to_first() {
class CephLevelDBLogger : public leveldb::Logger {
CephContext *cct;
public:
- CephLevelDBLogger(CephContext *c) : cct(c) {
+ explicit CephLevelDBLogger(CephContext *c) : cct(c) {
cct->get();
}
~CephLevelDBLogger() {
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;
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,
protected:
boost::scoped_ptr<leveldb::Iterator> dbiter;
public:
- LevelDBWholeSpaceIteratorImpl(leveldb::Iterator *iter) :
+ explicit LevelDBWholeSpaceIteratorImpl(leveldb::Iterator *iter) :
dbiter(iter) { }
virtual ~LevelDBWholeSpaceIteratorImpl() { }
class CephRocksdbLogger : public rocksdb::Logger {
CephContext *cct;
public:
- CephRocksdbLogger(CephContext *c) : cct(c) {
+ explicit CephRocksdbLogger(CephContext *c) : cct(c) {
cct->get();
}
~CephRocksdbLogger() {
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;
rocksdb::WriteBatch *bat;
RocksDBStore *db;
- RocksDBTransactionImpl(RocksDBStore *_db);
+ explicit RocksDBTransactionImpl(RocksDBStore *_db);
~RocksDBTransactionImpl();
void set(
const string &prefix,
protected:
rocksdb::Iterator *dbiter;
public:
- RocksDBWholeSpaceIteratorImpl(rocksdb::Iterator *iter) :
+ explicit RocksDBWholeSpaceIteratorImpl(rocksdb::Iterator *iter) :
dbiter(iter) { }
//virtual ~RocksDBWholeSpaceIteratorImpl() { }
~RocksDBWholeSpaceIteratorImpl();
struct ceph_mount_info
{
public:
- ceph_mount_info(CephContext *cct_)
+ explicit ceph_mount_info(CephContext *cct_)
: mounted(false),
inited(false),
client(NULL),
struct C_AioComplete : public Context {
AioCompletionImpl *c;
- C_AioComplete(AioCompletionImpl *cc) : c(cc) {
+ explicit C_AioComplete(AioCompletionImpl *cc) : c(cc) {
c->_get();
}
struct C_AioSafe : public Context {
AioCompletionImpl *c;
- C_AioSafe(AioCompletionImpl *cc) : c(cc) {
+ explicit C_AioSafe(AioCompletionImpl *cc) : c(cc) {
c->_get();
}
struct C_AioCompleteAndSafe : public Context {
AioCompletionImpl *c;
- C_AioCompleteAndSafe(AioCompletionImpl *cc) : c(cc) {
+ explicit C_AioCompleteAndSafe(AioCompletionImpl *cc) : c(cc) {
c->get();
}
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);
}
struct C_aio_Ack : public Context {
librados::AioCompletionImpl *c;
- C_aio_Ack(AioCompletionImpl *_c);
+ explicit C_aio_Ack(AioCompletionImpl *_c);
void finish(int r);
};
struct C_aio_Safe : public Context {
AioCompletionImpl *c;
- C_aio_Safe(AioCompletionImpl *_c);
+ explicit C_aio_Safe(AioCompletionImpl *_c);
void finish(int r);
};
PoolAsyncCompletionImpl *c;
public:
- C_PoolAsync_Safe(PoolAsyncCompletionImpl *_c) : c(_c) {
+ explicit C_PoolAsync_Safe(PoolAsyncCompletionImpl *_c) : c(_c) {
c->get();
}
~C_PoolAsync_Safe() {
public:
Finisher finisher;
- RadosClient(CephContext *cct_);
+ explicit RadosClient(CephContext *cct_);
~RadosClient();
int ping_monitor(string mon_id, string *result);
int connect();
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;
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();
}
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();
}
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();
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) {
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();
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();
class FlushCacheCommand : public LibrbdAdminSocketCommand {
public:
- FlushCacheCommand(ImageCtx *ictx) : ictx(ictx) {}
+ explicit FlushCacheCommand(ImageCtx *ictx) : ictx(ictx) {}
bool call(stringstream *ss) {
int r = flush(ictx);
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);
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 {
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 {
}
struct CopyProgressCtx {
- CopyProgressCtx(ProgressContext &p)
+ explicit CopyProgressCtx(ProgressContext &p)
: destictx(NULL), src_size(0), prog_ctx(p)
{ }
class EncodeEventVisitor : public boost::static_visitor<void> {
public:
- EncodeEventVisitor(bufferlist &bl) : m_bl(bl) {
+ explicit EncodeEventVisitor(bufferlist &bl) : m_bl(bl) {
}
template <typename Event>
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 {
void _log_message(const char *s, bool crash);
public:
- Log(SubsystemMap *s);
+ explicit Log(SubsystemMap *s);
virtual ~Log();
void set_flush_on_exit();
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;
MDSRank* get_mds() {return dir->cache->mds;}
public:
- CDirContext(CDir *d) : dir(d) {
+ explicit CDirContext(CDir *d) : dir(d) {
assert(dir != NULL);
}
};
MDSRank* get_mds() {return dir->cache->mds;}
public:
- CDirIOContext(CDir *d) : dir(d) {
+ explicit CDirIOContext(CDir *d) : dir(d) {
assert(dir != NULL);
}
};
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());
}
CInode *in;
MDSRank *get_mds() {return in->mdcache->mds;}
public:
- CInodeIOContext(CInode *in_) : in(in_) {
+ explicit CInodeIOContext(CInode *in_) : in(in_) {
assert(in != NULL);
}
};
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);
}
public:
- LockerContext(Locker *locker_) : locker(locker_) {
+ explicit LockerContext(Locker *locker_) : locker(locker_) {
assert(locker != NULL);
}
};
public:
LogSegment *_segment;
- LogEvent(int t)
+ explicit LogEvent(int t)
: _type(t), _start_off(0), _segment(0) { }
virtual ~LogEvent() { }
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();
}
return mdcache->mds;
}
public:
- MDCacheContext(MDCache *mdc_) : mdcache(mdc_) {}
+ explicit MDCacheContext(MDCache *mdc_) : mdcache(mdc_) {}
};
return mdcache->mds;
}
public:
- MDCacheIOContext(MDCache *mdc_) : mdcache(mdc_) {}
+ explicit MDCacheIOContext(MDCache *mdc_) : mdcache(mdc_) {}
};
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();
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();
}
}
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();
}
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();
}
Migrator *migrator;
public:
- MDCache(MDSRank *m);
+ explicit MDCache(MDSRank *m);
~MDCache();
// debug
}
public:
- C_MDL_WriteError(MDLog *m) : mdlog(m) {}
+ explicit C_MDL_WriteError(MDLog *m) : mdlog(m) {}
};
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;
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;
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;
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),
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();
}
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();
virtual MDSRank* get_mds();
public:
- MDSInternalContext(MDSRank *mds_) : mds(mds_) {
+ explicit MDSInternalContext(MDSRank *mds_) : mds(mds_) {
assert(mds != NULL);
}
};
virtual MDSRank* get_mds();
public:
- MDSIOContext(MDSRank *mds_) : mds(mds_) {
+ explicit MDSIOContext(MDSRank *mds_) : mds(mds_) {
assert(mds != NULL);
}
};
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;
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
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
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());
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();
MDSRank *mds;
Cond cond;
public:
- ProgressThread(MDSRank *mds_) : mds(mds_) {}
+ explicit ProgressThread(MDSRank *mds_) : mds(mds_) {}
void * entry();
void shutdown();
void signal() {cond.Signal();}
MDSTable *ida;
MDSRank *get_mds() {return ida->mds;}
public:
- MDSTableIOContext(MDSTable *ida_) : ida(ida_) {
+ explicit MDSTableIOContext(MDSTable *ida_) : ida(ida_) {
assert(ida != NULL);
}
};
return mig->mds;
}
public:
- MigratorContext(Migrator *mig_) : mig(mig_) {
+ explicit MigratorContext(Migrator *mig_) : mig(mig_) {
assert(mig != NULL);
}
};
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;}
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)
{}
}
public:
- ServerContext(Server *s) : server(s) {
+ explicit ServerContext(Server *s) : server(s) {
assert(server != NULL);
}
};
server->terminating_sessions = false;
}
public:
- C_MDS_TerminatedSessions(Server *s) : ServerContext(s) {}
+ explicit C_MDS_TerminatedSessions(Server *s) : ServerContext(s) {}
};
void Server::terminate_sessions()
public:
bool terminating_sessions;
- Server(MDSRank *m);
+ explicit Server(MDSRank *m);
~Server() {
g_ceph_context->get_perfcounters_collection()->remove(logger);
delete logger;
SessionMap *sessionmap;
MDSRank *get_mds() {return sessionmap->mds;}
public:
- SessionMapIOContext(SessionMap *sessionmap_) : sessionmap(sessionmap_) {
+ explicit SessionMapIOContext(SessionMap *sessionmap_) : sessionmap(sessionmap_) {
assert(sessionmap != NULL);
}
};
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);
}
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)
{ }
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:
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) {}
return sm->mds;
}
public:
- StrayManagerIOContext(StrayManager *sm_) : sm(sm_) {}
+ explicit StrayManagerIOContext(StrayManager *sm_) : sm(sm_) {}
};
return sm->mds;
}
public:
- StrayManagerContext(StrayManager *sm_) : sm(sm_) {}
+ explicit StrayManagerContext(StrayManager *sm_) : sm(sm_) {}
};
// 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);
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 {
old_inodes = *oi;
snapbl = sbl;
}
- fullbit(bufferlist::iterator &p) {
+ explicit fullbit(bufferlist::iterator &p) {
decode(p);
}
fullbit() {}
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) {}
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;
// 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) {
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);
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 {
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
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
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
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)
{}
// 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);
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:
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();
}
*
* @param m A Monitor instance
*/
- Elector(Monitor *m) : mon(m),
+ explicit Elector(Monitor *m) : mon(m),
expire_event(0),
epoch(0),
participating(true),
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;
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();
}
RotatingKeyRing *rotating_secrets;
public:
- MonClient(CephContext *cct_);
+ explicit MonClient(CephContext *cct_);
~MonClient();
int init();
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)
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;
// 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");
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();
}
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();
}
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();
}
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();
}
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);
}
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;
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;
return db->get_estimated_size(extras);
}
- MonitorDBStore(const string& path)
+ explicit MonitorDBStore(const string& path)
: db(0),
do_dump(false),
dump_fd_binary(-1),
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);
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() { }
};
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);
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;
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;
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;
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;
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;
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;
}
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();
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)
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)
{
MonOpRequestRef op;
- C_MonOp(MonOpRequestRef o) :
+ explicit C_MonOp(MonOpRequestRef o) :
op(o) { }
void finish(int r) {
class Dispatcher {
public:
- Dispatcher(CephContext *cct_)
+ explicit Dispatcher(CephContext *cct_)
: cct(cct_)
{
}
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; }
};
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);
}
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();
}
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();
}
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();
}
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;
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();
}
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();
};
friend class C_barrier;
public:
- WorkerPool(CephContext *c);
+ explicit WorkerPool(CephContext *c);
virtual ~WorkerPool();
void start();
Worker *get_worker() {
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();
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"),
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);
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);
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);
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);
// 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
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;
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;
class DispatchThread : public Thread {
DispatchQueue *dq;
public:
- DispatchThread(DispatchQueue *dq) : dq(dq) {}
+ explicit DispatchThread(DispatchQueue *dq) : dq(dq) {}
void *entry() {
dq->entry();
return 0;
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;
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;
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;
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),
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;
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);
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();
uint32_t flags;
- CState(XioConnection* _xcon)
+ explicit CState(XioConnection* _xcon)
: xcon(_xcon),
protocol_version(0),
session_state(INIT),
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;
__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();
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 */
char payload[MB];
} *first;
- XioPool(struct xio_mempool *_handle) :
+ explicit XioPool(struct xio_mempool *_handle) :
handle(_handle), first(0)
{
}
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),
class FuseThread : public Thread {
FuseStore *fs;
public:
- FuseThread(FuseStore *f) : fs(f) {}
+ explicit FuseThread(FuseStore *f) : fs(f) {}
void *entry() {
fs->loop();
return NULL;
string name;
Sequencer_implRef p;
- Sequencer(string n)
+ explicit Sequencer(string n)
: name(n), p(NULL) {}
~Sequencer() {
}
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;
}
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);
}
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()),
}
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
atomic_t num_reading;
atomic_t num_waiting;
- IOContext(void *p)
+ explicit IOContext(void *p)
: priv(p),
lock("IOContext::lock")
{}
struct AioCompletionThread : public Thread {
BlockDevice *bdev;
- AioCompletionThread(BlockDevice *b) : bdev(b) {}
+ explicit AioCompletionThread(BlockDevice *b) : bdev(b) {}
void *entry() {
bdev->_aio_thread();
return NULL;
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) {}
struct FileLock {
FileRef file;
- FileLock(FileRef f) : file(f) {}
+ explicit FileLock(FileRef f) : file(f) {}
};
private:
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() {
rocksdb::Status GetAbsolutePath(const std::string& db_path,
std::string* output_path);
- BlueRocksEnv(BlueFS *f);
+ explicit BlueRocksEnv(BlueFS *f);
private:
BlueFS *fs;
};
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)) {
CollectionRef first_collection; ///< first referenced collection
- TransContext(OpSequencer *o)
+ explicit TransContext(OpSequencer *o)
: state(STATE_PREPARE),
osr(o),
ops(0),
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;
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);
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";
/// 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()) {}
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))
}
};
- 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(
__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);
class RemoveOnDelete {
public:
DBObjectMap *db;
- RemoveOnDelete(DBObjectMap *db) :
+ explicit RemoveOnDelete(DBObjectMap *db) :
db(db) {}
void operator() (_Header *header) {
Mutex::Locker l(db->header_lock);
class FD {
public:
const int fd;
- FD(int _fd) : fd(_fd) {
+ explicit FD(int _fd) : fd(_fd) {
assert(_fd >= 0);
}
int operator*() const {
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);
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;
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;
class SyncEntryTimeout : public Context {
public:
- SyncEntryTimeout(int commit_timeo)
+ explicit SyncEntryTimeout(int commit_timeo)
: m_commit_timeo(commit_timeo)
{
}
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;
}
}
- OpSequencer(int i)
+ explicit OpSequencer(int i)
: qlock("FileStore::OpSequencer::qlock", false, false),
parent(0),
apply_lock("FileStore::OpSequencer::apply_lock", false, false),
}
public:
- FileStoreBackend(FileStore *fs) : filestore(fs) {}
+ explicit FileStoreBackend(FileStore *fs) : filestore(fs) {}
virtual ~FileStoreBackend() {}
static FileStoreBackend *create(long f_type, FileStore *fs);
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() {
InProgressOp(int op, const vector<string> &path)
: op(op), path(path) {}
- InProgressOp(bufferlist::iterator &bl) {
+ explicit InProgressOp(bufferlist::iterator &bl) {
decode(bl);
}
CollectionIndex *index;
Index() : index(NULL) {}
- Index(CollectionIndex* index) : index(index) {}
+ explicit Index(CollectionIndex* index) : index(index) {}
CollectionIndex *operator->() { return index; }
CollectionIndex &operator*() { return *index; }
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();
}
public:
- JournalingObjectStore(const std::string& path)
+ explicit JournalingObjectStore(const std::string& path)
: ObjectStore(path),
journal(NULL),
finisher(g_ceph_context, "JournalObjectStore", "fn_jrn_objstore"),
// 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));
}
}
public:
- WBThrottle(CephContext *cct);
+ explicit WBThrottle(CephContext *cct);
~WBThrottle();
void start();
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";
bool m_filestore_zfs_snap;
int update_current_zh();
public:
- ZFSFileStoreBackend(FileStore *fs);
+ explicit ZFSFileStoreBackend(FileStore *fs);
~ZFSFileStoreBackend();
int detect_features();
bool can_checkpoint();
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) {
}
CollectionRef first_collection; ///< first referenced collection
- TransContext(OpSequencer *o)
+ explicit TransContext(OpSequencer *o)
: state(STATE_PREPARE),
osr(o),
ops(0),
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;
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);
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; }
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) {}
};
}
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() {
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();
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;
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);
}
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);
}
};
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;
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);
};
Params() {}
- Params(Impl *i) : impl(i) {}
+ explicit Params(Impl *i) : impl(i) {}
virtual ~Params() {}
boost::scoped_ptr<Params::Impl> impl;
};
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;
};
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) {}
};
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) {}
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)
{}
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();
}
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;
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);
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) {
}
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";
}
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";
}
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;
}
#endif
- OSDService(OSD *osd);
+ explicit OSDService(OSD *osd);
~OSDService();
};
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();
}
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();
}
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"),
/// 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;
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;
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);
}
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;
}
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 {
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();
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);
}
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);
}
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,
hobject_t begin;
hobject_t end;
- BackfillInterval(bool bitwise=true)
+ explicit BackfillInterval(bool bitwise=true)
: objects(hobject_t::Comparator(bitwise)),
sort_bitwise(bitwise)
{}
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";
}
};
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;
};
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 {
/* 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 <
};
struct Reset : boost::statechart::state< Reset, RecoveryMachine >, NamedState {
- Reset(my_context ctx);
+ explicit Reset(my_context ctx);
void exit();
typedef boost::mpl::list <
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 <
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 <
};
struct Primary : boost::statechart::state< Primary, Started, Peering >, NamedState {
- Primary(my_context ctx);
+ explicit Primary(my_context ctx);
void exit();
typedef boost::mpl::list <
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&);
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 <
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;
typedef boost::mpl::list<
boost::statechart::transition< DoRecovery, WaitLocalRecoveryReserved >
> reactions;
- Clean(my_context ctx);
+ explicit Clean(my_context ctx);
void exit();
};
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());
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();
};
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);
typedef boost::mpl::list<
boost::statechart::transition< LocalBackfillReserved, WaitRemoteBackfillReserved >
> reactions;
- WaitLocalBackfillReserved(my_context ctx);
+ explicit WaitLocalBackfillReserved(my_context ctx);
void exit();
};
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);
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 <
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();
};
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);
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);
};
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();
};
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);
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();
};
typedef boost::mpl::list <
boost::statechart::transition< LocalRecoveryReserved, WaitRemoteRecoveryReserved >
> reactions;
- WaitLocalRecoveryReserved(my_context ctx);
+ explicit WaitLocalRecoveryReserved(my_context ctx);
void exit();
};
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 <
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();
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 <
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 <
};
struct WaitUpThru : boost::statechart::state< WaitUpThru, Peering >, NamedState {
- WaitUpThru(my_context ctx);
+ explicit WaitUpThru(my_context ctx);
void exit();
typedef boost::mpl::list <
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();
boost::optional<RecoveryCtx> rctx;
public:
- RecoveryState(PG *pg)
+ explicit RecoveryState(PG *pg)
: machine(this, pg), pg(pg), orig_ctx(0) {
machine.initiate();
}
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);
}
ReplicatedPG::CopyResults *results;
int retval;
ReplicatedPG::OpContext *ctx;
- CopyFromCallback(ReplicatedPG::OpContext *ctx_)
+ explicit CopyFromCallback(ReplicatedPG::OpContext *ctx_)
: results(NULL),
retval(0),
ctx(ctx_) {}
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);
}
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) {
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();
}
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);
};
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();
};
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();
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);
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&);
};
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&);
};
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&);
};
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 {
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();
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;
}
WatchRef watch;
public:
bool canceled;
- HandleDelayedWatchTimeout(WatchRef watch) : watch(watch), canceled(false) {}
+ explicit HandleDelayedWatchTimeout(WatchRef watch) : watch(watch), canceled(false) {}
void cancel() {
canceled = true;
}
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);
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");
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;
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;
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 {
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);
}
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) {
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) { }
};
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);
}
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);
}
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());
map<loff_t, list<Context*> > waitfor_read;
// cons
- BufferHead(Object *o) :
+ explicit BufferHead(Object *o) :
state(STATE_MISSING),
ref(0),
dontneed(false),
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;
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);
};
class EncodeVisitor : public boost::static_visitor<void> {
public:
- EncodeVisitor(bufferlist &bl) : m_bl(bl) {
+ explicit EncodeVisitor(bufferlist &bl) : m_bl(bl) {
}
template <typename Action>
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 {
class Replayer {
public:
- Replayer(int num_action_trackers);
+ explicit Replayer(int num_action_trackers);
~Replayer();
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 {
class AioReadAction : public TypedAction<action::AioReadAction> {
public:
- AioReadAction(const action::AioReadAction &action)
+ explicit AioReadAction(const action::AioReadAction &action)
: TypedAction<action::AioReadAction>(action) {
}
class ReadAction : public TypedAction<action::ReadAction> {
public:
- ReadAction(const action::ReadAction &action)
+ explicit ReadAction(const action::ReadAction &action)
: TypedAction<action::ReadAction>(action) {
}
class AioWriteAction : public TypedAction<action::AioWriteAction> {
public:
- AioWriteAction(const action::AioWriteAction &action)
+ explicit AioWriteAction(const action::AioWriteAction &action)
: TypedAction<action::AioWriteAction>(action) {
}
class WriteAction : public TypedAction<action::WriteAction> {
public:
- WriteAction(const action::WriteAction &action)
+ explicit WriteAction(const action::WriteAction &action)
: TypedAction<action::WriteAction>(action) {
}
class OpenImageAction : public TypedAction<action::OpenImageAction> {
public:
- OpenImageAction(const action::OpenImageAction &action)
+ explicit OpenImageAction(const action::OpenImageAction &action)
: TypedAction<action::OpenImageAction>(action) {
}
class CloseImageAction : public TypedAction<action::CloseImageAction> {
public:
- CloseImageAction(const action::CloseImageAction &action)
+ explicit CloseImageAction(const action::CloseImageAction &action)
: TypedAction<action::CloseImageAction>(action) {
}
class AioOpenImageAction : public TypedAction<action::AioOpenImageAction> {
public:
- AioOpenImageAction(const action::AioOpenImageAction &action)
+ explicit AioOpenImageAction(const action::AioOpenImageAction &action)
: TypedAction<action::AioOpenImageAction>(action) {
}
class AioCloseImageAction : public TypedAction<action::AioCloseImageAction> {
public:
- AioCloseImageAction(const action::AioCloseImageAction &action)
+ explicit AioCloseImageAction(const action::AioCloseImageAction &action)
: TypedAction<action::AioCloseImageAction>(action) {
}
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) {
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() {}
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);
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);
XMLObj *alloc_obj(const char *el);
public:
- RGWACLXMLParser_S3(CephContext *_cct) : cct(_cct) {}
+ explicit RGWACLXMLParser_S3(CephContext *_cct) : cct(_cct) {}
};
#endif
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);
class StoreDestructor {
RGWRados *store;
public:
- StoreDestructor(RGWRados *_s) : store(_s) {}
+ explicit StoreDestructor(RGWRados *_s) : store(_s) {}
~StoreDestructor() {
RGWStoreManager::close_storage(store);
}
* 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)) {
}
string name;
string val;
public:
- NameVal(string nv) : str(nv) {}
+ explicit NameVal(string nv) : str(nv) {}
int parse();
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);
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*/
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();
};
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) {};
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() {
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));
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();
};
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();
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() {}
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)
class RGWProcessControlThread : public Thread {
RGWProcess *pprocess;
public:
- RGWProcessControlThread(RGWProcess *_pprocess) : pprocess(_pprocess) {}
+ explicit RGWProcessControlThread(RGWProcess *_pprocess) : pprocess(_pprocess) {}
void *entry() {
pprocess->run();
struct LogStatusDump {
RGWMDLogStatus status;
- LogStatusDump(RGWMDLogStatus _status) : status(_status) {}
+ explicit LogStatusDump(RGWMDLogStatus _status) : status(_status) {}
void dump(Formatter *f) const {
string s;
switch (status) {
RGWRados *store;
public:
- StoreDestructor(RGWRados *_s) : store(_s) {}
+ explicit StoreDestructor(RGWRados *_s) : store(_s) {}
~StoreDestructor() {
if (store) {
RGWStoreManager::close_storage(store);
atomic_t down_flag;
public:
- RGWObjectExpirer(RGWRados *_store)
+ explicit RGWObjectExpirer(RGWRados *_store)
: store(_store)
{}
{
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) {
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 {
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; }
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) {
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();
}
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"),
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) {
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);
}
obj_iterator() : manifest(NULL) {
init();
}
- obj_iterator(RGWObjManifest *_m) : manifest(_m) {
+ explicit obj_iterator(RGWObjManifest *_m) : manifest(_m) {
init();
if (!manifest->empty()) {
seek(0);
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);
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) {
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) {
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);
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();
}
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);
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);
};
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);
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);
DeleteResult() : delete_marker(false) {}
} result;
- Delete(RGWRados::Object *_target) : target(_target) {}
+ explicit Delete(RGWRados::Object *_target) : target(_target) {}
int delete_obj();
};
} state;
- Stat(RGWRados::Object *_source) : source(_source) {}
+ explicit Stat(RGWRados::Object *_source) : source(_source) {}
int stat_async();
int wait();
} 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() {
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,
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);
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 */
};
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,
}
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);
}
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);
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);
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 {
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() {
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);
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);
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);
struct err {
string message;
- err(const string& m) : message(m) {}
+ explicit err(const string& m) : message(m) {}
};
class XMLParser : public RGWXMLParser {
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");
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() {
* keep it in mind.
*/
- WholeSpaceSnapshotMemIterator(KeyValueDBMemory *db) :
+ explicit WholeSpaceSnapshotMemIterator(KeyValueDBMemory *db) :
WholeSpaceMemIterator(db) { }
~WholeSpaceSnapshotMemIterator() {
delete db;
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) {
list<Context *> on_commit;
KeyValueDBMemory *db;
- TransactionImpl_(KeyValueDBMemory *db) : db(db) {}
+ explicit TransactionImpl_(KeyValueDBMemory *db) : db(db) {}
struct SetOp : public Context {
class TestContext : public Context
{
public:
- TestContext(int num_)
+ explicit TestContext(int num_)
: num(num_)
{
}
class StrictOrderTestContext : public TestContext
{
public:
- StrictOrderTestContext (int num_)
+ explicit StrictOrderTestContext (int num_)
: TestContext(num_)
{
}
class AdminSocketTest
{
public:
- AdminSocketTest(AdminSocket *asokc)
+ explicit AdminSocketTest(AdminSocket *asokc)
: m_asokc(asokc)
{
}
template<typename T>
struct C_Holder : public Context {
T obj;
- C_Holder(
+ explicit C_Holder(
T obj)
: obj(obj) {}
void finish(int r) {
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();
}
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;
}
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;
class RadosBackend : public Backend {
librados::IoCtx *ioctx;
public:
- RadosBackend(
+ explicit RadosBackend(
librados::IoCtx *ioctx)
: ioctx(ioctx) {}
void write(
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,
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");
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";
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);
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();
seeds[0] = 0;
}
- ObjectContents(bufferlist::iterator &bp) {
+ explicit ObjectContents(bufferlist::iterator &bp) {
::decode(_size, bp);
::decode(seeds, bp);
::decode(written, bp);
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);
class Item : public LRUObject {
public:
int id;
- Item(int v) : id(v) {}
+ explicit Item(int v) : id(v) {}
};
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;
class CompressorPluginExample : public CompressionPlugin {
public:
- CompressorPluginExample(CephContext* cct) : CompressionPlugin(cct)
+ explicit CompressorPluginExample(CephContext* cct) : CompressionPlugin(cct)
{}
virtual int factory(CompressorRef *cs,
default_ctor++;
}
- ConstructorCounter(const T& data_)
+ explicit ConstructorCounter(const T& data_)
: data(data_)
{
one_arg_ctor++;
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;
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;
Messenger *messenger;
uint64_t dcount;
public:
- SimpleDispatcher(Messenger *msgr);
+ explicit SimpleDispatcher(Messenger *msgr);
virtual ~SimpleDispatcher();
uint64_t get_dcount() { return dcount; }
Messenger *messenger;
uint64_t dcount;
public:
- XioDispatcher(Messenger *msgr);
+ explicit XioDispatcher(Messenger *msgr);
virtual ~XioDispatcher();
uint64_t get_dcount() { return dcount; }
public:
- MonClientHelper(CephContext *cct_)
+ explicit MonClientHelper(CephContext *cct_)
: Dispatcher(cct_),
cct(cct_),
monc(cct_),
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) {
}
public:
- ClientStub(CephContext *cct)
+ explicit ClientStub(CephContext *cct)
: TestStub(cct, "client"),
gen((int) time(NULL))
{ }
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__
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() {
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; }
};
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; }
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 {
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);
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);
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);
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() {
void do_stats();
public:
- WorkloadGenerator(vector<const char*> args);
+ explicit WorkloadGenerator(vector<const char*> args);
~WorkloadGenerator() {
m_store->umount();
}
WorkloadGenerator *wrkldgen_state;
public:
- C_OnReadable(WorkloadGenerator *state)
+ explicit C_OnReadable(WorkloadGenerator *state)
:TestObjectStoreState::C_OnFinished(state), wrkldgen_state(state) { }
void finish(int r)
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) {
class Th : public Thread {
public:
bufferlist bl;
- Th(bufferlist& o) : bl(o) { }
+ explicit Th(bufferlist& o) : bl(o) { }
void *entry() {
//cout << "start" << endl;
class RandWrap {
public:
unsigned int state;
- RandWrap(unsigned int seed)
+ explicit RandWrap(unsigned int seed)
{
state = seed;
}
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();
*/
struct CallbackInfo {
uint64_t id;
- CallbackInfo(uint64_t id) : id(id) {}
+ explicit CallbackInfo(uint64_t id) : id(id) {}
virtual ~CallbackInfo() {};
};
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) {}
public:
HitSet *hitset;
- HitSetTestStrap(HitSet *h) : hitset(h) {}
+ explicit HitSetTestStrap(HitSet *h) : hitset(h) {}
void fill(unsigned count) {
char buf[50];
public:
ObjectContext &obc;
- Thread_read_lock(ObjectContext& _obc) :
+ explicit Thread_read_lock(ObjectContext& _obc) :
obc(_obc)
{
}
public:
ObjectContext &obc;
- Thread_write_lock(ObjectContext& _obc) :
+ explicit Thread_write_lock(ObjectContext& _obc) :
obc(_obc)
{
}
class Consumer : public Thread {
CondPingPong *p;
public:
- Consumer(CondPingPong *p): p(p) {}
+ explicit Consumer(CondPingPong *p): p(p) {}
void* entry() {
p->consume();
return 0;
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() {
atomic_t *count;
public:
- CountEvent(atomic_t *atomic): count(atomic) {}
+ explicit CountEvent(atomic_t *atomic): count(atomic) {}
void do_request(int id) {
count->dec();
}
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;
};
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();
};
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();
};
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);
}
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) {
struct WatcherUnwatcher : public Thread {
string pool;
- WatcherUnwatcher(string& _pool) : pool(_pool) {}
+ explicit WatcherUnwatcher(string& _pool) : pool(_pool) {}
void *entry() {
Rados cluster;
xlist<Item*>::item xitem;
int val;
- Item(int v) :
+ explicit Item(int v) :
xitem(this),
val(v)
{}
// 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
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) {
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 {
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() { }
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);
}
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) {
class InoTableHandler : public TableHandler<InoTable>
{
public:
- InoTableHandler(mds_rank_t r)
+ explicit InoTableHandler(mds_rank_t r)
: TableHandler(r, "inotable", true)
{}
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);
};
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;
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;
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)
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() {}