]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
* use stdint.h
authorsageweil <sageweil@29311d96-e01e-0410-9327-a35deaab8ce9>
Fri, 25 May 2007 19:41:14 +0000 (19:41 +0000)
committersageweil <sageweil@29311d96-e01e-0410-9327-a35deaab8ce9>
Fri, 25 May 2007 19:41:14 +0000 (19:41 +0000)
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1376 29311d96-e01e-0410-9327-a35deaab8ce9

24 files changed:
trunk/ceph/client/SyntheticClient.cc
trunk/ceph/common/LogType.h
trunk/ceph/ebofs/BlockDevice.cc
trunk/ceph/ebofs/Ebofs.cc
trunk/ceph/ebofs/types.h
trunk/ceph/include/buffer.h
trunk/ceph/include/frag.h
trunk/ceph/include/lru.h
trunk/ceph/include/object.h
trunk/ceph/include/types.h
trunk/ceph/mds/CDir.h
trunk/ceph/mds/Locker.cc
trunk/ceph/mds/mdstypes.h
trunk/ceph/messages/MClientReply.h
trunk/ceph/messages/MMDSCacheRejoin.h
trunk/ceph/messages/MOSDPGPeer.h
trunk/ceph/messages/MOSDPGPeerAck.h
trunk/ceph/messages/MOSDPGPeerRequest.h
trunk/ceph/msg/msg_types.h
trunk/ceph/osd/Ager.cc
trunk/ceph/osd/Ager.h
trunk/ceph/osd/FakeStore.cc
trunk/ceph/osd/osd_types.h
trunk/ceph/osdc/Filer.h

index d6adf65cbdcf7bbab63a9efc55bbd95fa14c6cc2..75fa44a3cbf29c189cb58d7ec290c60e8e593643 100644 (file)
@@ -627,7 +627,7 @@ int SyntheticClient::play_trace(Trace& t, string& prefix)
 
   const char *p = prefix.c_str();
 
-  map<__int64_t, __int64_t> open_files;
+  map<int64_t, int64_t> open_files;
 
   while (!t.end()) {
     
@@ -649,7 +649,7 @@ int SyntheticClient::play_trace(Trace& t, string& prefix)
       client->rename(a,b);      
     } else if (strcmp(op, "mkdir") == 0) {
       const char *a = t.get_string(p);
-      __int64_t b = t.get_int();
+      int64_t b = t.get_int();
       client->mkdir(a, b);
     } else if (strcmp(op, "rmdir") == 0) {
       const char *a = t.get_string(p);
@@ -668,24 +668,24 @@ int SyntheticClient::play_trace(Trace& t, string& prefix)
       client->lstat(a, &st);
     } else if (strcmp(op, "chmod") == 0) {
       const char *a = t.get_string(p);
-      __int64_t b = t.get_int();
+      int64_t b = t.get_int();
       client->chmod(a, b);
     } else if (strcmp(op, "chown") == 0) {
       const char *a = t.get_string(p);
-      __int64_t b = t.get_int();
-      __int64_t c = t.get_int();
+      int64_t b = t.get_int();
+      int64_t c = t.get_int();
       client->chown(a, b, c);
     } else if (strcmp(op, "utime") == 0) {
       const char *a = t.get_string(p);
-      __int64_t b = t.get_int();
-      __int64_t c = t.get_int();
+      int64_t b = t.get_int();
+      int64_t c = t.get_int();
       struct utimbuf u;
       u.actime = b;
       u.modtime = c;
       client->utime(a, &u);
     } else if (strcmp(op, "mknod") == 0) {
       const char *a = t.get_string(p);
-      __int64_t b = t.get_int();
+      int64_t b = t.get_int();
       client->mknod(a, b);
     } else if (strcmp(op, "getdir") == 0) {
       const char *a = t.get_string(p);
@@ -693,36 +693,36 @@ int SyntheticClient::play_trace(Trace& t, string& prefix)
       client->getdir(a, contents);
     } else if (strcmp(op, "open") == 0) {
       const char *a = t.get_string(p);
-      __int64_t b = t.get_int(); 
-      __int64_t id = t.get_int();
-      __int64_t fh = client->open(a, b);
+      int64_t b = t.get_int(); 
+      int64_t id = t.get_int();
+      int64_t fh = client->open(a, b);
       open_files[id] = fh;
     } else if (strcmp(op, "close") == 0) {
-      __int64_t id = t.get_int();
-      __int64_t fh = open_files[id];
+      int64_t id = t.get_int();
+      int64_t fh = open_files[id];
       if (fh > 0) client->close(fh);
       open_files.erase(id);
     } else if (strcmp(op, "truncate") == 0) {
       const char *a = t.get_string(p);
-      __int64_t b = t.get_int();
+      int64_t b = t.get_int();
       client->truncate(a,b);
     } else if (strcmp(op, "read") == 0) {
-      __int64_t id = t.get_int();
-      __int64_t fh = open_files[id];
+      int64_t id = t.get_int();
+      int64_t fh = open_files[id];
       int size = t.get_int();
       int off = t.get_int();
       char *buf = new char[size];
       client->read(fh, buf, size, off);
       delete[] buf;
     } else if (strcmp(op, "lseek") == 0) {
-      __int64_t id = t.get_int();
-      __int64_t fh = open_files[id];
+      int64_t id = t.get_int();
+      int64_t fh = open_files[id];
       int off = t.get_int();
       int whence = t.get_int();
       client->lseek(fh, off, whence);
     } else if (strcmp(op, "write") == 0) {
-      __int64_t id = t.get_int();
-      __int64_t fh = open_files[id];
+      int64_t id = t.get_int();
+      int64_t fh = open_files[id];
       int size = t.get_int();
       int off = t.get_int();
       char *buf = new char[size];
@@ -736,7 +736,7 @@ int SyntheticClient::play_trace(Trace& t, string& prefix)
   }
 
   // close open files
