diff options
author | Sage Weil <sage@inktank.com> | 2013-02-06 10:43:29 -0800 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-02-06 10:43:29 -0800 |
commit | f81e09525f14a5ceb55c6ad235e830445eadeb1e (patch) | |
tree | cf123c10d4ad260ad2a2bada8b2a5e242dc8fb42 | |
parent | 0aea4dba040b8caaeb5c4079728078541e5bb2c1 (diff) | |
parent | 3acc4d2cfee14ff15e178a4798eb46ef0024d0af (diff) | |
download | ceph-f81e09525f14a5ceb55c6ad235e830445eadeb1e.tar.gz |
Merge remote-tracking branch 'gh/wip-danny-cleanups'
Reviewed-by: Sage Weil <sage@inktank.com>
-rw-r--r-- | src/common/WorkQueue.h | 4 | ||||
-rw-r--r-- | src/common/ceph_crypto.cc | 1 | ||||
-rw-r--r-- | src/common/obj_bencher.cc | 13 | ||||
-rw-r--r-- | src/include/buffer.h | 8 | ||||
-rw-r--r-- | src/include/types.h | 2 | ||||
-rw-r--r-- | src/include/xlist.h | 6 | ||||
-rw-r--r-- | src/messages/MOSDRepScrub.h | 5 | ||||
-rw-r--r-- | src/msg/Message.h | 4 | ||||
-rw-r--r-- | src/rbd_fuse/rbd-fuse.c | 2 |
9 files changed, 25 insertions, 20 deletions
diff --git a/src/common/WorkQueue.h b/src/common/WorkQueue.h index 9fb215b9188..b19a6a20cb3 100644 --- a/src/common/WorkQueue.h +++ b/src/common/WorkQueue.h @@ -251,10 +251,10 @@ public: return (void *)_dequeue(); } void _void_process(void *p, TPHandle &handle) { - _process((T *)p, handle); + _process(static_cast<T *>(p), handle); } void _void_process_finish(void *p) { - _process_finish((T *)p); + _process_finish(static_cast<T *>(p)); } public: diff --git a/src/common/ceph_crypto.cc b/src/common/ceph_crypto.cc index 3f04349c20b..96fa157c9f5 100644 --- a/src/common/ceph_crypto.cc +++ b/src/common/ceph_crypto.cc @@ -20,7 +20,6 @@ #include <pthread.h> #include <stdlib.h> -void ceph::crypto::shutdown(); #ifdef USE_CRYPTOPP void ceph::crypto::init(CephContext *cct) diff --git a/src/common/obj_bencher.cc b/src/common/obj_bencher.cc index 74d54e16c90..d75612311ba 100644 --- a/src/common/obj_bencher.cc +++ b/src/common/obj_bencher.cc @@ -25,6 +25,7 @@ #include <stdlib.h> #include <time.h> #include <sstream> +#include <vector> const std::string BENCH_LASTRUN_METADATA = "benchmark_last_metadata"; @@ -305,11 +306,11 @@ int ObjBencher::write_bench(int secondsToRun, int concurrentios) { std::string prefix = generate_object_prefix(); out(cout) << "Object prefix: " << prefix << std::endl; - std::string name[concurrentios]; + std::vector<string> name(concurrentios); std::string newName; bufferlist* contents[concurrentios]; double total_latency = 0; - utime_t start_times[concurrentios]; + std::vector<utime_t> start_times(concurrentios); utime_t stopTime; int r = 0; bufferlist b_write; @@ -493,13 +494,13 @@ int ObjBencher::write_bench(int secondsToRun, int concurrentios) { int ObjBencher::seq_read_bench(int seconds_to_run, int num_objects, int concurrentios, int pid) { lock_cond lc(&lock); - std::string name[concurrentios]; + std::vector<string> name(concurrentios); std::string newName; bufferlist* contents[concurrentios]; int index[concurrentios]; int errors = 0; utime_t start_time; - utime_t start_times[concurrentios]; + std::vector<utime_t> start_times(concurrentios); utime_t time_to_run; time_to_run.set_from_double(seconds_to_run); double total_latency = 0; @@ -705,7 +706,7 @@ int ObjBencher::clean_up(const std::string& prefix, int concurrentios) { int ObjBencher::clean_up(int num_objects, int prevPid, int concurrentios) { lock_cond lc(&lock); - std::string name[concurrentios]; + std::vector<string> name(concurrentios); std::string newName; int r = 0; utime_t runtime; @@ -865,7 +866,7 @@ bool ObjBencher::more_objects_matching_prefix(const std::string& prefix, std::li int ObjBencher::clean_up_slow(const std::string& prefix, int concurrentios) { lock_cond lc(&lock); - std::string name[concurrentios]; + std::vector<string> name(concurrentios); std::string newName; int r = 0; utime_t runtime; diff --git a/src/include/buffer.h b/src/include/buffer.h index 9a635bdb5d0..4f87ed7453b 100644 --- a/src/include/buffer.h +++ b/src/include/buffer.h @@ -248,7 +248,7 @@ public: p(other.p), p_off(other.p_off) {} - iterator operator=(const iterator& other) { + iterator& operator=(const iterator& other) { if (this != &other) { bl = other.bl; ls = other.ls; @@ -305,8 +305,10 @@ public: list(const list& other) : _buffers(other._buffers), _len(other._len), last_p(this) { } list& operator= (const list& other) { - _buffers = other._buffers; - _len = other._len; + if (this != &other) { + _buffers = other._buffers; + _len = other._len; + } return *this; } diff --git a/src/include/types.h b/src/include/types.h index c783b6e93ce..dff47ac2b98 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -120,7 +120,7 @@ namespace __gnu_cxx { // -- io helpers -- template<class A, class B> -inline ostream& operator<<(ostream& out, const pair<A,B> v) { +inline ostream& operator<<(ostream& out, const pair<A,B>& v) { return out << v.first << "," << v.second; } diff --git a/src/include/xlist.h b/src/include/xlist.h index 5c2bf03f856..5384561327a 100644 --- a/src/include/xlist.h +++ b/src/include/xlist.h @@ -132,8 +132,8 @@ public: assert((bool)_front == (bool)_size); } - T front() { return (T)_front->_item; } - T back() { return (T)_back->_item; } + T front() { return static_cast<T>(_front->_item); } + T back() { return static_cast<T>(_back->_item); } void pop_front() { assert(!empty()); @@ -149,7 +149,7 @@ public: item *cur; public: iterator(item *i = 0) : cur(i) {} - T operator*() { return (T)cur->_item; } + T operator*() { return static_cast<T>(cur->_item); } iterator& operator++() { assert(cur); assert(cur->_list); diff --git a/src/messages/MOSDRepScrub.h b/src/messages/MOSDRepScrub.h index 2d3a66d96af..4fae008c17e 100644 --- a/src/messages/MOSDRepScrub.h +++ b/src/messages/MOSDRepScrub.h @@ -36,7 +36,10 @@ struct MOSDRepScrub : public Message { hobject_t end; // upper bound of scrub, exclusive bool deep; // true if scrub should be deep - MOSDRepScrub() : Message(MSG_OSD_REP_SCRUB, HEAD_VERSION, COMPAT_VERSION) { } + MOSDRepScrub() : Message(MSG_OSD_REP_SCRUB, HEAD_VERSION, COMPAT_VERSION), + chunky(false), + deep(false) { } + MOSDRepScrub(pg_t pgid, eversion_t scrub_from, eversion_t scrub_to, epoch_t map_epoch) : Message(MSG_OSD_REP_SCRUB, HEAD_VERSION, COMPAT_VERSION), diff --git a/src/msg/Message.h b/src/msg/Message.h index 5bdd4d463b6..5e2b4f58d3c 100644 --- a/src/msg/Message.h +++ b/src/msg/Message.h @@ -188,7 +188,7 @@ public: } Connection *get() { - return (Connection *)RefCountedObject::get(); + return static_cast<Connection *>(RefCountedObject::get()); } void set_priv(RefCountedObject *o) { @@ -329,7 +329,7 @@ public: } Message *get() { - return (Message *)RefCountedObject::get(); + return static_cast<Message *>(RefCountedObject::get()); } protected: diff --git a/src/rbd_fuse/rbd-fuse.c b/src/rbd_fuse/rbd-fuse.c index 0b28f63c3ad..5bdaba3a0d9 100644 --- a/src/rbd_fuse/rbd-fuse.c +++ b/src/rbd_fuse/rbd-fuse.c @@ -138,7 +138,7 @@ open_rbd_image(const char *image_name) return -1; // relies on caller to keep rbd_images up to date - for (im = rbd_images; im != NULL; i++, im = im->next) { + for (im = rbd_images; im != NULL; im = im->next) { if (strcmp(im->image_name, image_name) == 0) { break; } |