]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
encoding: don't encode/decode 'size_t'
authorYan, Zheng <zyan@redhat.com>
Sun, 31 Jan 2016 01:25:57 +0000 (09:25 +0800)
committerYan, Zheng <zyan@redhat.com>
Mon, 18 Jul 2016 03:08:48 +0000 (11:08 +0800)
encode/decode funtions for type 'size_t' on OSX are ambiguous

Signed-off-by: Yan, Zheng <zyan@redhat.com>
src/common/obj_bencher.cc
src/common/obj_bencher.h
src/librbd/journal/Types.h
src/rgw/rgw_file.h

index ce627e06f3ceb243b3f360dde5b50d8063c14a10..1ffa8ce60022518cdadcc983ed17285ff17dda95 100644 (file)
@@ -16,6 +16,7 @@
  * it will just loop forever.
  */
 #include "include/compat.h"
+#include <pthread.h>
 #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<T>& 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;
 
index e39e7df157316a7779e066d850d46fa72cf65771..fdc1994d4eebddfcda419b8de2a00b2e97fc2268 100644 (file)
@@ -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);
 
index a6b9613353f0492b70bd569fae3ba86a9a8322ca..e53c6a98b076d5a59a8903c5421741f66d572231 100644 (file)
@@ -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) {
   }
 
index 8442cc1d99e64b986f5ef3f629e3c0f774bca515..e820da375b4c456207226dcedb72ff1697fb8ee2 100644 (file)
@@ -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 */