From: Yan, Zheng Date: Sun, 31 Jan 2016 01:25:57 +0000 (+0800) Subject: encoding: don't encode/decode 'size_t' X-Git-Tag: ses5-milestone5~283^2~13 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7e319f1493b13659b59c599871d52c3431b7364f;p=ceph.git encoding: don't encode/decode 'size_t' encode/decode funtions for type 'size_t' on OSX are ambiguous Signed-off-by: Yan, Zheng --- diff --git a/src/common/obj_bencher.cc b/src/common/obj_bencher.cc index ce627e06f3ce..1ffa8ce60022 100644 --- a/src/common/obj_bencher.cc +++ b/src/common/obj_bencher.cc @@ -16,6 +16,7 @@ * it will just loop forever. */ #include "include/compat.h" +#include #include "common/Cond.h" #include "obj_bencher.h" @@ -217,7 +218,8 @@ void *ObjBencher::status_printer(void *_bencher) { int ObjBencher::aio_bench( int operation, int secondsToRun, - int concurrentios, size_t op_size, size_t object_size, + int concurrentios, + uint64_t op_size, uint64_t object_size, unsigned max_objects, bool cleanup, const std::string& run_name, bool no_verify) { @@ -234,7 +236,7 @@ int ObjBencher::aio_bench( //get data from previous write run, if available if (operation != OP_WRITE) { - size_t prev_op_size, prev_object_size; + uint64_t prev_op_size, prev_object_size; r = fetch_bench_metadata(run_name_meta, &prev_op_size, &prev_object_size, &num_objects, &prevPid); if (r < 0) { @@ -351,7 +353,7 @@ static T vec_stddev(vector& v) } int ObjBencher::fetch_bench_metadata(const std::string& metadata_file, - size_t *op_size, size_t* object_size, + uint64_t *op_size, uint64_t* object_size, int* num_objects, int* prevPid) { int r = 0; bufferlist object_data; @@ -1089,7 +1091,7 @@ int ObjBencher::rand_read_bench(int seconds_to_run, int num_objects, int concurr int ObjBencher::clean_up(const std::string& orig_prefix, int concurrentios, const std::string& run_name) { int r = 0; - size_t op_size, object_size; + uint64_t op_size, object_size; int num_objects; int prevPid; diff --git a/src/common/obj_bencher.h b/src/common/obj_bencher.h index e39e7df15731..fdc1994d4eeb 100644 --- a/src/common/obj_bencher.h +++ b/src/common/obj_bencher.h @@ -36,8 +36,8 @@ struct bench_history { struct bench_data { bool done; //is the benchmark is done - size_t object_size; //the size of the objects - size_t op_size; // the size of the read/write ops + uint64_t object_size; //the size of the objects + uint64_t op_size; // the size of the read/write ops // same as object_size for write tests int in_flight; //number of reads/writes being waited on int started; @@ -72,8 +72,8 @@ protected: struct bench_data data; - int fetch_bench_metadata(const std::string& metadata_file, size_t* op_size, - size_t* object_size, int* num_objects, int* prevPid); + int fetch_bench_metadata(const std::string& metadata_file, uint64_t* op_size, + uint64_t* object_size, int* num_objects, int* prevPid); int write_bench(int secondsToRun, int concurrentios, const string& run_name_meta, unsigned max_objects); int seq_read_bench(int secondsToRun, int num_objects, int concurrentios, int writePid, bool no_verify=false); @@ -109,7 +109,7 @@ public: virtual ~ObjBencher() {} int aio_bench( int operation, int secondsToRun, - int concurrentios, size_t op_size, size_t object_size, unsigned max_objects, + int concurrentios, uint64_t op_size, uint64_t object_size, unsigned max_objects, bool cleanup, const std::string& run_name, bool no_verify=false); int clean_up(const std::string& prefix, int concurrentios, const std::string& run_name); diff --git a/src/librbd/journal/Types.h b/src/librbd/journal/Types.h index a6b9613353f0..e53c6a98b076 100644 --- a/src/librbd/journal/Types.h +++ b/src/librbd/journal/Types.h @@ -43,11 +43,11 @@ struct AioDiscardEvent { static const EventType TYPE = EVENT_TYPE_AIO_DISCARD; uint64_t offset; - size_t length; + uint64_t length; AioDiscardEvent() : offset(0), length(0) { } - AioDiscardEvent(uint64_t _offset, size_t _length) + AioDiscardEvent(uint64_t _offset, uint64_t _length) : offset(_offset), length(_length) { } @@ -69,7 +69,7 @@ struct AioWriteEvent { AioWriteEvent() : offset(0), length(0) { } - AioWriteEvent(uint64_t _offset, size_t _length, const bufferlist &_data) + AioWriteEvent(uint64_t _offset, uint64_t _length, const bufferlist &_data) : offset(_offset), length(_length), data(_data) { } diff --git a/src/rgw/rgw_file.h b/src/rgw/rgw_file.h index 8442cc1d99e6..e820da375b4c 100644 --- a/src/rgw/rgw_file.h +++ b/src/rgw/rgw_file.h @@ -171,7 +171,7 @@ namespace rgw { struct State { uint64_t dev; - size_t size; + uint64_t size; uint64_t nlink; uint32_t owner_uid; /* XXX need Unix attr */ uint32_t owner_gid; /* XXX need Unix attr */