-  for (map<__int64_t, __int64_t>::iterator fi = open_files.begin();
+  for (map<int64_t, int64_t>::iterator fi = open_files.begin();
        fi != open_files.end();
        fi++) {
     dout(1) << "leftover close " << fi->second << endl;
@@ -1033,10 +1033,10 @@ int SyntheticClient::open_shared(int num, int count)
 
 int SyntheticClient::write_file(string& fn, int size, int wrsize)   // size is in MB, wrsize in bytes
 {
-  //__uint64_t wrsize = 1024*256;
+  //uint64_t wrsize = 1024*256;
   char *buf = new char[wrsize+100];   // 1 MB
   memset(buf, 7, wrsize);
-  __uint64_t chunks = (__uint64_t)size * (__uint64_t)(1024*1024) / (__uint64_t)wrsize;
+  uint64_t chunks = (uint64_t)size * (uint64_t)(1024*1024) / (uint64_t)wrsize;
 
   int fd = client->open(fn.c_str(), O_RDWR|O_CREAT);
   dout(5) << "writing to " << fn << " fd " << fd << endl;
@@ -1053,7 +1053,7 @@ int SyntheticClient::write_file(string& fn, int size, int wrsize)   // size is i
     // 64 bits : file offset
     // 64 bits : client id
     // = 128 bits (16 bytes)
-    __uint64_t *p = (__uint64_t*)buf;
+    uint64_t *p = (uint64_t*)buf;
     while ((char*)p < buf + wrsize) {
       *p = i*wrsize + (char*)p - buf;      
       p++;
@@ -1084,7 +1084,7 @@ int SyntheticClient::read_file(string& fn, int size, int rdsize)   // size is in
 {
   char *buf = new char[rdsize]; 
   memset(buf, 1, rdsize);
-  __uint64_t chunks = (__uint64_t)size * (__uint64_t)(1024*1024) / (__uint64_t)rdsize;
+  uint64_t chunks = (uint64_t)size * (uint64_t)(1024*1024) / (uint64_t)rdsize;
 
   int fd = client->open(fn.c_str(), O_RDONLY);
   dout(5) << "reading from " << fn << " fd " << fd << endl;
@@ -1101,11 +1101,11 @@ int SyntheticClient::read_file(string& fn, int size, int rdsize)   // size is in
 
     // verify fingerprint
     int bad = 0;
-    __int64_t *p = (__int64_t*)buf;
-    __int64_t readoff, readclient;
+    int64_t *p = (int64_t*)buf;
+    int64_t readoff, readclient;
     while ((char*)p + 32 < buf + rdsize) {
       readoff = *p;
-      __int64_t wantoff = i*rdsize + (__int64_t)((char*)p - buf);
+      int64_t wantoff = i*rdsize + (int64_t)((char*)p - buf);
       p++;
       readclient = *p;
       p++;
index 3de17751ec2f8394799018c9c0fe70a707acbf4a..67b47739fa8670cf5a476199abf58ca092dc8ba6 100644 (file)
@@ -29,7 +29,7 @@ using namespace __gnu_cxx;
 
 class LogType {
  protected:
-  hash_map<__uint64_t, int> keymap;  
+  hash_map<intptr_t, int> keymap;  
   vector<const char*>   keys;
   set<int>              inc_keys;
 
@@ -38,7 +38,7 @@ class LogType {
   // HACK to avoid the hash table as often as possible...
   // cache recent key name lookups in a small ring buffer
   const static int cache_keys = 10;
-  __uint64_t kc_ptr[cache_keys];
+  intptr_t kc_ptr[cache_keys];
   int kc_val[cache_keys];
   int kc_pos;
 
@@ -59,11 +59,7 @@ class LogType {
     i = keys.size();
     keys.push_back(key);
 
-#ifdef __LP64__
-    __uint64_t p = (__uint64_t)key;
-#else
-    __uint64_t p = (__uint32_t)key;
-#endif
+    intptr_t p = (intptr_t)key;
     keymap[p] = i;
     if (is_inc) inc_keys.insert(i);
 
@@ -82,11 +78,7 @@ class LogType {
   }
 
   int lookup_key(const char* key) {
-#ifdef __LP64__
-    __uint64_t p = (__uint64_t)key;
-#else
-    __uint64_t p = (__uint32_t)key;
-#endif
+    intptr_t p = (intptr_t)key;
 
     if (keymap.count(p)) 
       return keymap[p];
index 7044e4ca38f27521f7b96ae7d6e22c03a7b194f4..b38cfef49c04184a334143ed46ac4243691eadfb 100644 (file)
@@ -279,7 +279,7 @@ block_t BlockDevice::get_num_blocks()
       num_blocks = st.st_size;
     }
     
-    num_blocks /= (__uint64_t)EBOFS_BLOCK_SIZE;
+    num_blocks /= (uint64_t)EBOFS_BLOCK_SIZE;
 
     if (g_conf.bdev_fake_mb) {
       num_blocks = g_conf.bdev_fake_mb * 256;
@@ -699,7 +699,7 @@ int BlockDevice::open(kicker *idle)
   }
                
   // figure size
-  __uint64_t bsize = get_num_blocks();
+  uint64_t bsize = get_num_blocks();
   
   dout(2) << "open " << bsize << " bytes, " << num_blocks << " blocks" << endl;
   
index 2008d1961bfaed5cceb6b5335d3b91f3f5d07764..845f78ac9ae198168878bcb48b4dcd57c4c1f173 100644 (file)
@@ -3185,7 +3185,7 @@ void Ebofs::_get_frag_stat(FragmentationStat& st)
   st.num_free_extent = 0;
   st.avg_free_extent = 0;
 /*
-  __uint64_t tfree = 0;
+  uint64_t tfree = 0;
   for (int b=0; b<=EBOFS_NUM_FREE_BUCKETS; b++) {
     Table<block_t,block_t> *tab;
     if (b < EBOFS_NUM_FREE_BUCKETS) {
index 1b85d138ec342ce69b11137feaa8188b05bfbafd..eff08a4e681a83aca04c67a6c016cb3486a752d6 100644 (file)
@@ -61,7 +61,7 @@ namespace __gnu_cxx {
 
 
 // disk
-typedef __uint64_t block_t;        // disk location/sector/block
+typedef uint64_t block_t;        // disk location/sector/block
 
 static const int EBOFS_BLOCK_SIZE = 4096;
 static const int EBOFS_BLOCK_BITS = 12;    // 1<<12 == 4096
@@ -101,7 +101,7 @@ struct ebofs_nodepool {
 
 // objects
 
-typedef __uint64_t coll_t;
+typedef uint64_t coll_t;
 
 struct ebofs_onode {
   Extent     onode_loc;       /* this is actually the block we live in */
@@ -132,7 +132,7 @@ struct ebofs_table {
 
 
 // super
-typedef __uint64_t version_t;
+typedef uint64_t version_t;
 
 static const unsigned EBOFS_MAGIC = 0x000EB0F5;
 
index 111cb2a9816868442ec56bc6d9a0d862cab50ce1..56a54075c4da76495118dd7189c4688e66e3bc87 100644 (file)
@@ -14,6 +14,8 @@
 #ifndef __BUFFER_H
 #define __BUFFER_H
 
+#include <stdint.h>
+
 #include "common/Mutex.h"
 
 #include <iostream>
@@ -772,7 +774,7 @@ inline void _decoderaw(T& t, bufferlist& bl, int& off)
 template<class T>
 inline void _encode(const std::list<T>& ls, bufferlist& bl)
 {
-  __uint32_t n = ls.size();
+  uint32_t n = ls.size();
   _encoderaw(n, bl);
   for (typename std::list<T>::const_iterator p = ls.begin(); p != ls.end(); ++p)
     _encode(*p, bl);
@@ -780,7 +782,7 @@ inline void _encode(const std::list<T>& ls, bufferlist& bl)
 template<class T>
 inline void _decode(std::list<T>& ls, bufferlist& bl, int& off)
 {
-  __uint32_t n;
+  uint32_t n;
   _decoderaw(n, bl, off);
   ls.clear();
   while (n--) {
@@ -794,7 +796,7 @@ inline void _decode(std::list<T>& ls, bufferlist& bl, int& off)
 template<class T>
 inline void _encode(const std::deque<T>& ls, bufferlist& bl)
 {
-  __uint32_t n = ls.size();
+  uint32_t n = ls.size();
   _encoderaw(n, bl);
   for (typename std::deque<T>::const_iterator p = ls.begin(); p != ls.end(); ++p)
     _encode(*p, bl);
@@ -802,7 +804,7 @@ inline void _encode(const std::deque<T>& ls, bufferlist& bl)
 template<class T>
 inline void _decode(std::deque<T>& ls, bufferlist& bl, int& off)
 {
-  __uint32_t n;
+  uint32_t n;
   _decoderaw(n, bl, off);
   ls.clear();
   while (n--) {
@@ -816,7 +818,7 @@ inline void _decode(std::deque<T>& ls, bufferlist& bl, int& off)
 template<class T>
 inline void _encode(const std::set<T>& s, bufferlist& bl)
 {
-  __uint32_t n = s.size();
+  uint32_t n = s.size();
   _encoderaw(n, bl);
   for (typename std::set<T>::const_iterator p = s.begin(); p != s.end(); ++p)
     _encode(*p, bl);
@@ -824,7 +826,7 @@ inline void _encode(const std::set<T>& s, bufferlist& bl)
 template<class T>
 inline void _decode(std::set<T>& s, bufferlist& bl, int& off)
 {
-  __uint32_t n;
+  uint32_t n;
   _decoderaw(n, bl, off);
   s.clear();
   while (n--) {
@@ -838,7 +840,7 @@ inline void _decode(std::set<T>& s, bufferlist& bl, int& off)
 template<class T>
 inline void _encode(const std::vector<T>& v, bufferlist& bl)
 {
-  __uint32_t n = v.size();
+  uint32_t n = v.size();
   _encoderaw(n, bl);
   for (typename std::vector<T>::const_iterator p = v.begin(); p != v.end(); ++p)
     _encode(*p, bl);
@@ -846,10 +848,10 @@ inline void _encode(const std::vector<T>& v, bufferlist& bl)
 template<class T>
 inline void _decode(std::vector<T>& v, bufferlist& bl, int& off)
 {
-  __uint32_t n;
+  uint32_t n;
   _decoderaw(n, bl, off);
   v.resize(n);
-  for (__uint32_t i=0; i<n; i++) 
+  for (uint32_t i=0; i<n; i++) 
     _decode(v[i], bl, off);
 }
 
@@ -857,7 +859,7 @@ inline void _decode(std::vector<T>& v, bufferlist& bl, int& off)
 template<class T, class U>
 inline void _encode(const std::map<T,U>& m, bufferlist& bl)
 {
-  __uint32_t n = m.size();
+  uint32_t n = m.size();
   _encoderaw(n, bl);
   for (typename std::map<T,U>::const_iterator p = m.begin(); p != m.end(); ++p) {
     _encode(p->first, bl);
@@ -867,7 +869,7 @@ inline void _encode(const std::map<T,U>& m, bufferlist& bl)
 template<class T, class U>
 inline void _decode(std::map<T,U>& m, bufferlist& bl, int& off)
 {
-  __uint32_t n;
+  uint32_t n;
   _decoderaw(n, bl, off);
   m.clear();
   while (n--) {
@@ -881,7 +883,7 @@ inline void _decode(std::map<T,U>& m, bufferlist& bl, int& off)
 template<class T, class U>
 inline void _encode(const __gnu_cxx::hash_map<T,U>& m, bufferlist& bl)
 {
-  __uint32_t n = m.size();
+  uint32_t n = m.size();
   _encoderaw(n, bl);
   for (typename __gnu_cxx::hash_map<T,U>::const_iterator p = m.begin(); p != m.end(); ++p) {
     _encode(p->first, bl);
@@ -891,7 +893,7 @@ inline void _encode(const __gnu_cxx::hash_map<T,U>& m, bufferlist& bl)
 template<class T, class U>
 inline void _decode(__gnu_cxx::hash_map<T,U>& m, bufferlist& bl, int& off)
 {
-  __uint32_t n;
+  uint32_t n;
   _decoderaw(n, bl, off);
   m.clear();
   while (n--) {
@@ -904,13 +906,13 @@ inline void _decode(__gnu_cxx::hash_map<T,U>& m, bufferlist& bl, int& off)
 // string
 inline void _encode(const std::string& s, bufferlist& bl) 
 {
-  __uint32_t len = s.length();
+  uint32_t len = s.length();
   _encoderaw(len, bl);
   bl.append(s.c_str(), len+1);
 }
 inline void _decode(std::string& s, bufferlist& bl, int& off)
 {
-  __uint32_t len;
+  uint32_t len;
   _decoderaw(len, bl, off);
   s = bl.c_str() + off;    // FIXME someday to avoid a huge buffer copy?
   off += len+1;
@@ -919,13 +921,13 @@ inline void _decode(std::string& s, bufferlist& bl, int& off)
 // bufferptr (encapsulated)
 inline void _encode(bufferptr& bp, bufferlist& bl) 
 {
-  __uint32_t len = bp.length();
+  uint32_t len = bp.length();
   _encoderaw(len, bl);
   bl.append(bp);
 }
 inline void _decode(bufferptr& bp, bufferlist& bl, int& off)
 {
-  __uint32_t len;
+  uint32_t len;
   _decoderaw(len, bl, off);
 
   bufferlist s;
@@ -941,13 +943,13 @@ inline void _decode(bufferptr& bp, bufferlist& bl, int& off)
 // bufferlist (encapsulated)
 inline void _encode(const bufferlist& s, bufferlist& bl) 
 {
-  __uint32_t len = s.length();
+  uint32_t len = s.length();
   _encoderaw(len, bl);
   bl.append(s);
 }
 inline void _decode(bufferlist& s, bufferlist& bl, int& off)
 {
-  __uint32_t len;
+  uint32_t len;
   _decoderaw(len, bl, off);
   s.substr_of(bl, off, len);
   off += len;
index edca78806e45a50dd15fb67d74ad19393259cc55..b2ec6fd28a98ae01652904daa9752fc730d55e9b 100644 (file)
@@ -14,6 +14,7 @@
 #ifndef __FRAG_H
 #define __FRAG_H
 
+#include <stdint.h>
 #include <map>
 #include <list>
 #include "buffer.h"
@@ -51,7 +52,7 @@
  * we get 0/1 and 1/1.  quartering gives us 0/2, 1/2, 2/2, 3/2.  and so on.
  */
 
-typedef __uint32_t _frag_t;
+typedef uint32_t _frag_t;
 
 class frag_t {
   /* encoded value.
index 63096d0e3207980a9323d354abec7ea3ba112900..c9bf66211f22e9b377ce3f938eea8bfad2e97c5f 100644 (file)
@@ -16,6 +16,7 @@
 #ifndef __LRU_H
 #define __LRU_H
 
+#include <stdint.h>
 #include <assert.h>
 #include <iostream>
 using namespace std;
@@ -52,7 +53,7 @@ class LRUObject {
 class LRUList {
  private:
   LRUObject *head, *tail;
-  __uint32_t len;
+  uint32_t len;
 
  public:
   LRUList() {
@@ -60,7 +61,7 @@ class LRUList {
     len = 0;
   }
   
-  __uint32_t  get_length() { return len; }
+  uint32_t  get_length() { return len; }
 
   LRUObject *get_head() {
     return head;
@@ -116,8 +117,8 @@ class LRUList {
 class LRU {
  protected:
   LRUList lru_top, lru_bot, lru_pintail;
-  __uint32_t lru_num, lru_num_pinned;
-  __uint32_t lru_max;   // max items
+  uint32_t lru_num, lru_num_pinned;
+  uint32_t lru_max;   // max items
   double lru_midpoint;
 
   friend class LRUObject;
@@ -131,14 +132,14 @@ class LRU {
     lru_max = max;
   }
 
-  __uint32_t lru_get_size() { return lru_num; }
-  __uint32_t lru_get_top() { return lru_top.get_length(); }
-  __uint32_t lru_get_bot() { return lru_bot.get_length(); }
-  __uint32_t lru_get_pintail() { return lru_pintail.get_length(); }
-  __uint32_t lru_get_max() { return lru_max; }
-  __uint32_t lru_get_num_pinned() { return lru_num_pinned; }
+  uint32_t lru_get_size() { return lru_num; }
+  uint32_t lru_get_top() { return lru_top.get_length(); }
+  uint32_t lru_get_bot() { return lru_bot.get_length(); }
+  uint32_t lru_get_pintail() { return lru_pintail.get_length(); }
+  uint32_t lru_get_max() { return lru_max; }
+  uint32_t lru_get_num_pinned() { return lru_num_pinned; }
 
-  void lru_set_max(__uint32_t m) { lru_max = m; }
+  void lru_set_max(uint32_t m) { lru_max = m; }
   void lru_set_midpoint(float f) { lru_midpoint = f; }
   
 
index a225c8d245f62a7d0e8304872eebee46bd2bb5cf..b6b10db0cce35a4bdc4c7fe6ed0a8ff273add1ad 100644 (file)
@@ -14,6 +14,8 @@
 #ifndef __OBJECT_H
 #define __OBJECT_H
 
+#include <stdint.h>
+
 #include <iostream>
 #include <iomanip>
 using namespace std;
@@ -22,18 +24,18 @@ using namespace std;
 using namespace __gnu_cxx;
 
 
-typedef __uint32_t objectrev_t;
+typedef uint32_t objectrev_t;
 
 struct object_t {
-  static const __uint32_t MAXREV = 0xffffffffU;
+  static const uint32_t MAXREV = 0xffffffffU;
 
-  __uint64_t ino;  // "file" identifier
-  __uint32_t bno;  // "block" in that "file"
+  uint64_t ino;  // "file" identifier
+  uint32_t bno;  // "block" in that "file"
   objectrev_t rev; // revision.  normally ctime (as epoch).
 
   object_t() : ino(0), bno(0), rev(0) {}
-  object_t(__uint64_t i, __uint32_t b) : ino(i), bno(b), rev(0) {}
-  object_t(__uint64_t i, __uint32_t b, __uint32_t r) : ino(i), bno(b), rev(r) {}
+  object_t(uint64_t i, uint32_t b) : ino(i), bno(b), rev(0) {}
+  object_t(uint64_t i, uint32_t b, uint32_t r) : ino(i), bno(b), rev(r) {}
 };
 
 
@@ -79,9 +81,9 @@ inline ostream& operator<<(ostream& out, const object_t o) {
 
 namespace __gnu_cxx {
 #ifndef __LP64__
-  template<> struct hash<__uint64_t> {
-    size_t operator()(__uint64_t __x) const { 
-      static hash<__uint32_t> H;
+  template<> struct hash<uint64_t> {
+    size_t operator()(uint64_t __x) const { 
+      static hash<uint32_t> H;
       return H((__x >> 32) ^ (__x & 0xffffffff)); 
     }
   };
@@ -89,8 +91,8 @@ namespace __gnu_cxx {
 
   template<> struct hash<object_t> {
     size_t operator()(const object_t &r) const { 
-      static hash<__uint64_t>  H;
-      static hash<__uint32_t> I;
+      static hash<uint64_t> H;
+      static hash<uint32_t> I;
       return H(r.ino) ^ I(r.bno);
     }
   };
index b2368e153c19b0515f738672692c2bda4426a336..9cb4aeccdf102905202d48b44d93738fbf8f794c 100644 (file)
@@ -15,6 +15,7 @@
 #define __MDS_TYPES_H
 
 extern "C" {
+#include <stdint.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <assert.h>
@@ -28,6 +29,7 @@ extern "C" {
 #include <vector>
 #include <iostream>
 #include <iomanip>
+
 using namespace std;
 
 #include <ext/hash_map>
@@ -87,9 +89,9 @@ namespace __gnu_cxx {
   };
 
 #ifndef __LP64__
-  template<> struct hash<__int64_t> {
-    size_t operator()(__int64_t __x) const { 
-      static hash<__int32_t> H;
+  template<> struct hash<int64_t> {
+    size_t operator()(int64_t __x) const { 
+      static hash<int32_t> H;
       return H((__x >> 32) ^ (__x & 0xffffffff)); 
     }
   };
@@ -125,9 +127,9 @@ struct ltstr
 // ----------------------
 // some basic types
 
-typedef __uint64_t tid_t;         // transaction id
-typedef __uint64_t version_t;
-typedef __uint32_t epoch_t;       // map epoch  (32bits -> 13 epochs/second for 10 years)
+typedef uint64_t tid_t;         // transaction id
+typedef uint64_t version_t;
+typedef uint32_t epoch_t;       // map epoch  (32bits -> 13 epochs/second for 10 years)
 
 
 
@@ -189,7 +191,7 @@ struct FileLayout {
 
 // -- inode --
 
-typedef __uint64_t _inodeno_t;
+typedef uint64_t _inodeno_t;
 struct inodeno_t {
   _inodeno_t val;
   inodeno_t() : val(0) {}
@@ -207,7 +209,7 @@ namespace __gnu_cxx {
   {
     size_t operator()( const inodeno_t& x ) const
     {
-      static hash<__uint64_t> H;
+      static hash<uint64_t> H;
       return H(x.val);
     }
   };
index 7d538d2e8a5beefbb170f8b2cc4c41b93da98d24..2de0f913c2a226cc041e0fce847b3ae37993e364 100644 (file)
@@ -477,13 +477,13 @@ class CDirDiscover {
 class CDirExport {
   struct {
     dirfrag_t   dirfrag;
-    long        nden;   // num dentries (including null ones)
+    uint32_t    nden;   // num dentries (including null ones)
     version_t   version;
     version_t   committed_version;
-    unsigned    state;
+    uint32_t    state;
     meta_load_t popularity_justme;
     meta_load_t popularity_curdom;
-    int         dir_rep;
+    int32_t     dir_rep;
   } st;
   map<int,int> replicas;
   set<int>     rep_by;
@@ -512,7 +512,7 @@ class CDirExport {
   }
 
   dirfrag_t get_dirfrag() { return st.dirfrag; }
-  __uint64_t get_nden() { return st.nden; }
+  uint32_t get_nden() { return st.nden; }
 
   void update_dir(CDir *dir) {
     assert(dir->dirfrag() == st.dirfrag);
index 6248fd039ebe2d5311062144dcb191d1f531e23f..5836edf1e776b21cbb2c9c0fcad0efa5d740b0c4 100644 (file)
@@ -335,7 +335,7 @@ void Locker::xlock_finish(SimpleLock *lock, MDRequest *mdr)
 
 // file i/o -----------------------------------------
 
-__uint64_t Locker::issue_file_data_version(CInode *in)
+version_t Locker::issue_file_data_version(CInode *in)
 {
   dout(7) << "issue_file_data_version on " << *in << endl;
   return in->inode.file_data_version;
index 41b7f69e2e51bf641754c7517ac7acc485b2cd50..b69bb457c5dcd003bea6f7c7ff8e348196b8ef28 100644 (file)
@@ -78,7 +78,7 @@ inline bool operator>=(const metareqid_t& l, const metareqid_t& r) { return !(l
 namespace __gnu_cxx {
   template<> struct hash<metareqid_t> {
     size_t operator()(const metareqid_t &r) const { 
-      hash<__uint64_t> H;
+      hash<uint64_t> H;
       return H(r.client) ^ H(r.tid);
     }
   };
index 874cedbd8bb326a8a0d234e04486df31b0048e10..bf46663df7db0a4b9ae541b265eb2160bb5a2c28 100644 (file)
@@ -122,7 +122,7 @@ class MClientReply : public Message {
     int result;  // error code
     unsigned char file_caps;  // for open
     long          file_caps_seq;
-    __uint64_t file_data_version;  // for client buffercache consistency
+    uint64_t file_data_version;  // for client buffercache consistency
     
     int _num_trace_in;
     int _dir_size;
@@ -153,12 +153,12 @@ class MClientReply : public Message {
 
   unsigned char get_file_caps() { return st.file_caps; }
   long get_file_caps_seq() { return st.file_caps_seq; }
-  __uint64_t get_file_data_version() { return st.file_data_version; }
+  uint64_t get_file_data_version() { return st.file_data_version; }
   
   void set_result(int r) { st.result = r; }
   void set_file_caps(unsigned char c) { st.file_caps = c; }
   void set_file_caps_seq(long s) { st.file_caps_seq = s; }
-  void set_file_data_version(__uint64_t v) { st.file_data_version = v; }
+  void set_file_data_version(uint64_t v) { st.file_data_version = v; }
 
   MClientReply() {};
   MClientReply(MClientRequest *req, int result = 0) : 
index dc220aacece8494f46b35b07599724911124105e..0d14e9f03e532b2303e460ea8d8ee367a745bd34 100644 (file)
@@ -38,12 +38,12 @@ class MMDSCacheRejoin : public Message {
 
   // -- types --
   struct inode_strong { 
-    __int32_t caps_wanted;
-    __int32_t nonce;
-    __int32_t authlock;
-    __int32_t linklock;
-    __int32_t dirfragtreelock;
-    __int32_t filelock;
+    int32_t caps_wanted;
+    int32_t nonce;
+    int32_t authlock;
+    int32_t linklock;
+    int32_t dirfragtreelock;
+    int32_t filelock;
     inode_strong() {}
     inode_strong(int n, int cw=0, int a=0, int l=0, int dft=0, int f=0) : 
       caps_wanted(cw),
@@ -70,19 +70,19 @@ class MMDSCacheRejoin : public Message {
   };
 
   struct dirfrag_strong {
-    __int32_t nonce;
+    int32_t nonce;
     dirfrag_strong() {}
     dirfrag_strong(int n) : nonce(n) {}
   };
   struct dn_strong {
-    __int32_t nonce;
-    __int32_t lock;
+    int32_t nonce;
+    int32_t lock;
     dn_strong() {}
     dn_strong(int n, int l) : nonce(n), lock(l) {}
   };
 
   // -- data --
-  __int32_t op;
+  int32_t op;
 
   set<inodeno_t> weak_inodes;
   map<inodeno_t, inode_strong> strong_inodes;
@@ -146,7 +146,7 @@ class MMDSCacheRejoin : public Message {
     ::_encode(weak_inodes, payload);
     ::_encode(strong_inodes, payload);
 
-    __uint32_t nfull = full_inodes.size();
+    uint32_t nfull = full_inodes.size();
     ::_encode(nfull, payload);
     for (list<inode_full>::iterator p = full_inodes.begin(); p != full_inodes.end(); ++p)
       p->_encode(payload);
@@ -164,7 +164,7 @@ class MMDSCacheRejoin : public Message {
     ::_decode(weak_inodes, payload, off);
     ::_decode(strong_inodes, payload, off);
 
-    __uint32_t nfull;
+    uint32_t nfull;
     ::_decode(nfull, payload, off);
     for (unsigned i=0; i<nfull; i++) 
       full_inodes.push_back(inode_full(payload, off));
index ebe1cda485c4c30ed3ed6abce5bbff7ffbf06160..cce95be0601bf9eb2a50af88b6ceaf4f0f3aedf2 100644 (file)
 
 
 class MOSDPGPeer : public Message {
-  __uint64_t       map_version;
+  uint64_t       map_version;
   list<pg_t> pg_list;
 
   bool complete;
 
  public:
-  __uint64_t get_version() { return map_version; }
+  uint64_t get_version() { return map_version; }
   list<pg_t>& get_pg_list() { return pg_list; }
   bool get_complete() { return complete; }
 
   MOSDPGPeer() {}
-  MOSDPGPeer(__uint64_t v, list<pg_t>& l, bool c=false) :
+  MOSDPGPeer(uint64_t v, list<pg_t>& l, bool c=false) :
     Message(MSG_OSD_PG_PEER) {
     this->map_version = v;
     this->complete = c;
index e21a2607bb5733ef725b67a70d507fec57baf89c..35240cfae044be5f841ab6e772fed3a78ac52c99 100644 (file)
 #include "osd/OSD.h"
 
 class MOSDPGPeerAck : public Message {
-  __uint64_t       map_version;
+  version_t       map_version;
 
  public:
   list<pg_t>                pg_dne;   // pg dne
   map<pg_t, PGReplicaInfo > pg_state; // state, lists, etc.
 
-  __uint64_t get_version() { return map_version; }
+  version_t get_version() { return map_version; }
 
   MOSDPGPeerAck() {}
-  MOSDPGPeerAck(__uint64_t v) :
+  MOSDPGPeerAck(version_t v) :
     Message(MSG_OSD_PG_PEERACK) {
     this->map_version = v;
   }
index a65d2ccc2168f8507779671997c6edea1d9d54a1..418756b1d9874c1daa1c55870eff9d159f993df9 100644 (file)
 
 
 class MOSDPGPeerRequest : public Message {
-  __uint64_t       map_version;
+  version_t       map_version;
   list<repgroup_t> pg_list;
 
  public:
-  __uint64_t get_version() { return map_version; }
+  version_t get_version() { return map_version; }
   list<repgroup_t>& get_pg_list() { return pg_list; }
 
   MOSDPGPeerRequest() {}
-  MOSDPGPeerRequest(__uint64_t v, list<repgroup_t>& l) :
+  MOSDPGPeerRequest(version_t v, list<repgroup_t>& l) :
     Message(MSG_OSD_PG_PEERREQUEST) {
     this->map_version = v;
     pg_list.splice(pg_list.begin(), l);
index 11912582bf6cd0b248189b4c5ab98093ad1e3147..d7b8feafaec5c7d53f17ecabdca6f9fd014ecc23 100644 (file)
@@ -102,9 +102,9 @@ namespace __gnu_cxx {
  * ipv4 for now.
  */
 struct entity_addr_t {
-  __uint8_t  ipq[4];
-  __uint32_t port;
-  __uint32_t nonce;  // bind time, or pid, or something unique!
+  uint8_t  ipq[4];
+  uint32_t port;
+  uint32_t nonce;  // bind time, or pid, or something unique!
 
   entity_addr_t() : port(0), nonce(0) {
     ipq[0] = ipq[1] = ipq[2] = ipq[3] = 0;
index 038688c5cdfd536ee48621d531f8054abe3b6e17..cd106da71e2828d8f9345e0ae76db1c58c9d908d 100644 (file)
@@ -49,13 +49,13 @@ ssize_t Ager::age_pick_size() {
 
 bool start_debug = false;
 
-__uint64_t Ager::age_fill(float pc, utime_t until) {
+uint64_t Ager::age_fill(float pc, utime_t until) {
   int max = 1024*1024;
   bufferptr bp(max);
   bp.zero();
   bufferlist bl;
   bl.push_back(bp);
-  __uint64_t wrote = 0;
+  uint64_t wrote = 0;
   while (1) {
     if (g_clock.now() > until) break;
     
@@ -162,7 +162,7 @@ void Ager::age_empty(float pc) {
   g_conf.ebofs_verify = false;
 }
 
-void pfrag(__uint64_t written, ObjectStore::FragmentationStat &st)
+void pfrag(uint64_t written, ObjectStore::FragmentationStat &st)
 {
   cout << "#gb wr\ttotal\tn x\tavg x\tavg per\tavg j\tfree\tn fr\tavg fr\tnum<2\tsum<2\tnum<4\tsum<4\t..." 
        << endl;
@@ -177,7 +177,7 @@ void pfrag(__uint64_t written, ObjectStore::FragmentationStat &st)
        << "\t" << st.avg_free_extent;
     
   int n = st.num_extent;
-  for (__uint64_t i=1; i <= 30; i += 1) {
+  for (uint64_t i=1; i <= 30; i += 1) {
     cout << "\t" << st.extent_dist[i];
     cout << "\t" << st.extent_dist_sum[i];
     //cout << "\ta " << (st.extent_dist[i] ? (st.extent_dist_sum[i] / st.extent_dist[i]):0);
@@ -244,7 +244,7 @@ void Ager::age(int time,
   
   ObjectStore::FragmentationStat st;
 
-  __uint64_t wrote = 0;
+  uint64_t wrote = 0;
 
   for (int c=1; c<=count; c++) {
     if (g_clock.now() > until) break;
@@ -252,7 +252,7 @@ void Ager::age(int time,
     //if (c == 7) start_debug = true;
     
     dout(1) << "#age " << c << "/" << count << " filling to " << high_water << endl;
-    __uint64_t w = age_fill(high_water, until);
+    uint64_t w = age_fill(high_water, until);
     //dout(1) << "age wrote " << w << endl;
     wrote += w;
     //store->sync();
index 864c23fce8e14742ece4369f172cfdaec1dd556e..22dc77e2dfc33bbe565d30ab68e614990539c116 100644 (file)
@@ -21,7 +21,7 @@ class Ager {
   bool         did_distn;
 
   void age_empty(float pc);
-  __uint64_t age_fill(float pc, utime_t until);
+  uint64_t age_fill(float pc, utime_t until);
   ssize_t age_pick_size();
   object_t age_get_oid();
 
index 1360711f3b4179cc53efdd4addf19b887406f3eb..9ca4cf59a5ad7e5b2dc0c25da6308df9d365c1f4 100644 (file)
@@ -70,12 +70,12 @@ void FakeStore::get_oname(object_t oid, char *s)
   assert(sizeof(oid) == 16);
 #ifdef __LP64__
   sprintf(s, "%s/objects/%02lx/%016lx.%016lx", basedir.c_str(), H(oid) & HASH_MASK, 
-         *((__uint64_t*)&oid),
-         *(((__uint64_t*)&oid) + 1));
+         *((uint64_t*)&oid),
+         *(((uint64_t*)&oid) + 1));
 #else
   sprintf(s, "%s/objects/%02x/%016llx.%016llx", basedir.c_str(), H(oid) & HASH_MASK, 
-         *((__uint64_t*)&oid),
-         *(((__uint64_t*)&oid) + 1));
+         *((uint64_t*)&oid),
+         *(((uint64_t*)&oid) + 1));
 #endif
 }
 
@@ -96,12 +96,12 @@ void FakeStore::get_coname(coll_t cid, object_t oid, char *s)
   assert(sizeof(oid) == 16);
 #ifdef __LP64__
   sprintf(s, "%s/collections/%016lx/%016lx.%016lx", basedir.c_str(), cid, 
-         *((__uint64_t*)&oid),
-         *(((__uint64_t*)&oid) + 1));
+         *((uint64_t*)&oid),
+         *(((uint64_t*)&oid) + 1));
 #else
   sprintf(s, "%s/collections/%016llx/%016llx.%016llx", basedir.c_str(), cid, 
-         *((__uint64_t*)&oid),
-         *(((__uint64_t*)&oid) + 1));
+         *((uint64_t*)&oid),
+         *(((uint64_t*)&oid) + 1));
 #endif
 }
 
@@ -628,9 +628,9 @@ int FakeStore::collection_list(coll_t c, list<object_t>& ls)
     // parse
     object_t o;
     assert(sizeof(o) == 16);
-    *(((__uint64_t*)&o) + 0) = strtoll(de->d_name, 0, 16);
+    *(((uint64_t*)&o) + 0) = strtoll(de->d_name, 0, 16);
     assert(de->d_name[16] == '.');
-    *(((__uint64_t*)&o) + 1) = strtoll(de->d_name+17, 0, 16);
+    *(((uint64_t*)&o) + 1) = strtoll(de->d_name+17, 0, 16);
     dout(0) << " got " << o << " errno " << errno << " on " << de->d_name << endl;
     if (errno) continue;
     ls.push_back(o);
index 05899374ddaee8dacc9919c3a0186ed8947582a0..ba2e06d0d77300148714ccf83ab5fdd4c0e0df41 100644 (file)
@@ -62,25 +62,25 @@ namespace __gnu_cxx {
 
 
 // osd types
-typedef __uint64_t coll_t;        // collection id
+typedef uint64_t coll_t;        // collection id
 
 // pg stuff
 
 #define PG_INO 1
 
-typedef __uint16_t ps_t;
-typedef __uint8_t pruleset_t;
+typedef uint16_t ps_t;
+typedef uint8_t pruleset_t;
 
 // placement group id
 struct pg_t {
   union {
     struct {
-      __uint32_t  preferred:32; // 32
+      uint32_t  preferred:32; // 32
       ps_t        ps:16;        // 16
-      __uint8_t   nrep:8;       //  8
+      uint8_t   nrep:8;       //  8
       pruleset_t  ruleset:8;    //  8
     } fields;
-    __uint64_t val;          // 64
+    uint64_t val;          // 64
   } u;
 
   pg_t() { u.val = 0; }
@@ -91,15 +91,15 @@ struct pg_t {
     u.fields.nrep = n;
     u.fields.ruleset = r;
   }
-  pg_t(__uint64_t v) { u.val = v; }
+  pg_t(uint64_t v) { u.val = v; }
   /*
-  pg_t operator=(__uint64_t v) { u.val = v; return *this; }
-  pg_t operator&=(__uint64_t v) { u.val &= v; return *this; }
+  pg_t operator=(uint64_t v) { u.val = v; return *this; }
+  pg_t operator&=(uint64_t v) { u.val &= v; return *this; }
   pg_t operator+=(pg_t o) { u.val += o.val; return *this; }
   pg_t operator-=(pg_t o) { u.val -= o.val; return *this; }
   pg_t operator++() { ++u.val; return *this; }
   */
-  operator __uint64_t() const { return u.val; }
+  operator uint64_t() const { return u.val; }
 
   object_t to_object() const { return object_t(PG_INO, u.val >> 32, u.val & 0xffffffff); }
 };
@@ -113,7 +113,7 @@ inline ostream& operator<<(ostream& out, pg_t pg) {
     out << pg.u.fields.preferred << '.';
   out << hex << pg.u.fields.ps << dec;
   out << "=" << hex << pg.u.val << dec;
-  out << "=" << hex << (__uint64_t)pg << dec;
+  out << "=" << hex << (uint64_t)pg << dec;
   return out;
 }
 
@@ -122,7 +122,7 @@ namespace __gnu_cxx {
   {
     size_t operator()( const pg_t& x ) const
     {
-      static hash<__uint64_t> H;
+      static hash<uint64_t> H;
       return H(x);
     }
   };
@@ -195,13 +195,13 @@ inline ostream& operator<<(ostream& out, ObjectExtent &ex)
 
 class OSDSuperblock {
 public:
-  const static __uint64_t MAGIC = 0xeb0f505dULL;
-  __uint64_t magic;
-  __uint64_t fsid;      // unique fs id (random number)
+  const static uint64_t MAGIC = 0xeb0f505dULL;
+  uint64_t magic;
+  uint64_t fsid;      // unique fs id (random number)
   int        whoami;    // my role in this fs.
   epoch_t    current_epoch;             // most recent epoch
   epoch_t    oldest_map, newest_map;    // oldest/newest maps we have.
-  OSDSuperblock(__uint64_t f=0, int w=0) : 
+  OSDSuperblock(uint64_t f=0, int w=0) : 
     magic(MAGIC), fsid(f), whoami(w), 
     current_epoch(0), oldest_map(0), newest_map(0) {}
 };
index 6a052601a08afca15a6f853d9cbdec7f505eaf5e..1d8c1677d4b1ac8e22f776d43f1bb0d27b299582 100644 (file)
@@ -134,7 +134,7 @@ class Filer {
      (to be used on any osd in the proper replica group) */
   /*object_t file_to_object(inodeno_t ino,
                           size_t    _ono) {  
-    __uint64_t ono = _ono;
+    uint64_t ono = _ono;
     assert(ino < (1ULL<<OID_INO_BITS));       // legal ino can't be too big
     assert(ono < (1ULL<<OID_ONO_BITS));
     return ono + (ino << OID_ONO_BITS);