const char *p = prefix.c_str();
- map<__int64_t, __int64_t> open_files;
+ map<int64_t, int64_t> open_files;
while (!t.end()) {
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);
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);
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];
}
// 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;
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;
// 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++;
{
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;
// 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++;
class LogType {
protected:
- hash_map<__uint64_t, int> keymap;
+ hash_map<intptr_t, int> keymap;
vector<const char*> keys;
set<int> inc_keys;
// 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;
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);
}
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];
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;
}
// figure size
- __uint64_t bsize = get_num_blocks();
+ uint64_t bsize = get_num_blocks();
dout(2) << "open " << bsize << " bytes, " << num_blocks << " blocks" << endl;
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) {
// 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
// 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 */
// super
-typedef __uint64_t version_t;
+typedef uint64_t version_t;
static const unsigned EBOFS_MAGIC = 0x000EB0F5;
#ifndef __BUFFER_H
#define __BUFFER_H
+#include <stdint.h>
+
#include "common/Mutex.h"
#include <iostream>
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);
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--) {
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);
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--) {
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);
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--) {
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);
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);
}
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);
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--) {
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);
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--) {
// 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;
// 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;
// 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;
#ifndef __FRAG_H
#define __FRAG_H
+#include <stdint.h>
#include <map>
#include <list>
#include "buffer.h"
* 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.
#ifndef __LRU_H
#define __LRU_H
+#include <stdint.h>
#include <assert.h>
#include <iostream>
using namespace std;
class LRUList {
private:
LRUObject *head, *tail;
- __uint32_t len;
+ uint32_t len;
public:
LRUList() {
len = 0;
}
- __uint32_t get_length() { return len; }
+ uint32_t get_length() { return len; }
LRUObject *get_head() {
return head;
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;
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; }
#ifndef __OBJECT_H
#define __OBJECT_H
+#include <stdint.h>
+
#include <iostream>
#include <iomanip>
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) {}
};
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));
}
};
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);
}
};
#define __MDS_TYPES_H
extern "C" {
+#include <stdint.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <assert.h>
#include <vector>
#include <iostream>
#include <iomanip>
+
using namespace std;
#include <ext/hash_map>
};
#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));
}
};
// ----------------------
// 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)
// -- inode --
-typedef __uint64_t _inodeno_t;
+typedef uint64_t _inodeno_t;
struct inodeno_t {
_inodeno_t val;
inodeno_t() : val(0) {}
{
size_t operator()( const inodeno_t& x ) const
{
- static hash<__uint64_t> H;
+ static hash<uint64_t> H;
return H(x.val);
}
};
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;
}
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);
// 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;
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);
}
};
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;
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) :
// -- 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),
};
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;
::_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);
::_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));
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;
#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;
}
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);
* 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;
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;
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;
<< "\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);
ObjectStore::FragmentationStat st;
- __uint64_t wrote = 0;
+ uint64_t wrote = 0;
for (int c=1; c<=count; c++) {
if (g_clock.now() > until) break;
//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();
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();
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
}
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
}
// 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);
// 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; }
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); }
};
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;
}
{
size_t operator()( const pg_t& x ) const
{
- static hash<__uint64_t> H;
+ static hash<uint64_t> H;
return H(x);
}
};
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) {}
};
(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);