From: Sage Weil Date: Wed, 26 May 2010 23:53:13 +0000 (-0700) Subject: types: standardize on uint64_t X-Git-Tag: v0.20.2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ad384db84d43d250de08417aa84e7dbd174dc3bd;p=ceph.git types: standardize on uint64_t The problem is that on some platforms __u64 == uint64_t (x86_64), and on others it's doesn't (ppc64). Which means we don't know whether to define different versions of overloaded functions for both types or just one. So, standardize on uint64_t. This plays nicer with STL, which defines hash on 64 bit arches but not 32 bit. Which means we can't standarzie on __u64 or else hash<__u64> won't work. Bah! Conflicts: src/common/Throttle.h src/config.h src/include/librados.h src/include/librados.hpp src/librados.cc src/messages/MPoolOp.h src/mon/OSDMonitor.cc src/os/FileJournal.cc src/osd/osd_types.h src/osdc/Objecter.h --- diff --git a/src/auth/Auth.h b/src/auth/Auth.h index 638ed350a617..0ff195875cf1 100644 --- a/src/auth/Auth.h +++ b/src/auth/Auth.h @@ -105,7 +105,7 @@ static inline ostream& operator<<(ostream& out, const EntityName& n) { struct EntityAuth { - __u64 auid; + uint64_t auid; CryptoKey key; map caps; diff --git a/src/auth/AuthAuthorizeHandler.h b/src/auth/AuthAuthorizeHandler.h index 23c1ee7cf813..76a9cc210de0 100644 --- a/src/auth/AuthAuthorizeHandler.h +++ b/src/auth/AuthAuthorizeHandler.h @@ -27,7 +27,7 @@ struct AuthAuthorizeHandler { virtual bool verify_authorizer(KeyStore *keys, bufferlist& authorizer_data, bufferlist& authorizer_reply, EntityName& entity_name, uint64_t& global_id, - AuthCapsInfo& caps_info, __u64 *auid = NULL) = 0; + AuthCapsInfo& caps_info, uint64_t *auid = NULL) = 0; }; extern AuthAuthorizeHandler *get_authorize_handler(int protocol); diff --git a/src/auth/AuthServiceHandler.h b/src/auth/AuthServiceHandler.h index c894f8b39b43..729f6404891a 100644 --- a/src/auth/AuthServiceHandler.h +++ b/src/auth/AuthServiceHandler.h @@ -30,7 +30,7 @@ struct AuthServiceHandler { virtual ~AuthServiceHandler() { } virtual int start_session(EntityName& name, bufferlist::iterator& indata, bufferlist& result, AuthCapsInfo& caps) = 0; - virtual int handle_request(bufferlist::iterator& indata, bufferlist& result, uint64_t& global_id, AuthCapsInfo& caps, __u64 *auid = NULL) = 0; + virtual int handle_request(bufferlist::iterator& indata, bufferlist& result, uint64_t& global_id, AuthCapsInfo& caps, uint64_t *auid = NULL) = 0; EntityName& get_entity_name() { return entity_name; } }; diff --git a/src/auth/KeyRing.h b/src/auth/KeyRing.h index 1d39882c0fb5..9d35e6625839 100644 --- a/src/auth/KeyRing.h +++ b/src/auth/KeyRing.h @@ -55,7 +55,7 @@ public: void set_caps(EntityName& name, map& caps) { keys[name].caps = caps; } - void set_uid(EntityName& ename, __u64 auid) { + void set_uid(EntityName& ename, uint64_t auid) { keys[ename].auid = auid; } void import(KeyRing& other); diff --git a/src/auth/cephx/CephxAuthorizeHandler.cc b/src/auth/cephx/CephxAuthorizeHandler.cc index 5e612d126420..55272ecc6526 100644 --- a/src/auth/cephx/CephxAuthorizeHandler.cc +++ b/src/auth/cephx/CephxAuthorizeHandler.cc @@ -7,7 +7,7 @@ bool CephxAuthorizeHandler::verify_authorizer(KeyStore *keys, bufferlist& authorizer_data, bufferlist& authorizer_reply, - EntityName& entity_name, uint64_t& global_id, AuthCapsInfo& caps_info, __u64 *auid) + EntityName& entity_name, uint64_t& global_id, AuthCapsInfo& caps_info, uint64_t *auid) { bufferlist::iterator iter = authorizer_data.begin(); diff --git a/src/auth/cephx/CephxAuthorizeHandler.h b/src/auth/cephx/CephxAuthorizeHandler.h index f83e939b3f72..10b942f8678d 100644 --- a/src/auth/cephx/CephxAuthorizeHandler.h +++ b/src/auth/cephx/CephxAuthorizeHandler.h @@ -21,7 +21,7 @@ struct CephxAuthorizeHandler : public AuthAuthorizeHandler { bool verify_authorizer(KeyStore *keys, bufferlist& authorizer_data, bufferlist& authorizer_reply, EntityName& entity_name, uint64_t& global_id, - AuthCapsInfo& caps_info, __u64 *auid = NULL); + AuthCapsInfo& caps_info, uint64_t *auid = NULL); }; diff --git a/src/auth/cephx/CephxProtocol.cc b/src/auth/cephx/CephxProtocol.cc index 8c7ef2edbc9f..70bcffbd3cca 100644 --- a/src/auth/cephx/CephxProtocol.cc +++ b/src/auth/cephx/CephxProtocol.cc @@ -10,7 +10,7 @@ -int cephx_calc_client_server_challenge(CryptoKey& secret, __u64 server_challenge, __u64 client_challenge, __u64 *key) +int cephx_calc_client_server_challenge(CryptoKey& secret, uint64_t server_challenge, uint64_t client_challenge, uint64_t *key) { CephXChallengeBlob b; b.server_challenge = server_challenge; @@ -21,7 +21,7 @@ int cephx_calc_client_server_challenge(CryptoKey& secret, __u64 server_challenge if (ret < 0) return ret; - __u64 k = 0; + uint64_t k = 0; const uint64_t *p = (const uint64_t *)enc.c_str(); for (int pos = 0; pos + sizeof(k) <= enc.length(); pos+=sizeof(k), p++) k ^= *p; @@ -264,7 +264,7 @@ CephXAuthorizer *CephXTicketHandler::build_authorizer(uint64_t global_id) { CephXAuthorizer *a = new CephXAuthorizer; a->session_key = session_key; - a->nonce = ((__u64)rand() << 32) + rand(); + a->nonce = ((uint64_t)rand() << 32) + rand(); __u8 authorizer_v = 1; ::encode(authorizer_v, a->bl); @@ -434,7 +434,7 @@ bool CephXAuthorizer::verify_reply(bufferlist::iterator& indata) return false; } - __u64 expect = nonce + 1; + uint64_t expect = nonce + 1; if (expect != reply.nonce_plus_one) { dout(0) << "verify_authorizer_reply bad nonce got " << reply.nonce_plus_one << " expected " << expect << " sent " << nonce << dendl; diff --git a/src/auth/cephx/CephxProtocol.h b/src/auth/cephx/CephxProtocol.h index e1ca323436f9..52cc4402be88 100644 --- a/src/auth/cephx/CephxProtocol.h +++ b/src/auth/cephx/CephxProtocol.h @@ -91,7 +91,7 @@ // initial server -> client challenge struct CephXServerChallenge { - __u64 server_challenge; + uint64_t server_challenge; void encode(bufferlist& bl) const { __u8 struct_v = 1; @@ -160,8 +160,8 @@ WRITE_CLASS_ENCODER(CephXTicketBlob); // client -> server response to challenge struct CephXAuthenticate { - __u64 client_challenge; - __u64 key; + uint64_t client_challenge; + uint64_t key; CephXTicketBlob old_ticket; void encode(bufferlist& bl) const { @@ -182,7 +182,7 @@ struct CephXAuthenticate { WRITE_CLASS_ENCODER(CephXAuthenticate) struct CephXChallengeBlob { - __u64 server_challenge, client_challenge; + uint64_t server_challenge, client_challenge; void encode(bufferlist& bl) const { ::encode(server_challenge, bl); @@ -195,8 +195,8 @@ struct CephXChallengeBlob { }; WRITE_CLASS_ENCODER(CephXChallengeBlob) -int cephx_calc_client_server_challenge(CryptoKey& secret, __u64 server_challenge, __u64 client_challenge, - __u64 *key); +int cephx_calc_client_server_challenge(CryptoKey& secret, uint64_t server_challenge, uint64_t client_challenge, + uint64_t *key); /* @@ -245,7 +245,7 @@ WRITE_CLASS_ENCODER(CephXServiceTicketRequest); */ struct CephXAuthorizeReply { - __u64 nonce_plus_one; + uint64_t nonce_plus_one; void encode(bufferlist& bl) const { __u8 struct_v = 1; ::encode(struct_v, bl); @@ -261,7 +261,7 @@ WRITE_CLASS_ENCODER(CephXAuthorizeReply); struct CephXAuthorizer : public AuthAuthorizer { - __u64 nonce; + uint64_t nonce; CryptoKey session_key; CephXAuthorizer() : AuthAuthorizer(CEPH_AUTH_CEPHX) {} @@ -362,7 +362,7 @@ struct CephXServiceTicketInfo { WRITE_CLASS_ENCODER(CephXServiceTicketInfo); struct CephXAuthorize { - __u64 nonce; + uint64_t nonce; void encode(bufferlist& bl) const { __u8 struct_v = 1; ::encode(struct_v, bl); diff --git a/src/auth/cephx/CephxServiceHandler.cc b/src/auth/cephx/CephxServiceHandler.cc index d9ac488e893d..ee039d5534ec 100644 --- a/src/auth/cephx/CephxServiceHandler.cc +++ b/src/auth/cephx/CephxServiceHandler.cc @@ -44,7 +44,7 @@ int CephxServiceHandler::start_session(EntityName& name, bufferlist::iterator& i return CEPH_AUTH_CEPHX; } -int CephxServiceHandler::handle_request(bufferlist::iterator& indata, bufferlist& result_bl, uint64_t& global_id, AuthCapsInfo& caps, __u64 *auid) +int CephxServiceHandler::handle_request(bufferlist::iterator& indata, bufferlist& result_bl, uint64_t& global_id, AuthCapsInfo& caps, uint64_t *auid) { int ret = 0; @@ -72,7 +72,7 @@ int CephxServiceHandler::handle_request(bufferlist::iterator& indata, bufferlist break; } - __u64 expected_key; + uint64_t expected_key; cephx_calc_client_server_challenge(secret, server_challenge, req.client_challenge, &expected_key); dout(20) << " checking key: req.key=" << hex << req.key diff --git a/src/auth/cephx/CephxServiceHandler.h b/src/auth/cephx/CephxServiceHandler.h index 48e3ba437152..a8a39f09be0b 100644 --- a/src/auth/cephx/CephxServiceHandler.h +++ b/src/auth/cephx/CephxServiceHandler.h @@ -29,7 +29,7 @@ public: ~CephxServiceHandler() {} int start_session(EntityName& name, bufferlist::iterator& indata, bufferlist& result_bl, AuthCapsInfo& caps); - int handle_request(bufferlist::iterator& indata, bufferlist& result_bl, uint64_t& global_id, AuthCapsInfo& caps, __u64 *auid = NULL); + int handle_request(bufferlist::iterator& indata, bufferlist& result_bl, uint64_t& global_id, AuthCapsInfo& caps, uint64_t *auid = NULL); void build_cephx_response_header(int request_type, int status, bufferlist& bl); }; diff --git a/src/auth/none/AuthNoneAuthorizeHandler.cc b/src/auth/none/AuthNoneAuthorizeHandler.cc index 5d6d9fc2ff33..fbc655b5cd0a 100644 --- a/src/auth/none/AuthNoneAuthorizeHandler.cc +++ b/src/auth/none/AuthNoneAuthorizeHandler.cc @@ -6,7 +6,7 @@ bool AuthNoneAuthorizeHandler::verify_authorizer(KeyStore *keys, bufferlist& authorizer_data, bufferlist& authorizer_reply, EntityName& entity_name, uint64_t& global_id, AuthCapsInfo& caps_info, -__u64 *auid) +uint64_t *auid) { bufferlist::iterator iter = authorizer_data.begin(); diff --git a/src/auth/none/AuthNoneAuthorizeHandler.h b/src/auth/none/AuthNoneAuthorizeHandler.h index 0686292b433b..f5db034d9aed 100644 --- a/src/auth/none/AuthNoneAuthorizeHandler.h +++ b/src/auth/none/AuthNoneAuthorizeHandler.h @@ -21,7 +21,7 @@ struct AuthNoneAuthorizeHandler : public AuthAuthorizeHandler { bool verify_authorizer(KeyStore *keys, bufferlist& authorizer_data, bufferlist& authorizer_reply, EntityName& entity_name, uint64_t& global_id, - AuthCapsInfo& caps_info, __u64 *auid=NULL); + AuthCapsInfo& caps_info, uint64_t *auid=NULL); }; diff --git a/src/auth/none/AuthNoneServiceHandler.h b/src/auth/none/AuthNoneServiceHandler.h index 1ff304d5a909..271fc3651887 100644 --- a/src/auth/none/AuthNoneServiceHandler.h +++ b/src/auth/none/AuthNoneServiceHandler.h @@ -28,7 +28,7 @@ public: caps.allow_all = true; return CEPH_AUTH_NONE; } - int handle_request(bufferlist::iterator& indata, bufferlist& result_bl, uint64_t& global_id, AuthCapsInfo& caps, __u64 *auid = NULL) { + int handle_request(bufferlist::iterator& indata, bufferlist& result_bl, uint64_t& global_id, AuthCapsInfo& caps, uint64_t *auid = NULL) { assert(0); // shouldn't get called return 0; } diff --git a/src/cauthtool.cc b/src/cauthtool.cc index 194a070b7b14..822e7283daa3 100644 --- a/src/cauthtool.cc +++ b/src/cauthtool.cc @@ -48,7 +48,7 @@ int main(int argc, const char **argv) const char *caps_fn = NULL; const char *import_keyring = NULL; bool set_auid = false; - __u64 auid = CEPH_AUTH_UID_DEFAULT; + uint64_t auid = CEPH_AUTH_UID_DEFAULT; const char *name = g_conf.name; FOR_EACH_ARG(args) { diff --git a/src/client/Client.cc b/src/client/Client.cc index f5f0568692ef..4c9602f1cfd6 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -335,9 +335,9 @@ void Client::trim_cache() void Client::update_inode_file_bits(Inode *in, - __u64 truncate_seq, __u64 truncate_size, - __u64 size, - __u64 time_warp_seq, utime_t ctime, + uint64_t truncate_seq, uint64_t truncate_size, + uint64_t size, + uint64_t time_warp_seq, utime_t ctime, utime_t mtime, utime_t atime, int issued) @@ -1669,7 +1669,7 @@ void Client::cap_delay_requeue(Inode *in) } void Client::send_cap(Inode *in, int mds, InodeCap *cap, int used, int want, int retain, int flush, - __u64 tid) + uint64_t tid) { int held = cap->issued | cap->implemented; int revoking = cap->implemented & ~cap->issued; @@ -1736,7 +1736,7 @@ void Client::check_caps(Inode *in, bool is_delayed) unsigned wanted = in->caps_wanted(); unsigned used = in->caps_used(); int flush = 0; - __u64 flush_tid = 0; + uint64_t flush_tid = 0; int retain = wanted | CEPH_CAP_PIN; if (!unmounting) { @@ -2030,7 +2030,7 @@ void Client::check_cap_issue(Inode *in, InodeCap *cap, unsigned issued) } } -void Client::add_update_cap(Inode *in, int mds, __u64 cap_id, +void Client::add_update_cap(Inode *in, int mds, uint64_t cap_id, unsigned issued, unsigned seq, unsigned mseq, inodeno_t realm, int flags) { @@ -2181,7 +2181,7 @@ void Client::flush_caps() check_caps(in, true); } } -void Client::wait_sync_caps(__u64 want) +void Client::wait_sync_caps(uint64_t want) { retry: dout(10) << "wait_sync_caps want " << want << " (last is " << last_flush_seq << ", " @@ -2973,7 +2973,7 @@ void Client::renew_caps() void Client::renew_caps(const int mds) { dout(10) << "renew_caps mds" << mds << dendl; mds_sessions[mds].last_cap_renew_request = g_clock.now(); - __u64 seq = ++mds_sessions[mds].cap_renew_seq; + uint64_t seq = ++mds_sessions[mds].cap_renew_seq; messenger->send_message(new MClientSession(CEPH_SESSION_REQUEST_RENEWCAPS, seq), mdsmap->get_inst(mds)); @@ -4262,7 +4262,7 @@ int Client::read(int fd, char *buf, loff_t size, loff_t offset) return r; } -int Client::_read(Fh *f, __s64 offset, __u64 size, bufferlist *bl) +int Client::_read(Fh *f, int64_t offset, uint64_t size, bufferlist *bl) { Inode *in = f->inode; @@ -4309,7 +4309,7 @@ int Client::_read(Fh *f, __s64 offset, __u64 size, bufferlist *bl) return r; } -int Client::_read_async(Fh *f, __u64 off, __u64 len, bufferlist *bl) +int Client::_read_async(Fh *f, uint64_t off, uint64_t len, bufferlist *bl) { Inode *in = f->inode; bool readahead = true; @@ -4398,10 +4398,10 @@ int Client::_read_async(Fh *f, __u64 off, __u64 len, bufferlist *bl) return r; } -int Client::_read_sync(Fh *f, __u64 off, __u64 len, bufferlist *bl) +int Client::_read_sync(Fh *f, uint64_t off, uint64_t len, bufferlist *bl) { Inode *in = f->inode; - __u64 pos = off; + uint64_t pos = off; int left = len; int read = 0; @@ -4513,9 +4513,9 @@ int Client::write(int fd, const char *buf, loff_t size, loff_t offset) } -int Client::_write(Fh *f, __s64 offset, __u64 size, const char *buf) +int Client::_write(Fh *f, int64_t offset, uint64_t size, const char *buf) { - if ((__u64)(offset+size) > mdsmap->get_max_filesize()) //too large! + if ((uint64_t)(offset+size) > mdsmap->get_max_filesize()) //too large! return -EFBIG; if (osdmap->test_flag(CEPH_OSDMAP_FULL)) @@ -4553,7 +4553,7 @@ int Client::_write(Fh *f, __s64 offset, __u64 size, const char *buf) bufferlist bl; bl.push_back( bp ); - __u64 endoff = offset + size; + uint64_t endoff = offset + size; int got; int r = get_caps(in, CEPH_CAP_FILE_WR, CEPH_CAP_FILE_BUFFER, &got, endoff); if (r < 0) @@ -4604,7 +4604,7 @@ int Client::_write(Fh *f, __s64 offset, __u64 size, const char *buf) client_logger->favg(l_c_wrlat,(double)lat); // assume success for now. FIXME. - __u64 totalwritten = size; + uint64_t totalwritten = size; // extend file? if (totalwritten + offset > in->size) { @@ -4835,7 +4835,7 @@ int Client::sync_fs() return _sync_fs(); } -__s64 Client::drop_caches() +int64_t Client::drop_caches() { Mutex::Locker l(client_lock); return objectcacher->release_all(); diff --git a/src/client/Client.h b/src/client/Client.h index ff735e2a7908..5f328e24f851 100644 --- a/src/client/Client.h +++ b/src/client/Client.h @@ -95,7 +95,7 @@ class Inode; class Dentry; struct MetaRequest { - __u64 tid; + uint64_t tid; ceph_mds_request_head head; filepath path, path2; bufferlist data; @@ -200,9 +200,9 @@ struct MetaRequest { struct MDSSession { version_t seq; - __u64 cap_gen; + uint64_t cap_gen; utime_t cap_ttl, last_cap_renew_request; - __u64 cap_renew_seq; + uint64_t cap_renew_seq; int num_caps; entity_inst_t inst; bool closing; @@ -231,7 +231,7 @@ class Dentry : public LRUObject { int ref; // 1 if there's a dir beneath me. int lease_mds; utime_t lease_ttl; - __u64 lease_gen; + uint64_t lease_gen; ceph_seq_t lease_seq; int cap_shared_gen; @@ -251,7 +251,7 @@ class Dir { public: Inode *parent_inode; // my inode hash_map dentries; - __u64 release_count; + uint64_t release_count; Dir(Inode* in) : release_count(0) { parent_inode = in; } @@ -305,11 +305,11 @@ struct InodeCap { Inode *inode; xlist::item cap_item; - __u64 cap_id; + uint64_t cap_id; unsigned issued; unsigned implemented; unsigned wanted; // as known to mds. - __u64 seq, issue_seq; + uint64_t seq, issue_seq; __u32 mseq; // migration seq __u32 gen; @@ -321,11 +321,11 @@ struct CapSnap { //snapid_t follows; // map key SnapContext context; int issued, dirty; - __u64 size; + uint64_t size; utime_t ctime, mtime, atime; version_t time_warp_seq; bool writing, dirty_data; - __u64 flush_tid; + uint64_t flush_tid; CapSnap() : issued(0), dirty(0), size(0), time_warp_seq(0), writing(false), dirty_data(false), flush_tid(0) {} }; @@ -360,7 +360,7 @@ class Inode { utime_t atime; // file data access time. uint32_t time_warp_seq; // count of (potential) mtime/atime timewarps (i.e., utimes()) - __u64 max_size; // max size we can write to + uint64_t max_size; // max size we can write to // dirfrag, recursive accountin frag_info_t dirstat; @@ -385,7 +385,7 @@ class Inode { map caps; // mds -> InodeCap InodeCap *auth_cap; unsigned dirty_caps, flushing_caps; - __u64 flushing_cap_seq; + uint64_t flushing_cap_seq; __u16 flushing_cap_tid[CEPH_CAP_BITS]; int shared_gen, cache_gen; int snap_caps, snap_cap_refs; @@ -407,7 +407,7 @@ class Inode { ObjectCacher::ObjectSet oset; - __u64 reported_size, wanted_max_size, requested_max_size; + uint64_t reported_size, wanted_max_size, requested_max_size; int ref; // ref count. 1 for each dentry, fh that links to me. int ll_ref; // separate ref count for ll client @@ -753,7 +753,7 @@ class Client : public Dispatcher { Inode *inode; int64_t offset; // high bits: frag_t, low bits: an offset - __u64 release_count; + uint64_t release_count; map > buffer; DirResult(Inode *in) : inode(in), offset(0), release_count(0) { @@ -1105,7 +1105,7 @@ protected: // file caps void check_cap_issue(Inode *in, InodeCap *cap, unsigned issued); - void add_update_cap(Inode *in, int mds, __u64 cap_id, + void add_update_cap(Inode *in, int mds, uint64_t cap_id, unsigned issued, unsigned seq, unsigned mseq, inodeno_t realm, int flags); void remove_cap(Inode *in, int mds); @@ -1129,12 +1129,12 @@ protected: void handle_cap_flushsnap_ack(Inode *in, class MClientCaps *m); void handle_cap_grant(Inode *in, int mds, InodeCap *cap, class MClientCaps *m); void cap_delay_requeue(Inode *in); - void send_cap(Inode *in, int mds, InodeCap *cap, int used, int want, int retain, int flush, __u64 tid); + void send_cap(Inode *in, int mds, InodeCap *cap, int used, int want, int retain, int flush, uint64_t tid); void check_caps(Inode *in, bool is_delayed); void get_cap_ref(Inode *in, int cap); void put_cap_ref(Inode *in, int cap); void flush_snaps(Inode *in); - void wait_sync_caps(__u64 want); + void wait_sync_caps(uint64_t want); void queue_cap_snap(Inode *in, snapid_t seq=0); void finish_cap_snap(Inode *in, CapSnap *capsnap, int used); void _flushed_cap_snap(Inode *in, snapid_t seq); @@ -1155,8 +1155,8 @@ protected: Inode* insert_trace(MetaRequest *request, utime_t ttl, int mds); void update_inode_file_bits(Inode *in, - __u64 truncate_seq, __u64 truncate_size, __u64 size, - __u64 time_warp_seq, utime_t ctime, utime_t mtime, utime_t atime, + uint64_t truncate_seq, uint64_t truncate_size, uint64_t size, + uint64_t time_warp_seq, utime_t ctime, utime_t mtime, utime_t atime, int issued); Inode *add_update_inode(InodeStat *st, utime_t ttl, int mds); void insert_dentry_inode(Dir *dir, const string& dname, LeaseStat *dlease, @@ -1182,8 +1182,8 @@ private: Fh *_create_fh(Inode *in, int flags, int cmode); - int _read_sync(Fh *f, __u64 off, __u64 len, bufferlist *bl); - int _read_async(Fh *f, __u64 off, __u64 len, bufferlist *bl); + int _read_sync(Fh *f, uint64_t off, uint64_t len, bufferlist *bl); + int _read_async(Fh *f, uint64_t off, uint64_t len, bufferlist *bl); // internal interface // call these with client_lock held! @@ -1207,8 +1207,8 @@ private: int _create(Inode *in, const char *name, int flags, mode_t mode, Inode **inp, Fh **fhp, int uid=-1, int gid=-1); int _release(Fh *fh); loff_t _lseek(Fh *fh, loff_t offset, int whence); - int _read(Fh *fh, __s64 offset, __u64 size, bufferlist *bl); - int _write(Fh *fh, __s64 offset, __u64 size, const char *buf); + int _read(Fh *fh, int64_t offset, uint64_t size, bufferlist *bl); + int _write(Fh *fh, int64_t offset, uint64_t size, const char *buf); int _flush(Fh *fh); int _fsync(Fh *fh, bool syncdataonly); int _sync_fs(); @@ -1285,7 +1285,7 @@ public: int fstat(int fd, struct stat *stbuf); int sync_fs(); - __s64 drop_caches(); + int64_t drop_caches(); // hpc lazyio int lazyio_propogate(int fd, loff_t offset, size_t count); diff --git a/src/client/SyntheticClient.cc b/src/client/SyntheticClient.cc index 53b8a0c08c69..abac8e3f1999 100644 --- a/src/client/SyntheticClient.cc +++ b/src/client/SyntheticClient.cc @@ -1361,7 +1361,7 @@ int SyntheticClient::play_trace(Trace& t, string& prefix, bool metadata_only) object_t oid = file_object_t(oh, ol); lock.Lock(); ceph_object_layout layout = client->osdmap->make_object_layout(oid, CEPH_CASDATA_RULE); - __u64 size; + uint64_t size; utime_t mtime; client->objecter->stat(oid, layout, CEPH_NOSNAP, &size, &mtime, 0, new C_SafeCond(&lock, &cond, &ack)); while (!ack) cond.Wait(lock); @@ -1936,7 +1936,7 @@ int SyntheticClient::write_file(string& fn, int size, loff_t wrsize) // size i utime_t from = g_clock.now(); utime_t start = from; - __u64 bytes = 0, total = 0; + uint64_t bytes = 0, total = 0; for (loff_t i=0; ifstat(fd, &st); - __u64 size = st.st_size; + uint64_t size = st.st_size; dout(0) << "file " << filename << " size is " << size << dendl; Filer *filer = client->filer; @@ -3324,7 +3324,7 @@ int SyntheticClient::chunk_file(string &filename) inode.ino = st.st_ino; client->describe_layout(fd, &inode.layout); - __u64 pos = 0; + uint64_t pos = 0; bufferlist from_before; while (pos < size) { int get = MIN(size-pos, 1048576); diff --git a/src/client/fuse_ll.cc b/src/client/fuse_ll.cc index 440cffa3984c..38c726da77eb 100644 --- a/src/client/fuse_ll.cc +++ b/src/client/fuse_ll.cc @@ -31,17 +31,17 @@ static Client *client; Mutex stag_lock("fuse_ll.cc stag_lock"); int last_stag = 0; -hash_map<__u64,int> snap_stag_map; -hash_map stag_snap_map; +hash_map snap_stag_map; +hash_map stag_snap_map; #define FINO_INO(x) ((x) & ((1ull<<48)-1ull)) #define FINO_STAG(x) ((x) >> 48) #define MAKE_FINO(i,s) ((i) | ((s) << 48)) -static __u64 fino_snap(__u64 fino) +static uint64_t fino_snap(uint64_t fino) { Mutex::Locker l(stag_lock); - __u64 stag = FINO_STAG(fino); + uint64_t stag = FINO_STAG(fino); assert(stag_snap_map.count(stag)); return stag_snap_map[stag]; } @@ -53,10 +53,10 @@ static vinodeno_t fino_vino(inodeno_t fino) } -static __u64 make_fake_ino(inodeno_t ino, snapid_t snapid) +static uint64_t make_fake_ino(inodeno_t ino, snapid_t snapid) { Mutex::Locker l(stag_lock); - __u64 stag; + uint64_t stag; if (snap_stag_map.count(snapid) == 0) { stag = ++last_stag; snap_stag_map[snapid] = stag; @@ -359,7 +359,7 @@ static void ceph_ll_readdir(fuse_req_t req, fuse_ino_t ino, size_t size, struct stat st; memset(&st, 0, sizeof(st)); - __u64 snap = fino_snap(ino); + uint64_t snap = fino_snap(ino); while (1) { int r = client->readdir_r(dirp, &de); diff --git a/src/client/ioctl.h b/src/client/ioctl.h index 25e4f1a9d059..5ff11b721e0f 100644 --- a/src/client/ioctl.h +++ b/src/client/ioctl.h @@ -8,9 +8,9 @@ /* just use u64 to align sanely on all archs */ struct ceph_ioctl_layout { - __u64 stripe_unit, stripe_count, object_size; - __u64 data_pool; - __s64 preferred_osd; + uint64_t stripe_unit, stripe_count, object_size; + uint64_t data_pool; + int64_t preferred_osd; }; #define CEPH_IOC_GET_LAYOUT _IOR(CEPH_IOCTL_MAGIC, 1, \ @@ -23,14 +23,14 @@ struct ceph_ioctl_layout { * file offset. */ struct ceph_ioctl_dataloc { - __u64 file_offset; /* in+out: file offset */ - __u64 object_offset; /* out: offset in object */ - __u64 object_no; /* out: object # */ - __u64 object_size; /* out: object size */ + uint64_t file_offset; /* in+out: file offset */ + uint64_t object_offset; /* out: offset in object */ + uint64_t object_no; /* out: object # */ + uint64_t object_size; /* out: object size */ char object_name[64]; /* out: object name */ - __u64 block_offset; /* out: offset in block */ - __u64 block_size; /* out: block length */ - __s64 osd; /* out: osd # */ + uint64_t block_offset; /* out: offset in block */ + uint64_t block_size; /* out: block length */ + int64_t osd; /* out: osd # */ struct sockaddr_storage osd_addr; /* out: osd address */ }; diff --git a/src/common/Logger.cc b/src/common/Logger.cc index ceb8a4658c4e..8e4ee2b68c25 100644 --- a/src/common/Logger.cc +++ b/src/common/Logger.cc @@ -246,14 +246,14 @@ void Logger::_flush(bool reset) -__s64 Logger::inc(int key, __s64 v) +int64_t Logger::inc(int key, int64_t v) { if (!open || !g_conf.logger) return 0; logger_lock.Lock(); int i = type->lookup_key(key); vals[i] += v; - __s64 r = vals[i]; + int64_t r = vals[i]; logger_lock.Unlock(); return r; } @@ -270,14 +270,14 @@ double Logger::finc(int key, double v) return r; } -__s64 Logger::set(int key, __s64 v) +int64_t Logger::set(int key, int64_t v) { if (!open || !g_conf.logger) return 0; logger_lock.Lock(); int i = type->lookup_key(key); //cout << this << " set " << i << " to " << v << std::endl; - __s64 r = vals[i] = v; + int64_t r = vals[i] = v; logger_lock.Unlock(); return r; } @@ -309,13 +309,13 @@ double Logger::favg(int key, double v) return r; } -__s64 Logger::get(int key) +int64_t Logger::get(int key) { if (!open || !g_conf.logger) return 0; logger_lock.Lock(); int i = type->lookup_key(key); - __s64 r = 0; + int64_t r = 0; if (i >= 0 && i < (int)vals.size()) r = vals[i]; logger_lock.Unlock(); diff --git a/src/common/Logger.h b/src/common/Logger.h index c8a75115895e..b04bce2a1d5f 100644 --- a/src/common/Logger.h +++ b/src/common/Logger.h @@ -39,7 +39,7 @@ class Logger { bool open; // values for this instance - vector<__s64> vals; + vector vals; vector fvals; vector< vector > vals_to_avg; // for calculating variance @@ -60,9 +60,9 @@ class Logger { void _open_log(); - __s64 inc(int f, __s64 v = 1); - __s64 set(int f, __s64 v); - __s64 get(int f); + int64_t inc(int f, int64_t v = 1); + int64_t set(int f, int64_t v); + int64_t get(int f); double fset(int f, double v); double finc(int f, double v); diff --git a/src/common/Throttle.h b/src/common/Throttle.h index 69e6aa327662..68ca965400f0 100644 --- a/src/common/Throttle.h +++ b/src/common/Throttle.h @@ -5,23 +5,23 @@ #include "Cond.h" class Throttle { - __u64 count, want, max; + uint64_t count, want, max; Mutex lock; Cond cond; public: - Throttle(__u64 m = 0) : count(0), max(m), + Throttle(uint64_t m = 0) : count(0), max(m), lock("Throttle::lock") {} private: - void _reset_max(__u64 m) { + void _reset_max(uint64_t m) { if (m) { if (m < max) cond.SignalAll(); max = m; } } - bool _wait(__u64 c) { + bool _wait(uint64_t c) { bool waited = false; while (max && count + c > max) { waited = true; @@ -31,24 +31,24 @@ private: } public: - __u64 get_current() { + uint64_t get_current() { Mutex::Locker l(lock); return count; } - bool wait(__u64 m = 0) { + bool wait(uint64_t m = 0) { Mutex::Locker l(lock); _reset_max(m); return _wait(0); } - __u64 take(__u64 c = 1) { + uint64_t take(uint64_t c = 1) { Mutex::Locker l(lock); count += c; return count; } - bool get(__u64 c = 1, __u64 m = 0) { + bool get(uint64_t c = 1, uint64_t m = 0) { Mutex::Locker l(lock); _reset_max(m); bool waited = _wait(c); @@ -56,7 +56,7 @@ public: return waited; } - __u64 put(__u64 c = 1) { + uint64_t put(uint64_t c = 1) { Mutex::Locker l(lock); cond.SignalAll(); count -= c; diff --git a/src/common/cas.cc b/src/common/cas.cc index 13a0a2da3fc2..5505097ee5dd 100644 --- a/src/common/cas.cc +++ b/src/common/cas.cc @@ -8,7 +8,7 @@ object_t calc_cas_name(bufferlist &bl) } -void find_rabin_markers(bufferlist &bl, __u64 bloff, list<__u64> &chunks_offsets) +void find_rabin_markers(bufferlist &bl, uint64_t bloff, list &chunks_offsets) { diff --git a/src/common/debug.cc b/src/common/debug.cc index 097a980cf755..dd6184e37126 100644 --- a/src/common/debug.cc +++ b/src/common/debug.cc @@ -113,7 +113,7 @@ int _dout_rename_output_file() // after calling daemon() return 0; } -int _dout_create_courtesy_output_symlink(const char *type, __s64 n) +int _dout_create_courtesy_output_symlink(const char *type, int64_t n) { char name[20]; snprintf(name, sizeof(name), "%s%lld", type, (unsigned long long)n); diff --git a/src/common/debug.h b/src/common/debug.h index 95c261e322e7..792b379a1feb 100644 --- a/src/common/debug.h +++ b/src/common/debug.h @@ -22,7 +22,7 @@ extern bool _dout_is_open; extern void _dout_open_log(); extern int _dout_rename_output_file(); // after calling daemon() -extern int _dout_create_courtesy_output_symlink(const char *type, __s64 n); +extern int _dout_create_courtesy_output_symlink(const char *type, int64_t n); extern int _dout_create_courtesy_output_symlink(const char *name); static inline void _dout_check_log() { diff --git a/src/config.h b/src/config.h index d9c651e2a5ef..1d2fe37a1226 100644 --- a/src/config.h +++ b/src/config.h @@ -204,7 +204,7 @@ struct md_config_t { long long unsigned journaler_batch_max; // mds - __u64 mds_max_file_size; + uint64_t mds_max_file_size; int mds_cache_size; float mds_cache_mid; int mds_mem_max; diff --git a/src/dumpjournal.cc b/src/dumpjournal.cc index d30fa60a044e..10a121d7072b 100644 --- a/src/dumpjournal.cc +++ b/src/dumpjournal.cc @@ -111,9 +111,9 @@ int main(int argc, const char **argv, const char *envp[]) cond.Wait(lock); lock.Unlock(); - __u64 start = journaler->get_read_pos(); - __u64 end = journaler->get_write_pos(); - __u64 len = end-start; + uint64_t start = journaler->get_read_pos(); + uint64_t end = journaler->get_write_pos(); + uint64_t len = end-start; cout << "journal is " << start << "~" << len << std::endl; Filer filer(objecter); diff --git a/src/ebofs/BlockDevice.cc b/src/ebofs/BlockDevice.cc index d0adbbda0e54..e3c958a668e3 100644 --- a/src/ebofs/BlockDevice.cc +++ b/src/ebofs/BlockDevice.cc @@ -641,8 +641,8 @@ int BlockDevice::_read(int fd, block_t bno, unsigned num, bufferlist& bl) assert(fd > 0); - __u64 offset = bno * EBOFS_BLOCK_SIZE; - __u64 actual = ::lseek64(fd, offset, SEEK_SET); + uint64_t offset = bno * EBOFS_BLOCK_SIZE; + uint64_t actual = ::lseek64(fd, offset, SEEK_SET); assert(actual == offset); size_t len = num*EBOFS_BLOCK_SIZE; @@ -677,9 +677,9 @@ int BlockDevice::_write(int fd, unsigned bno, unsigned num, bufferlist& bl) assert(fd > 0); while (1) { - __u64 offset = (__u64)bno << EBOFS_BLOCK_BITS; - assert((__u64)bno * (__u64)EBOFS_BLOCK_SIZE == offset); - __u64 actual = ::lseek64(fd, offset, SEEK_SET); + uint64_t offset = (uint64_t)bno << EBOFS_BLOCK_BITS; + assert((uint64_t)bno * (uint64_t)EBOFS_BLOCK_SIZE == offset); + uint64_t actual = ::lseek64(fd, offset, SEEK_SET); assert(actual == offset); // write buffers diff --git a/src/ebofs/BufferCache.cc b/src/ebofs/BufferCache.cc index d909b5e0ee59..5866ce10cd29 100644 --- a/src/ebofs/BufferCache.cc +++ b/src/ebofs/BufferCache.cc @@ -19,12 +19,12 @@ #define DOUT_SUBSYS ebofs -void do_apply_partial(bufferlist& bl, map<__u64, bufferlist>& pm) +void do_apply_partial(bufferlist& bl, map& pm) { assert(bl.length() == (unsigned)EBOFS_BLOCK_SIZE); //assert(partial_is_complete()); //cout << "apply_partial" << std::endl; - for (map<__u64, bufferlist>::iterator i = pm.begin(); + for (map::iterator i = pm.begin(); i != pm.end(); i++) { //cout << "do_apply_partial at " << i->first << "~" << i->second.length() << std::endl; @@ -41,7 +41,7 @@ void do_apply_partial(bufferlist& bl, map<__u64, bufferlist>& pm) #define dout_prefix *_dout << dbeginl << "ebofs." << *this << "." -void BufferHead::add_partial(__u64 off, bufferlist& p) +void BufferHead::add_partial(uint64_t off, bufferlist& p) { unsigned len = p.length(); assert(len <= (unsigned)EBOFS_BLOCK_SIZE); @@ -49,7 +49,7 @@ void BufferHead::add_partial(__u64 off, bufferlist& p) assert(off + len <= EBOFS_BLOCK_SIZE); // trim any existing that overlaps - map<__u64, bufferlist>::iterator i = partial.begin(); + map::iterator i = partial.begin(); while (i != partial.end()) { // is [off,off+len)... // past i? @@ -80,7 +80,7 @@ void BufferHead::add_partial(__u64 off, bufferlist& p) // overlap head of i? if (off <= i->first && off+len < i->first + i->second.length()) { // move i (make new tail). - __u64 tailoff = off+len; + uint64_t tailoff = off+len; unsigned trim = tailoff - i->first; partial[tailoff].substr_of(i->second, trim, i->second.length()-trim); partial.erase(i++); // should now be at tailoff @@ -224,9 +224,9 @@ void ObjectCache::rx_finish(ioh_t ioh, block_t start, block_t length, bufferlist assert(exv[0].start != 0); block_t cur_block = exv[0].start; - __u64 off_in_bl = (bh->start() - start) * EBOFS_BLOCK_SIZE; + uint64_t off_in_bl = (bh->start() - start) * EBOFS_BLOCK_SIZE; assert(off_in_bl >= 0); - __u64 len_in_bl = bh->length() * EBOFS_BLOCK_SIZE; + uint64_t len_in_bl = bh->length() * EBOFS_BLOCK_SIZE; // verify csum csum_t want = *bh->oc->on->get_extent_csum_ptr(bh->start(), 1); @@ -239,16 +239,16 @@ void ObjectCache::rx_finish(ioh_t ioh, block_t start, block_t length, bufferlist *bh->oc->on->get_extent_csum_ptr(bh->start(), 1) = got; bh->oc->on->data_csum += got - want; - interval_set<__u64> bad; + interval_set bad; bad.insert(bh->start()*EBOFS_BLOCK_SIZE, EBOFS_BLOCK_SIZE); bh->oc->on->bad_byte_extents.union_of(bad); - interval_set<__u64> over; - for (map<__u64,bufferlist>::iterator q = bh->partial.begin(); + interval_set over; + for (map::iterator q = bh->partial.begin(); q != bh->partial.end(); q++) over.insert(bh->start()*EBOFS_BLOCK_SIZE+q->first, q->second.length()); - interval_set<__u64> new_over; + interval_set new_over; new_over.intersection_of(over, bh->oc->on->bad_byte_extents); bh->oc->on->bad_byte_extents.subtract(new_over); } diff --git a/src/ebofs/BufferCache.h b/src/ebofs/BufferCache.h index 133b15d4231b..86173c74e97d 100644 --- a/src/ebofs/BufferCache.h +++ b/src/ebofs/BufferCache.h @@ -55,7 +55,7 @@ class BufferHead : public LRUObject { ioh_t tx_ioh; // block_t tx_block; - map<__u64, bufferlist> partial; // partial dirty content overlayed onto incoming data + map partial; // partial dirty content overlayed onto incoming data map > waitfor_read; @@ -173,8 +173,8 @@ class BufferHead : public LRUObject { shadows.clear(); } - void copy_partial_substr(__u64 start, __u64 end, bufferlist& bl) { - map<__u64, bufferlist>::iterator i = partial.begin(); + void copy_partial_substr(uint64_t start, uint64_t end, bufferlist& bl) { + map::iterator i = partial.begin(); // skip first bits (fully to left) while ((i->first + i->second.length() < start) && @@ -188,7 +188,7 @@ class BufferHead : public LRUObject { unsigned bhlen = MIN(end-start, i->second.length()); bl.substr_of( i->second, bhoff, bhlen ); - __u64 pos = i->first + i->second.length(); + uint64_t pos = i->first + i->second.length(); // have continuous to end? for (i++; i != partial.end(); i++) { @@ -212,8 +212,8 @@ class BufferHead : public LRUObject { assert(bl.length() == (unsigned)(end-start)); } - bool have_partial_range(__u64 start, __u64 end) { - map<__u64, bufferlist>::iterator i = partial.begin(); + bool have_partial_range(uint64_t start, uint64_t end) { + map::iterator i = partial.begin(); // skip first bits (fully to left) while ((i->first + i->second.length() < start) && @@ -223,7 +223,7 @@ class BufferHead : public LRUObject { // have start? if (i->first > start) return false; - __u64 pos = i->first + i->second.length(); + uint64_t pos = i->first + i->second.length(); // have continuous to end? for (i++; i != partial.end(); i++) { @@ -238,12 +238,12 @@ class BufferHead : public LRUObject { return false; } - bool partial_is_complete(__u64 size) { + bool partial_is_complete(uint64_t size) { return have_partial_range( 0, MIN(size, EBOFS_BLOCK_SIZE) ); } void apply_partial(); - void add_partial(__u64 off, bufferlist& p); + void add_partial(uint64_t off, bufferlist& p); void take_read_waiters(list& finished) { for (map >::iterator p = waitfor_read.begin(); @@ -455,13 +455,13 @@ class BufferCache { Cond flush_cond; int stat_waiter; - __u64 stat_all; - __u64 stat_clean, stat_corrupt; - __u64 stat_dirty; - __u64 stat_rx; - __u64 stat_tx; - __u64 stat_partial; - __u64 stat_missing; + uint64_t stat_all; + uint64_t stat_clean, stat_corrupt; + uint64_t stat_dirty; + uint64_t stat_rx; + uint64_t stat_tx; + uint64_t stat_partial; + uint64_t stat_missing; int partial_reads; @@ -480,11 +480,11 @@ class BufferCache { {} - __u64 get_size() { + uint64_t get_size() { assert(stat_clean+stat_dirty+stat_rx+stat_tx+stat_partial+stat_corrupt+stat_missing == stat_all); return stat_all; } - __u64 get_trimmable() { + uint64_t get_trimmable() { return stat_clean+stat_corrupt; } @@ -559,11 +559,11 @@ class BufferCache { } stat_all -= bh->length(); } - __u64 get_stat_tx() { return stat_tx; } - __u64 get_stat_rx() { return stat_rx; } - __u64 get_stat_dirty() { return stat_dirty; } - __u64 get_stat_clean() { return stat_clean; } - __u64 get_stat_partial() { return stat_partial; } + uint64_t get_stat_tx() { return stat_tx; } + uint64_t get_stat_rx() { return stat_rx; } + uint64_t get_stat_dirty() { return stat_dirty; } + uint64_t get_stat_clean() { return stat_clean; } + uint64_t get_stat_partial() { return stat_partial; } map &get_unflushed(int what) { diff --git a/src/ebofs/Ebofs.cc b/src/ebofs/Ebofs.cc index 4f8307b9d718..1112a04f4441 100644 --- a/src/ebofs/Ebofs.cc +++ b/src/ebofs/Ebofs.cc @@ -139,7 +139,7 @@ int Ebofs::mount() while (1) { bufferlist bl; - __u64 seq; + uint64_t seq; if (!journal->read_entry(bl, seq)) { dout(3) << "mount replay: end of journal, done." << dendl; break; @@ -472,7 +472,7 @@ int Ebofs::commit_thread_entry() commit_starting = false; // --- get ready for a new epoch --- - __u64 last_op = op_seq; + uint64_t last_op = op_seq; super_epoch++; dirty = false; @@ -859,7 +859,7 @@ csum_t Ebofs::encode_onode(Onode *on, bufferlist& bl, unsigned& off) } // bad byte extents - for (map<__u64,__u64>::iterator p = on->bad_byte_extents.m.begin(); + for (map::iterator p = on->bad_byte_extents.m.begin(); p != on->bad_byte_extents.m.end(); p++) { extent_t o = {p->first, p->second}; @@ -1357,13 +1357,13 @@ void Ebofs::trim_buffer_cache() ebofs_lock.Unlock(); } -void Ebofs::trim_bc(__s64 max) +void Ebofs::trim_bc(int64_t max) { if (max < 0) max = g_conf.ebofs_bc_size; dout(10) << "trim_bc start: size " << bc.get_size() << ", trimmable " << bc.get_trimmable() << ", max " << max << dendl; - while (bc.get_size() > (__u64)max && + while (bc.get_size() > (uint64_t)max && bc.get_trimmable()) { BufferHead *bh = (BufferHead*) bc.lru_rest.lru_expire(); if (!bh) break; @@ -1637,11 +1637,11 @@ void Ebofs::alloc_write(Onode *on, } -int Ebofs::check_partial_edges(Onode *on, __u64 off, __u64 len, +int Ebofs::check_partial_edges(Onode *on, uint64_t off, uint64_t len, bool &partial_head, bool &partial_tail) { // partial block overwrite at head or tail? - __u64 last_block_byte = on->last_block * EBOFS_BLOCK_SIZE; + uint64_t last_block_byte = on->last_block * EBOFS_BLOCK_SIZE; partial_head = (off < last_block_byte) && (off & EBOFS_BLOCK_MASK); partial_tail = ((off+len) < on->object_size) && ((off+len) & EBOFS_BLOCK_MASK); dout(10) << "check_partial_edges on " << *on << " " << off << "~" << len @@ -1684,9 +1684,9 @@ int Ebofs::check_partial_edges(Onode *on, __u64 off, __u64 len, return -1; } if (bh->is_partial()) { - __u64 off_in_bh = off & EBOFS_BLOCK_MASK; - __u64 end_in_bh = MAX(EBOFS_BLOCK_SIZE, off_in_bh+len); - __u64 end = EBOFS_BLOCK_SIZE; + uint64_t off_in_bh = off & EBOFS_BLOCK_MASK; + uint64_t end_in_bh = MAX(EBOFS_BLOCK_SIZE, off_in_bh+len); + uint64_t end = EBOFS_BLOCK_SIZE; if (bh->end()*EBOFS_BLOCK_SIZE > last_block_byte) end = last_block_byte & EBOFS_BLOCK_MASK; if (!(off_in_bh == 0 || bh->have_partial_range(0, off_in_bh)) || @@ -1702,7 +1702,7 @@ int Ebofs::check_partial_edges(Onode *on, __u64 off, __u64 len, return 0; } -int Ebofs::apply_write(Onode *on, __u64 off, __u64 len, const bufferlist& bl) +int Ebofs::apply_write(Onode *on, uint64_t off, uint64_t len, const bufferlist& bl) { ObjectCache *oc = on->get_oc(&bc); //oc->scrub_csums(); @@ -1710,8 +1710,8 @@ int Ebofs::apply_write(Onode *on, __u64 off, __u64 len, const bufferlist& bl) assert(bl.length() == len); // map into blocks - __u64 opos = off; // byte pos in object - __u64 left = len; // bytes left + uint64_t opos = off; // byte pos in object + uint64_t left = len; // bytes left block_t bstart = off / EBOFS_BLOCK_SIZE; block_t blast = (len+off-1) / EBOFS_BLOCK_SIZE; block_t blen = blast-bstart+1; @@ -1724,7 +1724,7 @@ int Ebofs::apply_write(Onode *on, __u64 off, __u64 len, const bufferlist& bl) // -- starting changing stuff -- // extending object? - __u64 old_object_size = on->object_size; + uint64_t old_object_size = on->object_size; if (off+len > on->object_size) { dout(10) << "apply_write extending size on " << *on << ": " << on->object_size << " -> " << off+len << dendl; @@ -1819,8 +1819,8 @@ int Ebofs::apply_write(Onode *on, __u64 off, __u64 len, const bufferlist& bl) if (bh->is_corrupt()) { dout(10) << "apply_write marking non-overwritten bytes bad on corrupt " << *bh << dendl; - interval_set<__u64> bad; - __u64 bs = bh->start() * EBOFS_BLOCK_SIZE; + interval_set bad; + uint64_t bs = bh->start() * EBOFS_BLOCK_SIZE; if (off_in_bh) bad.insert(bs, bs+off_in_bh); if (off_in_bh+len_in_bh < (unsigned)EBOFS_BLOCK_SIZE) bad.insert(bs+off_in_bh+len_in_bh, bs+EBOFS_BLOCK_SIZE-off_in_bh-len_in_bh); @@ -1955,10 +1955,10 @@ int Ebofs::apply_write(Onode *on, __u64 off, __u64 len, const bufferlist& bl) // ok // we're now writing up to a block boundary, or EOF. - assert(off_in_bh+left >= (__u64)(EBOFS_BLOCK_SIZE*bh->length()) || + assert(off_in_bh+left >= (uint64_t)(EBOFS_BLOCK_SIZE*bh->length()) || (opos+left) >= on->object_size); - unsigned len_in_bh = MIN((__u64)bh->length()*EBOFS_BLOCK_SIZE - off_in_bh, + unsigned len_in_bh = MIN((uint64_t)bh->length()*EBOFS_BLOCK_SIZE - off_in_bh, left); assert(len_in_bh <= left); @@ -1986,8 +1986,8 @@ int Ebofs::apply_write(Onode *on, __u64 off, __u64 len, const bufferlist& bl) // zero leader? if (off_in_bh && opos > old_object_size) { - __u64 zstart = MAX(0, old_object_size-(__u64)bh->start()*EBOFS_BLOCK_SIZE); - __u64 zlen = off_in_bh - zstart; + uint64_t zstart = MAX(0, old_object_size-(uint64_t)bh->start()*EBOFS_BLOCK_SIZE); + uint64_t zlen = off_in_bh - zstart; dout(15) << "apply_write zeroing bh lead over " << zstart << "~" << zlen << dendl; bh->data.zero(zstart, zlen); } @@ -1999,8 +1999,8 @@ int Ebofs::apply_write(Onode *on, __u64 off, __u64 len, const bufferlist& bl) // zero the past-eof tail, too, to be tidy. if (len_in_bh < bh->data.length()) { - __u64 zstart = off_in_bh+len_in_bh; - __u64 zlen = bh->data.length()-(off_in_bh+len_in_bh); + uint64_t zstart = off_in_bh+len_in_bh; + uint64_t zlen = bh->data.length()-(off_in_bh+len_in_bh); bh->data.zero(zstart, zlen); dout(15) << "apply_write zeroing bh tail over " << zstart << "~" << zlen << dendl; } @@ -2043,7 +2043,7 @@ int Ebofs::apply_write(Onode *on, __u64 off, __u64 len, const bufferlist& bl) } -int Ebofs::apply_zero(Onode *on, __u64 off, size_t len) +int Ebofs::apply_zero(Onode *on, uint64_t off, size_t len) { dout(10) << "apply_zero " << off << "~" << len << " on " << *on << dendl; @@ -2130,7 +2130,7 @@ int Ebofs::apply_zero(Onode *on, __u64 off, size_t len) // *** file i/o *** -int Ebofs::attempt_read(Onode *on, __u64 off, size_t len, bufferlist& bl, +int Ebofs::attempt_read(Onode *on, uint64_t off, size_t len, bufferlist& bl, Cond *will_wait_on, bool *will_wait_on_bool) { dout(10) << "attempt_read " << *on << " " << off << "~" << len << dendl; @@ -2143,8 +2143,8 @@ int Ebofs::attempt_read(Onode *on, __u64 off, size_t len, bufferlist& bl, return -EIO; } if (on->bad_byte_extents.end() > off) { - __u64 bad = on->bad_byte_extents.start_after(off); - if (bad < off+(__u64)len) { + uint64_t bad = on->bad_byte_extents.start_after(off); + if (bad < off+(uint64_t)len) { len = bad-off; dout(10) << "attempt_read corrupt (bad byte extent) at " << bad << ", shortening read to " << len << dendl; } @@ -2191,10 +2191,10 @@ int Ebofs::attempt_read(Onode *on, __u64 off, size_t len, bufferlist& bl, i != partials.end(); i++) { BufferHead *bh = i->second; - __u64 bhstart = (__u64)(bh->start()*EBOFS_BLOCK_SIZE); - __u64 bhend = (__u64)(bh->end()*EBOFS_BLOCK_SIZE); - __u64 start = MAX( off, bhstart ); - __u64 end = MIN( off+(__u64)len, bhend ); + uint64_t bhstart = (uint64_t)(bh->start()*EBOFS_BLOCK_SIZE); + uint64_t bhend = (uint64_t)(bh->end()*EBOFS_BLOCK_SIZE); + uint64_t start = MAX( off, bhstart ); + uint64_t end = MIN( off+(uint64_t)len, bhend ); if (!i->second->have_partial_range(start-bhstart, end-bhstart)) { // wait on this one @@ -2212,7 +2212,7 @@ int Ebofs::attempt_read(Onode *on, __u64 off, size_t len, bufferlist& bl, map::iterator p = partials.begin(); bl.clear(); - __u64 pos = off; + uint64_t pos = off; block_t curblock = bstart; while (curblock <= blast) { BufferHead *bh = 0; @@ -2224,10 +2224,10 @@ int Ebofs::attempt_read(Onode *on, __u64 off, size_t len, bufferlist& bl, p++; } else assert(0); - __u64 bhstart = (__u64)(bh->start()*EBOFS_BLOCK_SIZE); - __u64 bhend = (__u64)(bh->end()*EBOFS_BLOCK_SIZE); - __u64 start = MAX( pos, bhstart ); - __u64 end = MIN( off+(__u64)len, bhend ); + uint64_t bhstart = (uint64_t)(bh->start()*EBOFS_BLOCK_SIZE); + uint64_t bhend = (uint64_t)(bh->end()*EBOFS_BLOCK_SIZE); + uint64_t start = MAX( pos, bhstart ); + uint64_t end = MIN( off+(uint64_t)len, bhend ); if (bh->is_corrupt()) { if (bl.length()) { @@ -2284,7 +2284,7 @@ int Ebofs::attempt_read(Onode *on, __u64 off, size_t len, bufferlist& bl, * return value of -1 if onode isn't loaded. otherwise, the number * of extents that need to be read (i.e. # of seeks) */ -int Ebofs::is_cached(coll_t cid, pobject_t oid, __u64 off, size_t len) +int Ebofs::is_cached(coll_t cid, pobject_t oid, uint64_t off, size_t len) { ebofs_lock.Lock(); int r = _is_cached(oid, off, len); @@ -2292,7 +2292,7 @@ int Ebofs::is_cached(coll_t cid, pobject_t oid, __u64 off, size_t len) return r; } -int Ebofs::_is_cached(pobject_t oid, __u64 off, size_t len) +int Ebofs::_is_cached(pobject_t oid, uint64_t off, size_t len) { if (!have_onode(oid)) { dout(7) << "_is_cached " << oid << " " << off << "~" << len << " ... onode " << dendl; @@ -2335,14 +2335,14 @@ int Ebofs::_is_cached(pobject_t oid, __u64 off, size_t len) */ } -void Ebofs::trim_from_cache(coll_t cid, pobject_t oid, __u64 off, size_t len) +void Ebofs::trim_from_cache(coll_t cid, pobject_t oid, uint64_t off, size_t len) { ebofs_lock.Lock(); _trim_from_cache(oid, off, len); ebofs_lock.Unlock(); } -void Ebofs::_trim_from_cache(pobject_t oid, __u64 off, size_t len) +void Ebofs::_trim_from_cache(pobject_t oid, uint64_t off, size_t len) { // be careful not to load it if we don't have it if (!have_onode(oid)) { @@ -2368,7 +2368,7 @@ void Ebofs::_trim_from_cache(pobject_t oid, __u64 off, size_t len) int Ebofs::read(coll_t cid, pobject_t oid, - __u64 off, size_t len, + uint64_t off, size_t len, bufferlist& bl) { ebofs_lock.Lock(); @@ -2377,7 +2377,7 @@ int Ebofs::read(coll_t cid, pobject_t oid, return r; } -int Ebofs::_read(pobject_t oid, __u64 off, size_t len, bufferlist& bl) +int Ebofs::_read(pobject_t oid, uint64_t off, size_t len, bufferlist& bl) { dout(7) << "_read " << oid << " " << off << "~" << len << dendl; @@ -2400,7 +2400,7 @@ int Ebofs::_read(pobject_t oid, __u64 off, size_t len, bufferlist& bl) } size_t try_len = len ? len:on->object_size; - size_t will_read = MIN(off+(__u64)try_len, on->object_size) - off; + size_t will_read = MIN(off+(uint64_t)try_len, on->object_size) - off; bool done; r = attempt_read(on, off, will_read, bl, &cond, &done); @@ -2513,8 +2513,8 @@ unsigned Ebofs::_apply_transaction(Transaction& t) { coll_t cid = t.get_cid(); pobject_t oid = t.get_oid(); - __u64 offset = t.get_length(); - __u64 len = t.get_length(); + uint64_t offset = t.get_length(); + uint64_t len = t.get_length(); bufferlist& bl = t.get_bl(); if (_write(cid, oid, offset, len, bl) < 0) { dout(7) << "apply_transaction fail on _write" << dendl; @@ -2527,8 +2527,8 @@ unsigned Ebofs::_apply_transaction(Transaction& t) { coll_t cid = t.get_cid(); pobject_t oid = t.get_oid(); - __u64 offset = t.get_length(); - __u64 len = t.get_length(); + uint64_t offset = t.get_length(); + uint64_t len = t.get_length(); if (_zero(cid, oid, offset, len) < 0) { dout(7) << "apply_transaction fail on _zero" << dendl; r &= bit; @@ -2540,8 +2540,8 @@ unsigned Ebofs::_apply_transaction(Transaction& t) { coll_t cid = t.get_cid(); pobject_t oid = t.get_oid(); - __u64 offset = t.get_length(); - __u64 len = t.get_length(); + uint64_t offset = t.get_length(); + uint64_t len = t.get_length(); _trim_from_cache(oid, offset, len); } break; @@ -2550,7 +2550,7 @@ unsigned Ebofs::_apply_transaction(Transaction& t) { coll_t cid = t.get_cid(); pobject_t oid = t.get_oid(); - __u64 offset = t.get_length(); + uint64_t offset = t.get_length(); if (_truncate(cid, oid, offset) < 0) { dout(7) << "apply_transaction fail on _truncate" << dendl; r &= bit; @@ -2623,8 +2623,8 @@ unsigned Ebofs::_apply_transaction(Transaction& t) coll_t cid = t.get_cid(); pobject_t oid = t.get_oid(); pobject_t noid = t.get_oid(); - __u64 off = t.get_length(); - __u64 len = t.get_length(); + uint64_t off = t.get_length(); + uint64_t len = t.get_length(); if (_clone_range(cid, oid, noid, off, len) < 0) { dout(7) << "apply_transaction fail on _clone_range" << dendl; r &= bit; @@ -2726,7 +2726,7 @@ int Ebofs::_touch(coll_t cid, pobject_t oid) } -int Ebofs::_write(coll_t cid, pobject_t oid, __u64 offset, size_t length, const bufferlist& bl) +int Ebofs::_write(coll_t cid, pobject_t oid, uint64_t offset, size_t length, const bufferlist& bl) { dout(7) << "_write " << cid << " " << oid << " " << offset << "~" << length << dendl; assert(bl.length() == length); @@ -2805,7 +2805,7 @@ int Ebofs::_write(coll_t cid, pobject_t oid, __u64 offset, size_t length, const return length; } -int Ebofs::_zero(coll_t cid, pobject_t oid, __u64 offset, size_t length) +int Ebofs::_zero(coll_t cid, pobject_t oid, uint64_t offset, size_t length) { dout(7) << "_zero " << oid << " " << offset << "~" << length << dendl; @@ -2822,7 +2822,7 @@ int Ebofs::_zero(coll_t cid, pobject_t oid, __u64 offset, size_t length) if (length > 0 && offset < on->object_size) { - if (offset + (__u64)length >= on->object_size) { + if (offset + (uint64_t)length >= on->object_size) { _truncate(cid, oid, offset); } else { while (1) { @@ -2848,7 +2848,7 @@ int Ebofs::_zero(coll_t cid, pobject_t oid, __u64 offset, size_t length) int Ebofs::write(coll_t cid, pobject_t oid, - __u64 off, size_t len, + uint64_t off, size_t len, const bufferlist& bl, Context *onsafe) { ebofs_lock.Lock(); @@ -2875,7 +2875,7 @@ int Ebofs::write(coll_t cid, pobject_t oid, return r; } -int Ebofs::zero(coll_t cid, pobject_t oid, __u64 off, size_t len, Context *onsafe) +int Ebofs::zero(coll_t cid, pobject_t oid, uint64_t off, size_t len, Context *onsafe) { ebofs_lock.Lock(); @@ -2942,7 +2942,7 @@ int Ebofs::remove(coll_t cid, pobject_t oid, Context *onsafe) return r; } -int Ebofs::_truncate(coll_t cid, pobject_t oid, __u64 size) +int Ebofs::_truncate(coll_t cid, pobject_t oid, uint64_t size) { dout(7) << "_truncate " << oid << " size " << size << dendl; @@ -3001,7 +3001,7 @@ int Ebofs::_truncate(coll_t cid, pobject_t oid, __u64 size) } -int Ebofs::truncate(coll_t cid, pobject_t oid, __u64 size, Context *onsafe) +int Ebofs::truncate(coll_t cid, pobject_t oid, uint64_t size, Context *onsafe) { ebofs_lock.Lock(); @@ -3106,7 +3106,7 @@ int Ebofs::_clone(coll_t cid, pobject_t from, pobject_t to) } -int Ebofs::_clone_range(coll_t cid, pobject_t from, pobject_t to, __u64 off, __u64 len) +int Ebofs::_clone_range(coll_t cid, pobject_t from, pobject_t to, uint64_t off, uint64_t len) { dout(7) << "_clone_range " << from << " -> " << to << " " << off << "~" << len << dendl; diff --git a/src/ebofs/Ebofs.h b/src/ebofs/Ebofs.h index 13006bf869d4..409688d521b3 100644 --- a/src/ebofs/Ebofs.h +++ b/src/ebofs/Ebofs.h @@ -50,7 +50,7 @@ protected: bool mounted, unmounting, dirty; bool readonly; version_t super_epoch; - __u64 op_seq; + uint64_t op_seq; bool commit_starting; bool commit_thread_started; Cond commit_cond; // to wake up the commit thread @@ -174,7 +174,7 @@ protected: version_t trigger_commit(); void commit_bc_wait(version_t epoch); - void trim_bc(__s64 max = -1); + void trim_bc(int64_t max = -1); public: void kick_idle(); @@ -191,7 +191,7 @@ protected: protected: - int check_partial_edges(Onode *on, __u64 off, __u64 len, + int check_partial_edges(Onode *on, uint64_t off, uint64_t len, bool &partial_head, bool &partial_tail); void alloc_write(Onode *on, @@ -199,9 +199,9 @@ protected: interval_set& alloc, block_t& old_bfirst, block_t& old_blast, csum_t& old_csum_first, csum_t& old_csum_last); - int apply_write(Onode *on, __u64 off, __u64 len, const bufferlist& bl); - int apply_zero(Onode *on, __u64 off, size_t len); - int attempt_read(Onode *on, __u64 off, size_t len, bufferlist& bl, + int apply_write(Onode *on, uint64_t off, uint64_t len, const bufferlist& bl); + int apply_zero(Onode *on, uint64_t off, size_t len); + int attempt_read(Onode *on, uint64_t off, size_t len, bufferlist& bl, Cond *will_wait_on, bool *will_wait_on_bool); Finisher finisher; @@ -259,15 +259,15 @@ protected: // object interface bool exists(coll_t cid, pobject_t); int stat(coll_t cid, pobject_t, struct stat*); - int read(coll_t cid, pobject_t, __u64 off, size_t len, bufferlist& bl); - int is_cached(coll_t cid, pobject_t oid, __u64 off, size_t len); + int read(coll_t cid, pobject_t, uint64_t off, size_t len, bufferlist& bl); + int is_cached(coll_t cid, pobject_t oid, uint64_t off, size_t len); - int write(coll_t cid, pobject_t oid, __u64 off, size_t len, const bufferlist& bl, Context *onsafe); - int zero(coll_t cid, pobject_t oid, __u64 off, size_t len, Context *onsafe); - int truncate(coll_t cid, pobject_t oid, __u64 size, Context *onsafe=0); + int write(coll_t cid, pobject_t oid, uint64_t off, size_t len, const bufferlist& bl, Context *onsafe); + int zero(coll_t cid, pobject_t oid, uint64_t off, size_t len, Context *onsafe); + int truncate(coll_t cid, pobject_t oid, uint64_t size, Context *onsafe=0); int remove(coll_t cid, pobject_t oid, Context *onsafe=0); bool write_will_block(); - void trim_from_cache(coll_t cid, pobject_t oid, __u64 off, size_t len); + void trim_from_cache(coll_t cid, pobject_t oid, uint64_t off, size_t len); int rename(pobject_t from, pobject_t to); int clone(coll_t cid, pobject_t from, pobject_t to, Context *onsafe); @@ -325,8 +325,8 @@ private: // private interface -- use if caller already holds lock unsigned _apply_transaction(Transaction& t); - int _read(pobject_t oid, __u64 off, size_t len, bufferlist& bl); - int _is_cached(pobject_t oid, __u64 off, size_t len); + int _read(pobject_t oid, uint64_t off, size_t len, bufferlist& bl); + int _is_cached(pobject_t oid, uint64_t off, size_t len); int _stat(pobject_t oid, struct stat *st); int _getattr(pobject_t oid, const char *name, void *value, size_t size); int _getattr(pobject_t oid, const char *name, bufferptr& bp); @@ -335,13 +335,13 @@ private: bool _write_will_block(); int _touch(coll_t cid, pobject_t oid); - int _write(coll_t cid, pobject_t oid, __u64 off, size_t len, const bufferlist& bl); - void _trim_from_cache(pobject_t oid, __u64 off, size_t len); - int _truncate(coll_t cid, pobject_t oid, __u64 size); - int _zero(coll_t cid, pobject_t oid, __u64 offset, size_t length); + int _write(coll_t cid, pobject_t oid, uint64_t off, size_t len, const bufferlist& bl); + void _trim_from_cache(pobject_t oid, uint64_t off, size_t len); + int _truncate(coll_t cid, pobject_t oid, uint64_t size); + int _zero(coll_t cid, pobject_t oid, uint64_t offset, size_t length); int _remove(coll_t cid, pobject_t oid); int _clone(coll_t cid, pobject_t from, pobject_t to); - int _clone_range(coll_t cid, pobject_t from, pobject_t to, __u64 off, __u64 len); + int _clone_range(coll_t cid, pobject_t from, pobject_t to, uint64_t off, uint64_t len); int _setattr(pobject_t oid, const char *name, const void *value, size_t size); int _setattrs(pobject_t oid, map& attrset); int _rmattr(pobject_t oid, const char *name); diff --git a/src/ebofs/Onode.h b/src/ebofs/Onode.h index c151b5126538..d715bbc0e612 100644 --- a/src/ebofs/Onode.h +++ b/src/ebofs/Onode.h @@ -77,8 +77,8 @@ public: extent_t onode_loc; epoch_t last_alloc_epoch; // epoch i last allocated for - __u64 object_size; - __u64 alloc_blocks, last_block; + uint64_t object_size; + uint64_t alloc_blocks, last_block; csum_t data_csum; bool readonly; @@ -87,7 +87,7 @@ public: map attr; map extent_map; - interval_set<__u64> bad_byte_extents; + interval_set bad_byte_extents; interval_set uncommitted; diff --git a/src/ebofs/csum.h b/src/ebofs/csum.h index 9c9f0618b85e..dbbf3989c72a 100644 --- a/src/ebofs/csum.h +++ b/src/ebofs/csum.h @@ -15,19 +15,19 @@ #ifndef __EBOFS_CSUM_H #define __EBOFS_CSUM_H -typedef __u64 csum_t; +typedef uint64_t csum_t; /* * physically and logically aligned buffer. yay. */ -inline __u64 calc_csum(const char *start, int len) { +inline uint64_t calc_csum(const char *start, int len) { // must be 64-bit aligned assert(((unsigned long)start & 7) == 0); assert((len & 7) == 0); - __u64 *p = (__u64*)start; - __u64 *end = (__u64*)(start + len); - __u64 csum = 0; + uint64_t *p = (uint64_t*)start; + uint64_t *end = (uint64_t*)(start + len); + uint64_t csum = 0; while (p < end) { csum += *p; p++; @@ -39,13 +39,13 @@ inline __u64 calc_csum(const char *start, int len) { * arbitrarily aligned buffer. buffer alignment must match logical alignment. * i.e., buffer content is aligned, but has non-aligned boundaries. */ -inline __u64 calc_csum_unaligned(const char *start, int len) { +inline uint64_t calc_csum_unaligned(const char *start, int len) { const char *end = start + len; - __u64 csum = 0; + uint64_t csum = 0; // front while (start < end && (unsigned long)start & 7) { - csum += (__u64)(*start) << (8*(8 - ((unsigned long)start & 7))); + csum += (uint64_t)(*start) << (8*(8 - ((unsigned long)start & 7))); start++; } if (start == end) @@ -54,13 +54,13 @@ inline __u64 calc_csum_unaligned(const char *start, int len) { // middle, aligned const char *fastend = end - 7; while (start < fastend) { - csum += *(__u64*)start; - start += sizeof(__u64); + csum += *(uint64_t*)start; + start += sizeof(uint64_t); } // tail while (start < end) { - csum += (__u64)(*start) << (8*(8 - ((unsigned long)start & 7))); + csum += (uint64_t)(*start) << (8*(8 - ((unsigned long)start & 7))); start++; } return csum; @@ -70,16 +70,16 @@ inline __u64 calc_csum_unaligned(const char *start, int len) { /* * arbitrarily aligned buffer, with arbitrary logical alignment */ -inline __u64 calc_csum_realign(const char *start, int len, int off) { +inline uint64_t calc_csum_realign(const char *start, int len, int off) { const char *end = start + len; - __u64 csum = 0; + uint64_t csum = 0; if (((unsigned long)start & 7) == ((unsigned long)off & 7)) return calc_csum_unaligned(start, len); // lucky us, start and off alignment matches. // do it the slow way. yucky! while (start < end) { - csum += (__u64)(*start) << (8*(8 - (off & 7))); + csum += (uint64_t)(*start) << (8*(8 - (off & 7))); start++; off++; } return csum; diff --git a/src/ebofs/mkfs.ebofs.cc b/src/ebofs/mkfs.ebofs.cc index 9cbc000e3f48..298806889490 100644 --- a/src/ebofs/mkfs.ebofs.cc +++ b/src/ebofs/mkfs.ebofs.cc @@ -71,8 +71,8 @@ int main(int argc, const char **argv) pobject_t oid(0, 0, object_t(1,2)); - __u64 pos = 0; - __u64 sz = 16; + uint64_t pos = 0; + uint64_t sz = 16; bufferlist bl; bl.append(crap, sz); @@ -173,7 +173,7 @@ int main(int argc, const char **argv) char *p = bl.c_str(); - __u64 o = 0; + uint64_t o = 0; for (int i=0; i names; + uint64_t mask; + map names; FeatureSet() : mask(0), names() {} void insert(Feature f) { @@ -109,11 +109,11 @@ struct CompatSet { */ CompatSet unsupported(CompatSet& other) { CompatSet diff; - __u64 other_compat = + uint64_t other_compat = ((other.compat.mask ^ compat.mask) & other.compat.mask); - __u64 other_ro_compat = + uint64_t other_ro_compat = ((other.ro_compat.mask ^ ro_compat.mask) & other.ro_compat.mask); - __u64 other_incompat = + uint64_t other_incompat = ((other.incompat.mask ^ incompat.mask) & other.incompat.mask); for (int i = 0; i < 64; ++i) { int mask = 1 << i; diff --git a/src/include/LogEntry.h b/src/include/LogEntry.h index 93911baf4c85..26a61930dc8b 100644 --- a/src/include/LogEntry.h +++ b/src/include/LogEntry.h @@ -29,10 +29,10 @@ typedef enum { struct LogEntryKey { entity_inst_t who; utime_t stamp; - __u64 seq; + uint64_t seq; LogEntryKey() {} - LogEntryKey(entity_inst_t w, utime_t t, __u64 s) : who(w), stamp(t), seq(s) {} + LogEntryKey(entity_inst_t w, utime_t t, uint64_t s) : who(w), stamp(t), seq(s) {} void encode(bufferlist& bl) const { ::encode(who, bl); @@ -54,7 +54,7 @@ static inline bool operator==(const LogEntryKey& l, const LogEntryKey& r) { struct LogEntry { entity_inst_t who; utime_t stamp; - __u64 seq; + uint64_t seq; log_type type; string msg; diff --git a/src/include/byteorder.h b/src/include/byteorder.h index 3907d8902057..0d20145baa3f 100644 --- a/src/include/byteorder.h +++ b/src/include/byteorder.h @@ -20,7 +20,7 @@ static __inline__ __u32 swab32(__u32 val) ((val << 8) & 0xff0000) | ((val << 24))); } -static __inline__ __u64 swab64(__u64 val) +static __inline__ uint64_t swab64(uint64_t val) { return (( val >> 56) | ((val >> 40) & 0xff00ull) | @@ -74,7 +74,7 @@ MAKE_LE_CLASS(16) #define cpu_to_le32(x) (x) #define cpu_to_le16(x) (x) */ -#define le64_to_cpu(x) ((__u64)x) +#define le64_to_cpu(x) ((uint64_t)x) #define le32_to_cpu(x) ((__u32)x) #define le16_to_cpu(x) ((__u16)x) diff --git a/src/include/encoding.h b/src/include/encoding.h index af79670c2d47..ce34b14afa1a 100644 --- a/src/include/encoding.h +++ b/src/include/encoding.h @@ -65,22 +65,22 @@ inline void decode(bool &v, bufferlist::iterator& p) { // int types #define WRITE_INTTYPE_ENCODER(type, etype) \ - inline void encode(__##type v, bufferlist& bl) { \ + inline void encode(type v, bufferlist& bl) { \ __##etype e = init_##etype(v); \ encode_raw(e, bl); \ } \ - inline void decode(__##type &v, bufferlist::iterator& p) { \ + inline void decode(type &v, bufferlist::iterator& p) { \ __##etype e; \ decode_raw(e, p); \ v = e; \ } -WRITE_INTTYPE_ENCODER(u64, le64) -WRITE_INTTYPE_ENCODER(s64, le64) -WRITE_INTTYPE_ENCODER(u32, le32) -WRITE_INTTYPE_ENCODER(s32, le32) -WRITE_INTTYPE_ENCODER(u16, le16) -WRITE_INTTYPE_ENCODER(s16, le16) +WRITE_INTTYPE_ENCODER(uint64_t, le64) +WRITE_INTTYPE_ENCODER(int64_t, le64) +WRITE_INTTYPE_ENCODER(uint32_t, le32) +WRITE_INTTYPE_ENCODER(int32_t, le32) +WRITE_INTTYPE_ENCODER(uint16_t, le16) +WRITE_INTTYPE_ENCODER(int16_t, le16) diff --git a/src/include/hash.h b/src/include/hash.h index 7f95dd74f828..bb1499cada46 100644 --- a/src/include/hash.h +++ b/src/include/hash.h @@ -57,12 +57,6 @@ template<> struct rjhash { } }; -template<> struct rjhash<__u64> { - inline size_t operator()(const __u64 x) const { - return rjhash64(x); - } -}; - #if defined(__CYGWIN__) || defined(DARWIN) template<> struct rjhash { inline size_t operator()(const size_t x) const { diff --git a/src/include/interval_set.h b/src/include/interval_set.h index 7e6d85a56ac5..60c11b9caa26 100644 --- a/src/include/interval_set.h +++ b/src/include/interval_set.h @@ -34,7 +34,7 @@ template class interval_set { public: map m; // map start -> len - __u64 _size; + uint64_t _size; interval_set() : _size(0) {} diff --git a/src/include/librados.h b/src/include/librados.h index 00e8494bfc55..f684b8183975 100644 --- a/src/include/librados.h +++ b/src/include/librados.h @@ -16,22 +16,22 @@ void rados_deinitialize(); /* pools */ typedef void *rados_pool_t; typedef void *rados_list_ctx_t; -typedef __u64 rados_snap_t; +typedef uint64_t rados_snap_t; struct rados_pool_stat_t { - __u64 num_bytes; // in bytes - __u64 num_kb; // in KB - __u64 num_objects; - __u64 num_object_clones; - __u64 num_object_copies; // num_objects * num_replicas - __u64 num_objects_missing_on_primary; - __u64 num_objects_degraded; - __u64 num_rd, num_rd_kb,num_wr, num_wr_kb; + uint64_t num_bytes; // in bytes + uint64_t num_kb; // in KB + uint64_t num_objects; + uint64_t num_object_clones; + uint64_t num_object_copies; // num_objects * num_replicas + uint64_t num_objects_missing_on_primary; + uint64_t num_objects_degraded; + uint64_t num_rd, num_rd_kb,num_wr, num_wr_kb; }; struct rados_statfs_t { - __u64 kb, kb_used, kb_avail; - __u64 num_objects; + uint64_t kb, kb_used, kb_avail; + uint64_t num_objects; }; int rados_open_pool(const char *name, rados_pool_t *pool); @@ -41,9 +41,9 @@ int rados_lookup_pool(const char *name); void rados_set_snap(rados_pool_t pool, rados_snap_t snap); int rados_create_pool(const char *name); -int rados_create_pool_with_auid(const char *name, __u64 auid); +int rados_create_pool_with_auid(const char *name, uint64_t auid); int rados_delete_pool(const rados_pool_t pool); -int rados_change_pool_auid(const rados_pool_t pool, __u64 auid); +int rados_change_pool_auid(const rados_pool_t pool, uint64_t auid); /* objects */ int rados_list_objects_open(rados_pool_t pool, rados_list_ctx_t *ctx); @@ -68,7 +68,7 @@ int rados_getxattr(rados_pool_t pool, const char *o, const char *name, char *buf int rados_setxattr(rados_pool_t pool, const char *o, const char *name, const char *buf, size_t len); /* misc */ -int rados_stat(rados_pool_t pool, const char *o, __u64 *psize, time_t *pmtime); +int rados_stat(rados_pool_t pool, const char *o, uint64_t *psize, time_t *pmtime); int rados_tmap_update(rados_pool_t pool, const char *o, const char *cmdbuf, size_t cmdbuflen); int rados_exec(rados_pool_t pool, const char *oid, const char *cls, const char *method, const char *in_buf, size_t in_len, char *buf, size_t out_len); diff --git a/src/include/librados.hpp b/src/include/librados.hpp index 21dafd5ec4c1..efb6f1b5c519 100644 --- a/src/include/librados.hpp +++ b/src/include/librados.hpp @@ -14,23 +14,23 @@ namespace librados { typedef void *list_ctx_t; typedef void *pool_t; - typedef __u64 snap_t; - typedef __u64 auid_t; + typedef uint64_t snap_t; + typedef uint64_t auid_t; struct statfs_t { - __u64 kb, kb_used, kb_avail; - __u64 num_objects; + uint64_t kb, kb_used, kb_avail; + uint64_t num_objects; }; struct pool_stat_t { - __u64 num_bytes; // in bytes - __u64 num_kb; // in KB - __u64 num_objects; - __u64 num_object_clones; - __u64 num_object_copies; // num_objects * num_replicas - __u64 num_objects_missing_on_primary; - __u64 num_objects_degraded; - __u64 num_rd, num_rd_kb, num_wr, num_wr_kb; + uint64_t num_bytes; // in bytes + uint64_t num_kb; // in KB + uint64_t num_objects; + uint64_t num_object_clones; + uint64_t num_object_copies; // num_objects * num_replicas + uint64_t num_objects_missing_on_primary; + uint64_t num_objects_degraded; + uint64_t num_rd, num_rd_kb, num_wr, num_wr_kb; }; typedef void *completion_t; @@ -62,7 +62,7 @@ public: int getxattr(pool_t pool, const std::string& oid, const char *name, bufferlist& bl); int setxattr(pool_t pool, const std::string& oid, const char *name, bufferlist& bl); int getxattrs(pool_t pool, const std::string& oid, std::map& attrset); - int stat(pool_t pool, const std::string& oid, __u64 *psize, time_t *pmtime); + int stat(pool_t pool, const std::string& oid, uint64_t *psize, time_t *pmtime); int tmap_update(pool_t pool, const std::string& oid, bufferlist& cmdbl); @@ -83,9 +83,9 @@ public: std::map& stats); int get_fs_stats(statfs_t& result); - int create_pool(const char *name, __u64 auid=0); + int create_pool(const char *name, uint64_t auid=0); int delete_pool(const pool_t& pool); - int change_pool_auid(const pool_t& pool, __u64 auid); + int change_pool_auid(const pool_t& pool, uint64_t auid); int snap_create(const pool_t pool, const char *snapname); int snap_remove(const pool_t pool, const char *snapname); diff --git a/src/include/object.h b/src/include/object.h index 75be694cf69f..916dbd95dd76 100644 --- a/src/include/object.h +++ b/src/include/object.h @@ -81,10 +81,10 @@ namespace __gnu_cxx { struct file_object_t { - __u64 ino, bno; + uint64_t ino, bno; mutable char buf[33]; - file_object_t(__u64 i=0, __u64 b=0) : ino(i), bno(b) { + file_object_t(uint64_t i=0, uint64_t b=0) : ino(i), bno(b) { buf[0] = 0; } @@ -105,11 +105,11 @@ struct file_object_t { // snaps struct snapid_t { - __u64 val; - snapid_t(__u64 v=0) : val(v) {} + uint64_t val; + snapid_t(uint64_t v=0) : val(v) {} snapid_t operator+=(snapid_t o) { val += o.val; return *this; } snapid_t operator++() { ++val; return *this; } - operator __u64() const { return val; } + operator uint64_t() const { return val; } }; inline void encode(snapid_t i, bufferlist &bl) { encode(i.val, bl); } diff --git a/src/include/types.h b/src/include/types.h index 395e61114709..97ad86f4ef0d 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -240,8 +240,8 @@ WRITE_RAW_ENCODER(ceph_mon_statfs_reply) // some basic types // NOTE: these must match ceph_fs.h typedefs -typedef __u64 tid_t; // transaction id -typedef __u64 version_t; +typedef uint64_t tid_t; // transaction id +typedef uint64_t version_t; typedef __u32 epoch_t; // map epoch (32bits -> 13 epochs/second for 10 years) #define O_LAZY 01000000 @@ -252,9 +252,9 @@ typedef struct ceph_fsid ceph_fsid_t; // identify individual mount clients by 64bit value struct client_t { - __s64 v; + int64_t v; - client_t(__s64 _v = -2) : v(_v) {} + client_t(int64_t _v = -2) : v(_v) {} void encode(bufferlist& bl) const { ::encode(v, bl); @@ -272,8 +272,8 @@ static inline bool operator<=(const client_t& l, const client_t& r) { return l.v static inline bool operator>(const client_t& l, const client_t& r) { return l.v > r.v; } static inline bool operator>=(const client_t& l, const client_t& r) { return l.v >= r.v; } -static inline bool operator>=(const client_t& l, __s64 o) { return l.v >= o; } -static inline bool operator<(const client_t& l, __s64 o) { return l.v < o; } +static inline bool operator>=(const client_t& l, int64_t o) { return l.v >= o; } +static inline bool operator<(const client_t& l, int64_t o) { return l.v < o; } inline ostream& operator<<(ostream& out, const client_t& c) { return out << c.v; @@ -284,7 +284,7 @@ inline ostream& operator<<(ostream& out, const client_t& c) { // -------------------------------------- // ino -typedef __u64 _inodeno_t; +typedef uint64_t _inodeno_t; struct inodeno_t { _inodeno_t val; @@ -416,7 +416,7 @@ struct prettybyte_t { inline ostream& operator<<(ostream& out, const prettybyte_t& b) { - __u64 bump_after = 100; + uint64_t bump_after = 100; if (b.v > bump_after << 60) return out << (b.v >> 60) << " EB"; if (b.v > bump_after << 50) @@ -439,7 +439,7 @@ struct kb_t { inline ostream& operator<<(ostream& out, const kb_t& kb) { - __u64 bump_after = 100; + uint64_t bump_after = 100; if (kb.v > bump_after << 40) return out << (kb.v >> 40) << " PB"; if (kb.v > bump_after << 30) diff --git a/src/librados.cc b/src/librados.cc index 5963c8b3813c..36c078c261c4 100644 --- a/src/librados.cc +++ b/src/librados.cc @@ -105,10 +105,10 @@ public: } // snaps - int snap_list(PoolCtx *pool, vector<__u64> *snaps); - int snap_lookup(PoolCtx *pool, const char *name, __u64 *snapid); - int snap_get_name(PoolCtx *pool, __u64 snapid, std::string *s); - int snap_get_stamp(PoolCtx *pool, __u64 snapid, time_t *t); + int snap_list(PoolCtx *pool, vector *snaps); + int snap_lookup(PoolCtx *pool, const char *name, uint64_t *snapid); + int snap_get_name(PoolCtx *pool, uint64_t snapid, std::string *s); + int snap_get_stamp(PoolCtx *pool, uint64_t snapid, time_t *t); int snap_create(const rados_pool_t pool, const char* snapname); int snap_remove(const rados_pool_t pool, const char* snapname); @@ -118,7 +118,7 @@ public: int write_full(PoolCtx& pool, const object_t& oid, bufferlist& bl); int read(PoolCtx& pool, const object_t& oid, off_t off, bufferlist& bl, size_t len); int remove(PoolCtx& pool, const object_t& oid); - int stat(PoolCtx& pool, const object_t& oid, __u64 *psize, time_t *pmtime); + int stat(PoolCtx& pool, const object_t& oid, uint64_t *psize, time_t *pmtime); int tmap_update(PoolCtx& pool, const object_t& oid, bufferlist& cmdbl); int exec(PoolCtx& pool, const object_t& oid, const char *cls, const char *method, bufferlist& inbl, bufferlist& outbl); @@ -595,7 +595,7 @@ int RadosClient::change_pool_auid(const rados_pool_t& pool, unsigned long long a return reply; } -int RadosClient::snap_list(PoolCtx *pool, vector<__u64> *snaps) +int RadosClient::snap_list(PoolCtx *pool, vector *snaps) { Mutex::Locker l(lock); const pg_pool_t *pi = objecter->osdmap->get_pg_pool(pool->poolid); @@ -606,7 +606,7 @@ int RadosClient::snap_list(PoolCtx *pool, vector<__u64> *snaps) return 0; } -int RadosClient::snap_lookup(PoolCtx *pool, const char *name, __u64 *snapid) +int RadosClient::snap_lookup(PoolCtx *pool, const char *name, uint64_t *snapid) { Mutex::Locker l(lock); const pg_pool_t *pi = objecter->osdmap->get_pg_pool(pool->poolid); @@ -621,7 +621,7 @@ int RadosClient::snap_lookup(PoolCtx *pool, const char *name, __u64 *snapid) return -ENOENT; } -int RadosClient::snap_get_name(PoolCtx *pool, __u64 snapid, std::string *s) +int RadosClient::snap_get_name(PoolCtx *pool, uint64_t snapid, std::string *s) { Mutex::Locker l(lock); const pg_pool_t *pi = objecter->osdmap->get_pg_pool(pool->poolid); @@ -632,7 +632,7 @@ int RadosClient::snap_get_name(PoolCtx *pool, __u64 snapid, std::string *s) return 0; } -int RadosClient::snap_get_stamp(PoolCtx *pool, __u64 snapid, time_t *t) +int RadosClient::snap_get_stamp(PoolCtx *pool, uint64_t snapid, time_t *t) { Mutex::Locker l(lock); const pg_pool_t *pi = objecter->osdmap->get_pg_pool(pool->poolid); @@ -954,7 +954,7 @@ int RadosClient::read(PoolCtx& pool, const object_t& oid, off_t off, bufferlist& return bl.length(); } -int RadosClient::stat(PoolCtx& pool, const object_t& oid, __u64 *psize, time_t *pmtime) +int RadosClient::stat(PoolCtx& pool, const object_t& oid, uint64_t *psize, time_t *pmtime) { SnapContext snapc; @@ -963,7 +963,7 @@ int RadosClient::stat(PoolCtx& pool, const object_t& oid, __u64 *psize, time_t * bool done; int r; Context *onack = new C_SafeCond(&mylock, &cond, &done, &r); - __u64 size; + uint64_t size; utime_t mtime; if (!psize) @@ -1154,7 +1154,7 @@ int Rados::get_pool_stats(std::list& v, std::map& re return r; } -int Rados::create_pool(const char *name, __u64 auid) +int Rados::create_pool(const char *name, uint64_t auid) { string str(name); if (!client) @@ -1168,7 +1168,7 @@ int Rados::delete_pool(const rados_pool_t& pool) return ((RadosClient *)client)->delete_pool(pool); } -int Rados::change_pool_auid(const rados_pool_t& pool, __u64 auid) +int Rados::change_pool_auid(const rados_pool_t& pool, uint64_t auid) { if (!client) return -EINVAL; return ((RadosClient *)client)->change_pool_auid(pool, auid); @@ -1283,7 +1283,7 @@ int Rados::setxattr(rados_pool_t pool, const string& o, const char *name, buffer return ((RadosClient *)client)->setxattr(*(RadosClient::PoolCtx *)pool, oid, name, bl); } -int Rados::stat(rados_pool_t pool, const string& o, __u64 *psize, time_t *pmtime) +int Rados::stat(rados_pool_t pool, const string& o, uint64_t *psize, time_t *pmtime) { if (!client) return -EINVAL; @@ -1582,7 +1582,7 @@ extern "C" int rados_create_pool(const char *name) return radosp->create_pool(sname); } -extern "C" int rados_create_pool_with_auid(const char *name, __u64 auid) +extern "C" int rados_create_pool_with_auid(const char *name, uint64_t auid) { string sname(name); return radosp->create_pool(sname, auid); @@ -1593,7 +1593,7 @@ extern "C" int rados_delete_pool(const rados_pool_t pool) return radosp->delete_pool(pool); } -extern "C" int rados_change_pool_auid(const rados_pool_t pool, __u64 auid) +extern "C" int rados_change_pool_auid(const rados_pool_t pool, uint64_t auid) { return radosp->change_pool_auid(pool, auid); } @@ -1615,7 +1615,7 @@ extern "C" int rados_snap_remove(const rados_pool_t pool, const char *snapname) extern "C" int rados_snap_list(rados_pool_t pool, rados_snap_t *snaps, int maxlen) { RadosClient::PoolCtx *ctx = (RadosClient::PoolCtx *)pool; - vector<__u64> snapvec; + vector snapvec; int r = radosp->snap_list(ctx, &snapvec); if (r < 0) return r; @@ -1630,7 +1630,7 @@ extern "C" int rados_snap_list(rados_pool_t pool, rados_snap_t *snaps, int maxle extern "C" int rados_snap_lookup(rados_pool_t pool, const char *name, rados_snap_t *id) { RadosClient::PoolCtx *ctx = (RadosClient::PoolCtx *)pool; - return radosp->snap_lookup(ctx, name, (__u64 *)id); + return radosp->snap_lookup(ctx, name, (uint64_t *)id); } extern "C" int rados_snap_get_name(rados_pool_t pool, rados_snap_t id, char *name, int maxlen) @@ -1673,7 +1673,7 @@ extern "C" int rados_setxattr(rados_pool_t pool, const char *o, const char *name return radosp->setxattr(*ctx, oid, name, bl); } -extern "C" int rados_stat(rados_pool_t pool, const char *o, __u64 *psize, time_t *pmtime) +extern "C" int rados_stat(rados_pool_t pool, const char *o, uint64_t *psize, time_t *pmtime) { RadosClient::PoolCtx *ctx = (RadosClient::PoolCtx *)pool; object_t oid(o); diff --git a/src/mds/AnchorServer.cc b/src/mds/AnchorServer.cc index b0a4ca762ace..26e61da76eb8 100644 --- a/src/mds/AnchorServer.cc +++ b/src/mds/AnchorServer.cc @@ -113,7 +113,7 @@ void AnchorServer::dec(inodeno_t ino) // server -void AnchorServer::_prepare(bufferlist &bl, __u64 reqid, int bymds) +void AnchorServer::_prepare(bufferlist &bl, uint64_t reqid, int bymds) { bufferlist::iterator p = bl.begin(); __u32 what; diff --git a/src/mds/AnchorServer.h b/src/mds/AnchorServer.h index a868f40930f2..cf0dc3043e72 100644 --- a/src/mds/AnchorServer.h +++ b/src/mds/AnchorServer.h @@ -56,7 +56,7 @@ class AnchorServer : public MDSTableServer { void dump(); // server bits - void _prepare(bufferlist &bl, __u64 reqid, int bymds); + void _prepare(bufferlist &bl, uint64_t reqid, int bymds); void _commit(version_t tid); void _rollback(version_t tid); void handle_query(MMDSTableRequest *m); diff --git a/src/mds/CDentry.cc b/src/mds/CDentry.cc index 0294bb08fdea..34eb5bdceace 100644 --- a/src/mds/CDentry.cc +++ b/src/mds/CDentry.cc @@ -137,7 +137,7 @@ pair CDentry::authority() } -void CDentry::add_waiter(__u64 tag, Context *c) +void CDentry::add_waiter(uint64_t tag, Context *c) { // wait on the directory? if (tag & (WAIT_UNFREEZE|WAIT_SINGLEAUTH)) { diff --git a/src/mds/CDentry.h b/src/mds/CDentry.h index 3ef4b575ff2c..5fb9e1285e3f 100644 --- a/src/mds/CDentry.h +++ b/src/mds/CDentry.h @@ -82,7 +82,7 @@ public: // -- wait -- //static const int WAIT_LOCK_OFFSET = 8; - void add_waiter(__u64 tag, Context *c); + void add_waiter(uint64_t tag, Context *c); static const int EXPORT_NONCE = 1; diff --git a/src/mds/CDir.cc b/src/mds/CDir.cc index 924eb915ce60..d5ad15fb3046 100644 --- a/src/mds/CDir.cc +++ b/src/mds/CDir.cc @@ -851,7 +851,7 @@ void CDir::take_sub_waiting(list& ls) -void CDir::add_waiter(__u64 tag, Context *c) +void CDir::add_waiter(uint64_t tag, Context *c) { // hierarchical? @@ -882,7 +882,7 @@ void CDir::add_waiter(__u64 tag, Context *c) /* NOTE: this checks dentry waiters too */ -void CDir::take_waiting(__u64 mask, list& ls) +void CDir::take_waiting(uint64_t mask, list& ls) { if ((mask & WAIT_DENTRY) && waiting_on_dentry.size()) { // take each each dentry waiter @@ -902,7 +902,7 @@ void CDir::take_waiting(__u64 mask, list& ls) } -void CDir::finish_waiting(__u64 mask, int result) +void CDir::finish_waiting(uint64_t mask, int result) { dout(11) << "finish_waiting mask " << hex << mask << dec << " result " << result << " on " << *this << dendl; diff --git a/src/mds/CDir.h b/src/mds/CDir.h index 0cfe2a28f6ce..657a9e2dc03c 100644 --- a/src/mds/CDir.h +++ b/src/mds/CDir.h @@ -135,15 +135,15 @@ public: // -- wait masks -- - static const __u64 WAIT_DENTRY = (1<<0); // wait for item to be in cache - static const __u64 WAIT_COMPLETE = (1<<1); // wait for complete dir contents - static const __u64 WAIT_FROZEN = (1<<2); // auth pins removed + static const uint64_t WAIT_DENTRY = (1<<0); // wait for item to be in cache + static const uint64_t WAIT_COMPLETE = (1<<1); // wait for complete dir contents + static const uint64_t WAIT_FROZEN = (1<<2); // auth pins removed static const int WAIT_DNLOCK_OFFSET = 4; - static const __u64 WAIT_ANY_MASK = (0xffffffff); - static const __u64 WAIT_ATFREEZEROOT = (WAIT_UNFREEZE); - static const __u64 WAIT_ATSUBTREEROOT = (WAIT_SINGLEAUTH); + static const uint64_t WAIT_ANY_MASK = (0xffffffff); + static const uint64_t WAIT_ATFREEZEROOT = (WAIT_UNFREEZE); + static const uint64_t WAIT_ATSUBTREEROOT = (WAIT_SINGLEAUTH); @@ -494,9 +494,9 @@ public: void take_sub_waiting(list& ls); // dentry or ino - void add_waiter(__u64 mask, Context *c); - void take_waiting(__u64 mask, list& ls); // may include dentry waiters - void finish_waiting(__u64 mask, int result = 0); // ditto + void add_waiter(uint64_t mask, Context *c); + void take_waiting(uint64_t mask, list& ls); // may include dentry waiters + void finish_waiting(uint64_t mask, int result = 0); // ditto // -- import/export -- diff --git a/src/mds/CInode.cc b/src/mds/CInode.cc index c077663e0502..369c76e3cf69 100644 --- a/src/mds/CInode.cc +++ b/src/mds/CInode.cc @@ -791,7 +791,7 @@ void CInode::encode_parent_mutation(ObjectOperation& m) CDentry *pdn = get_parent_dn(); if (pdn) { bufferlist parent(32 + pdn->name.length()); - __u64 ino = pdn->get_dir()->get_inode()->ino(); + uint64_t ino = pdn->get_dir()->get_inode()->ino(); __u8 v = 1; ::encode(v, parent); ::encode(inode.version, parent); @@ -1317,7 +1317,7 @@ bool CInode::is_freezing() return false; } -void CInode::add_waiter(__u64 tag, Context *c) +void CInode::add_waiter(uint64_t tag, Context *c) { dout(10) << "add_waiter tag " << tag << " !ambig " << !state_test(STATE_AMBIGUOUSAUTH) @@ -1827,8 +1827,8 @@ void CInode::encode_cap_message(MClientCaps *m, Capability *cap) m->head.time_warp_seq = i->time_warp_seq; // max_size is min of projected, actual. - __u64 oldms = oi->client_ranges.count(client) ? oi->client_ranges[client].last : 0; - __u64 newms = pi->client_ranges.count(client) ? pi->client_ranges[client].last : 0; + uint64_t oldms = oi->client_ranges.count(client) ? oi->client_ranges[client].last : 0; + uint64_t newms = pi->client_ranges.count(client) ? pi->client_ranges[client].last : 0; m->head.max_size = MIN(oldms, newms); i = pauth ? pi:oi; diff --git a/src/mds/CInode.h b/src/mds/CInode.h index 7b1cb93ebd84..0afa84fd7e6b 100644 --- a/src/mds/CInode.h +++ b/src/mds/CInode.h @@ -129,13 +129,13 @@ public: static const int STATE_DIRTYPARENT = (1<<14); // -- waiters -- - static const __u64 WAIT_DIR = (1<<0); - static const __u64 WAIT_ANCHORED = (1<<1); - static const __u64 WAIT_UNANCHORED = (1<<2); - static const __u64 WAIT_FROZEN = (1<<3); - static const __u64 WAIT_TRUNC = (1<<4); + static const uint64_t WAIT_DIR = (1<<0); + static const uint64_t WAIT_ANCHORED = (1<<1); + static const uint64_t WAIT_UNANCHORED = (1<<2); + static const uint64_t WAIT_FROZEN = (1<<3); + static const uint64_t WAIT_TRUNC = (1<<4); - static const __u64 WAIT_ANY_MASK = (__u64)(-1); + static const uint64_t WAIT_ANY_MASK = (uint64_t)(-1); // misc static const int EXPORT_NONCE = 1; // nonce given to replicas created by export @@ -462,7 +462,7 @@ private: // -- waiting -- - void add_waiter(__u64 tag, Context *c); + void add_waiter(uint64_t tag, Context *c); // -- encode/decode helpers -- diff --git a/src/mds/Capability.h b/src/mds/Capability.h index 80928458a91a..bec9d9e1fc81 100644 --- a/src/mds/Capability.h +++ b/src/mds/Capability.h @@ -104,7 +104,7 @@ private: CInode *inode; client_t client; - __u64 cap_id; + uint64_t cap_id; __u32 _wanted; // what the client wants (ideally) @@ -228,7 +228,7 @@ public: xlist::item item_session_caps; xlist::item item_snaprealm_caps; - Capability(CInode *i, __u64 id, client_t c) : + Capability(CInode *i, uint64_t id, client_t c) : inode(i), client(c), cap_id(id), _wanted(0), @@ -254,8 +254,8 @@ public: void set_last_issue() { last_issue = last_sent; } void set_last_issue_stamp(utime_t t) { last_issue_stamp = t; } - void set_cap_id(__u64 i) { cap_id = i; } - __u64 get_cap_id() { return cap_id; } + void set_cap_id(uint64_t i) { cap_id = i; } + uint64_t get_cap_id() { return cap_id; } //ceph_seq_t get_last_issue() { return last_issue; } diff --git a/src/mds/Locker.cc b/src/mds/Locker.cc index b38d02fc8ef0..5bbf4445739b 100644 --- a/src/mds/Locker.cc +++ b/src/mds/Locker.cc @@ -1449,10 +1449,10 @@ public: }; -void Locker::calc_new_client_ranges(CInode *in, __u64 size, map& new_ranges) +void Locker::calc_new_client_ranges(CInode *in, uint64_t size, map& new_ranges) { inode_t *latest = in->get_projected_inode(); - __u64 ms = ROUND_UP_TO((size+1)<<1, latest->get_layout_size_increment()); + uint64_t ms = ROUND_UP_TO((size+1)<<1, latest->get_layout_size_increment()); // increase ranges as appropriate. // shrink to 0 if no WR|BUFFER caps issued. @@ -1462,7 +1462,7 @@ void Locker::calc_new_client_ranges(CInode *in, __u64 size, mapsecond->issued() | p->second->wanted()) & (CEPH_CAP_FILE_WR|CEPH_CAP_FILE_BUFFER)) { new_ranges[p->first].first = 0; if (latest->client_ranges.count(p->first)) { - __u64 last = latest->client_ranges[p->first].last; + uint64_t last = latest->client_ranges[p->first].last; new_ranges[p->first].last = MAX(ms, last); } else new_ranges[p->first].last = ms; @@ -1472,13 +1472,13 @@ void Locker::calc_new_client_ranges(CInode *in, __u64 size, mapis_auth()); inode_t *latest = in->get_projected_inode(); map new_ranges; - __u64 size = latest->size; + uint64_t size = latest->size; if (update_size) size = new_size; bool new_max = false; @@ -1815,7 +1815,7 @@ void Locker::handle_client_caps(MClientCaps *m) } void Locker::process_cap_update(MDRequest *mdr, client_t client, - inodeno_t ino, __u64 cap_id, int caps, int wanted, + inodeno_t ino, uint64_t cap_id, int caps, int wanted, int seq, int issue_seq, int mseq, const nstring& dname) { @@ -1877,7 +1877,7 @@ void Locker::kick_cap_releases(MDRequest *mdr) } -static __u64 calc_bounding(__u64 t) +static uint64_t calc_bounding(uint64_t t) { t |= t >> 1; t |= t >> 2; @@ -1906,7 +1906,7 @@ bool Locker::_do_cap_update(CInode *in, Capability *cap, inode_t *latest = in->get_projected_inode(); // increase or zero max_size? - __u64 size = m->get_size(); + uint64_t size = m->get_size(); bool change_max = false; uint64_t old_max = latest->client_ranges.count(client) ? latest->client_ranges[client].last : 0; uint64_t new_max = old_max; @@ -2088,7 +2088,7 @@ void Locker::handle_client_cap_release(MClientCapRelease *m) dout(10) << "handle_client_cap_release " << *m << dendl; for (vector::iterator p = m->caps.begin(); p != m->caps.end(); p++) { - inodeno_t ino((__u64)p->ino); + inodeno_t ino((uint64_t)p->ino); CInode *in = mdcache->get_inode(ino); if (!in) { dout(10) << " missing ino " << ino << dendl; diff --git a/src/mds/Locker.h b/src/mds/Locker.h index d77cbf62fbfc..1cb33eeb3e13 100644 --- a/src/mds/Locker.h +++ b/src/mds/Locker.h @@ -169,7 +169,7 @@ public: // caps void process_cap_update(MDRequest *mdr, client_t client, - inodeno_t ino, __u64 cap_id, int caps, int wanted, + inodeno_t ino, uint64_t cap_id, int caps, int wanted, int seq, int issue_seq, int mseq, const nstring& dname); void kick_cap_releases(MDRequest *mdr); @@ -226,8 +226,8 @@ protected: void file_update_finish(CInode *in, Mutation *mut, bool share, client_t client, Capability *cap, MClientCaps *ack); public: - void calc_new_client_ranges(CInode *in, __u64 size, map& new_ranges); - bool check_inode_max_size(CInode *in, bool force_wrlock=false, bool update_size=false, __u64 newsize=0, + void calc_new_client_ranges(CInode *in, uint64_t size, map& new_ranges); + bool check_inode_max_size(CInode *in, bool force_wrlock=false, bool update_size=false, uint64_t newsize=0, utime_t mtime=utime_t()); void share_inode_max_size(CInode *in); diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index 4307e01cf1e0..82b21f2338c6 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -4502,7 +4502,7 @@ void MDCache::start_files_to_recover(vector& recover_q, vector struct C_MDC_Recover : public Context { MDCache *mdc; CInode *in; - __u64 size; + uint64_t size; utime_t mtime; C_MDC_Recover(MDCache *m, CInode *i) : mdc(m), in(i), size(0) {} void finish(int r) { @@ -4551,7 +4551,7 @@ void MDCache::do_file_recover() } } -void MDCache::_recovered(CInode *in, int r, __u64 size, utime_t mtime) +void MDCache::_recovered(CInode *in, int r, uint64_t size, utime_t mtime) { dout(10) << "_recovered r=" << r << " size=" << in->inode.size << " mtime=" << in->inode.mtime << " for " << *in << dendl; @@ -7024,10 +7024,10 @@ void MDCache::purge_stray(CDentry *dn) assert(in->last == CEPH_NOSNAP); } - __u64 period = in->inode.layout.fl_object_size * in->inode.layout.fl_stripe_count; - __u64 cur_max_size = in->inode.get_max_size(); - __u64 to = MAX(in->inode.size, cur_max_size); - __u64 num = (to + period - 1) / period; + uint64_t period = in->inode.layout.fl_object_size * in->inode.layout.fl_stripe_count; + uint64_t cur_max_size = in->inode.get_max_size(); + uint64_t to = MAX(in->inode.size, cur_max_size); + uint64_t num = (to + period - 1) / period; dout(10) << "purge_stray 0~" << to << " objects 0~" << num << " snapc " << snapc << " on " << *in << dendl; if (to) mds->filer->purge_range(in->inode.ino, &in->inode.layout, *snapc, diff --git a/src/mds/MDCache.h b/src/mds/MDCache.h index 625a8be48f0a..8c641425ecc2 100644 --- a/src/mds/MDCache.h +++ b/src/mds/MDCache.h @@ -305,7 +305,7 @@ struct MDRequest : public Mutation { bool was_link_merge; map imported_client_map; - map sseq_map; + map sseq_map; map > cap_imports; // for snaps @@ -469,7 +469,7 @@ public: } // -- client caps -- - __u64 last_cap_id; + uint64_t last_cap_id; void remove_client_cap(CInode *in, client_t client); @@ -723,7 +723,7 @@ public: void rejoin_recovered_caps(inodeno_t ino, client_t client, cap_reconnect_t& icr, int frommds=-1) { cap_imports[ino][client][frommds] = icr.capinfo; - cap_import_paths[ino] = filepath(icr.path, (__u64)icr.capinfo.pathbase); + cap_import_paths[ino] = filepath(icr.path, (uint64_t)icr.capinfo.pathbase); } ceph_mds_cap_reconnect *get_replay_cap_reconnect(inodeno_t ino, client_t client) { if (cap_imports.count(ino) && @@ -789,7 +789,7 @@ public: void start_files_to_recover(vector& recover_q, vector& check_q); void do_file_recover(); - void _recovered(CInode *in, int r, __u64 size, utime_t mtime); + void _recovered(CInode *in, int r, uint64_t size, utime_t mtime); void purge_prealloc_ino(inodeno_t ino, Context *fin); diff --git a/src/mds/MDLog.h b/src/mds/MDLog.h index 14dbb6c2ce2e..a53ac62154eb 100644 --- a/src/mds/MDLog.h +++ b/src/mds/MDLog.h @@ -163,7 +163,7 @@ public: return segments.empty() ? 0:segments.rbegin()->second; } - LogSegment *get_segment(__u64 off) { + LogSegment *get_segment(uint64_t off) { if (segments.count(off)) return segments[off]; return NULL; diff --git a/src/mds/MDSMap.cc b/src/mds/MDSMap.cc index 4695010460c7..9884d1ba1f7f 100644 --- a/src/mds/MDSMap.cc +++ b/src/mds/MDSMap.cc @@ -74,13 +74,13 @@ void MDSMap::print(ostream& out) << "failed <" << failed << ">\n" << "stopped <" << stopped << ">\n"; - multimap< pair, __u64 > foo; - for (map<__u64,mds_info_t>::iterator p = mds_info.begin(); + multimap< pair, uint64_t > foo; + for (map::iterator p = mds_info.begin(); p != mds_info.end(); p++) - foo.insert(pair,__u64>(pair(p->second.rank, p->second.inc-1), p->first)); + foo.insert(pair,uint64_t>(pair(p->second.rank, p->second.inc-1), p->first)); - for (multimap< pair, __u64 >::iterator p = foo.begin(); + for (multimap< pair, uint64_t >::iterator p = foo.begin(); p != foo.end(); p++) { mds_info_t& info = mds_info[p->second]; @@ -115,7 +115,7 @@ void MDSMap::print(ostream& out) void MDSMap::print_summary(ostream& out) { map by_state; - for (map<__u64,mds_info_t>::iterator p = mds_info.begin(); + for (map::iterator p = mds_info.begin(); p != mds_info.end(); p++) { string s = ceph_mds_state_name(p->second.state); diff --git a/src/mds/MDSMap.h b/src/mds/MDSMap.h index 43bddee0f76b..a26472feaed0 100644 --- a/src/mds/MDSMap.h +++ b/src/mds/MDSMap.h @@ -84,7 +84,7 @@ public: static const int STATE_STOPPING = CEPH_MDS_STATE_STOPPING; // up, exporting metadata (-> standby or out) struct mds_info_t { - __u64 global_id; + uint64_t global_id; string name; int32_t rank; int32_t inc; @@ -149,7 +149,7 @@ protected: __u32 session_timeout; __u32 session_autoclose; - __u64 max_file_size; + uint64_t max_file_size; vector<__u32> data_pg_pools; // file data pg_pools available to clients (via an ioctl). first is the default. __u32 cas_pg_pool; // where CAS objects go @@ -169,8 +169,8 @@ protected: set in; // currently defined cluster map inc; // most recent incarnation. set failed, stopped; // which roles are failed or stopped - map up; // who is in those roles - map<__u64,mds_info_t> mds_info; + map up; // who is in those roles + map mds_info; public: CompatSet compat; @@ -189,7 +189,7 @@ public: utime_t get_session_timeout() { return utime_t(session_timeout,0); } - __u64 get_max_filesize() { return max_file_size; } + uint64_t get_max_filesize() { return max_file_size; } epoch_t get_epoch() const { return epoch; } void inc_epoch() { epoch++; } @@ -212,8 +212,8 @@ public: __u32 get_cas_pg_pool() const { return cas_pg_pool; } __u32 get_metadata_pg_pool() const { return metadata_pg_pool; } - const map<__u64,mds_info_t>& get_mds_info() { return mds_info; } - const mds_info_t& get_mds_info_gid(__u64 gid) { + const map& get_mds_info() { return mds_info; } + const mds_info_t& get_mds_info_gid(uint64_t gid) { assert(mds_info.count(gid)); return mds_info[gid]; } @@ -228,7 +228,7 @@ public: } unsigned get_num_mds(int state) { unsigned n = 0; - for (map<__u64,mds_info_t>::const_iterator p = mds_info.begin(); + for (map::const_iterator p = mds_info.begin(); p != mds_info.end(); ++p) if (p->second.state == state) ++n; @@ -242,7 +242,7 @@ public: s = in; } void get_up_mds_set(set& s) { - for (map::const_iterator p = up.begin(); + for (map::const_iterator p = up.begin(); p != up.end(); ++p) s.insert(p->first); @@ -262,14 +262,14 @@ public: } void get_recovery_mds_set(set& s) { s = failed; - for (map<__u64,mds_info_t>::const_iterator p = mds_info.begin(); + for (map::const_iterator p = mds_info.begin(); p != mds_info.end(); ++p) if (p->second.state >= STATE_REPLAY && p->second.state <= STATE_STOPPING) s.insert(p->second.rank); } void get_mds_set(set& s, int state) { - for (map<__u64,mds_info_t>::const_iterator p = mds_info.begin(); + for (map::const_iterator p = mds_info.begin(); p != mds_info.end(); ++p) if (p->second.state == state) @@ -279,14 +279,14 @@ public: int get_random_up_mds() { if (up.empty()) return -1; - map::iterator p = up.begin(); + map::iterator p = up.begin(); for (int n = rand() % up.size(); n; n--) p++; return p->first; } - __u64 find_standby_for(int mds, string& name) { - for (map<__u64,mds_info_t>::const_iterator p = mds_info.begin(); + uint64_t find_standby_for(int mds, string& name) { + for (map::const_iterator p = mds_info.begin(); p != mds_info.end(); ++p) { if (p->second.rank == -1 && @@ -297,7 +297,7 @@ public: return p->first; } } - for (map<__u64,mds_info_t>::const_iterator p = mds_info.begin(); + for (map::const_iterator p = mds_info.begin(); p != mds_info.end(); ++p) { if (p->second.rank == -1 && @@ -321,13 +321,13 @@ public: bool is_stopped(int m) { return stopped.count(m); } bool is_dne(int m) { return in.count(m) == 0; } - bool is_dne_gid(__u64 gid) { return mds_info.count(gid) == 0; } + bool is_dne_gid(uint64_t gid) { return mds_info.count(gid) == 0; } int get_state(int m) { return up.count(m) ? mds_info[up[m]].state : 0; } - int get_state_gid(__u64 gid) { return mds_info.count(gid) ? mds_info[gid].state : 0; } + int get_state_gid(uint64_t gid) { return mds_info.count(gid) ? mds_info[gid].state : 0; } mds_info_t& get_info(int m) { assert(up.count(m)); return mds_info[up[m]]; } - mds_info_t& get_info_gid(__u64 gid) { assert(mds_info.count(gid)); return mds_info[gid]; } + mds_info_t& get_info_gid(uint64_t gid) { assert(mds_info.count(gid)); return mds_info[gid]; } bool is_boot(int m) { return get_state(m) == STATE_BOOT; } bool is_creating(int m) { return get_state(m) == STATE_CREATING; } @@ -341,7 +341,7 @@ public: bool is_stopping(int m) { return get_state(m) == STATE_STOPPING; } bool is_clientreplay_or_active_or_stopping(int m) { return is_clientreplay(m) || is_active(m) || is_stopping(m); } - bool is_laggy_gid(__u64 gid) { return mds_info.count(gid) && mds_info[gid].laggy(); } + bool is_laggy_gid(uint64_t gid) { return mds_info.count(gid) && mds_info[gid].laggy(); } // cluster states @@ -389,7 +389,7 @@ public: return false; } - int get_rank_gid(__u64 gid) { + int get_rank_gid(uint64_t gid) { if (mds_info.count(gid)) return mds_info[gid].rank; return -1; diff --git a/src/mds/MDSTableClient.cc b/src/mds/MDSTableClient.cc index 05c7944f4d1b..4736b9876ec8 100644 --- a/src/mds/MDSTableClient.cc +++ b/src/mds/MDSTableClient.cc @@ -43,7 +43,7 @@ void MDSTableClient::handle_request(class MMDSTableRequest *m) assert(m->table == table); version_t tid = m->get_tid(); - __u64 reqid = m->reqid; + uint64_t reqid = m->reqid; switch (m->op) { case TABLESERVER_OP_QUERY_REPLY: @@ -133,7 +133,7 @@ void MDSTableClient::_logged_ack(version_t tid) void MDSTableClient::_prepare(bufferlist& mutation, version_t *ptid, bufferlist *pbl, Context *onfinish) { - __u64 reqid = ++last_reqid; + uint64_t reqid = ++last_reqid; dout(10) << "_prepare " << reqid << dendl; // send message @@ -209,7 +209,7 @@ void MDSTableClient::handle_mds_recovery(int who) resend_queries(); // prepares. - for (map<__u64, _pending_prepare>::iterator p = pending_prepare.begin(); + for (map::iterator p = pending_prepare.begin(); p != pending_prepare.end(); p++) { dout(10) << "resending " << p->first << dendl; diff --git a/src/mds/MDSTableClient.h b/src/mds/MDSTableClient.h index dbbd509395d1..3e5ba242b98b 100644 --- a/src/mds/MDSTableClient.h +++ b/src/mds/MDSTableClient.h @@ -28,7 +28,7 @@ protected: MDS *mds; int table; - __u64 last_reqid; + uint64_t last_reqid; // prepares struct _pending_prepare { @@ -40,7 +40,7 @@ protected: _pending_prepare() : onfinish(0), ptid(0), pbl(0) {} }; - map<__u64, _pending_prepare> pending_prepare; + map pending_prepare; // pending commits map pending_commit; diff --git a/src/mds/MDSTableServer.h b/src/mds/MDSTableServer.h index e913fb2f08f2..0a3d2d43ae9e 100644 --- a/src/mds/MDSTableServer.h +++ b/src/mds/MDSTableServer.h @@ -27,7 +27,7 @@ public: * pending mutation state in the table. */ struct _pending { - __u64 reqid; + uint64_t reqid; __s32 mds; version_t tid; void encode(bufferlist& bl) const { @@ -77,20 +77,20 @@ private: public: virtual void handle_query(MMDSTableRequest *m) = 0; - virtual void _prepare(bufferlist &bl, __u64 reqid, int bymds) = 0; + virtual void _prepare(bufferlist &bl, uint64_t reqid, int bymds) = 0; virtual void _commit(version_t tid) = 0; virtual void _rollback(version_t tid) = 0; virtual void _server_update(bufferlist& bl) { assert(0); } - void _note_prepare(int mds, __u64 reqid) { + void _note_prepare(int mds, uint64_t reqid) { pending_for_mds[version].mds = mds; pending_for_mds[version].reqid = reqid; pending_for_mds[version].tid = version; } - void _note_commit(__u64 tid) { + void _note_commit(uint64_t tid) { pending_for_mds.erase(tid); } - void _note_rollback(__u64 tid) { + void _note_rollback(uint64_t tid) { pending_for_mds.erase(tid); } diff --git a/src/mds/Migrator.cc b/src/mds/Migrator.cc index 1020894d52e5..b56e9eb69986 100644 --- a/src/mds/Migrator.cc +++ b/src/mds/Migrator.cc @@ -1648,7 +1648,7 @@ class C_MDS_ImportDirLoggedStart : public Context { int from; public: map imported_client_map; - map sseqmap; + map sseqmap; C_MDS_ImportDirLoggedStart(Migrator *m, CDir *d, int f) : migrator(m), dir(d), from(f) { @@ -1912,7 +1912,7 @@ void Migrator::import_reverse_final(CDir *dir) void Migrator::import_logged_start(CDir *dir, int from, map& imported_client_map, - map& sseqmap) + map& sseqmap) { dout(7) << "import_logged " << *dir << dendl; @@ -2310,7 +2310,7 @@ class C_M_LoggedImportCaps : public Context { public: map > cap_imports; map client_map; - map sseqmap; + map sseqmap; C_M_LoggedImportCaps(Migrator *m, CInode *i, int f) : migrator(m), in(i), from(f) {} void finish(int r) { @@ -2356,7 +2356,7 @@ void Migrator::logged_import_caps(CInode *in, int from, map >& cap_imports, map& client_map, - map& sseqmap) + map& sseqmap) { dout(10) << "logged_import_caps on " << *in << dendl; diff --git a/src/mds/Migrator.h b/src/mds/Migrator.h index 5d6df53bcc2a..d39a96fdd20b 100644 --- a/src/mds/Migrator.h +++ b/src/mds/Migrator.h @@ -253,7 +253,7 @@ protected: void import_notify_abort(CDir *dir, set& bounds); void import_logged_start(CDir *dir, int from, map &imported_client_map, - map& sseqmap); + map& sseqmap); void handle_export_finish(MExportDirFinish *m); public: void import_finish(CDir *dir); @@ -264,7 +264,7 @@ protected: int from, map >& cap_imports, map& client_map, - map& sseqmap); + map& sseqmap); friend class C_MDS_ImportDirLoggedStart; diff --git a/src/mds/Server.cc b/src/mds/Server.cc index cf941f14a5be..c62dc8c61450 100644 --- a/src/mds/Server.cc +++ b/src/mds/Server.cc @@ -144,15 +144,15 @@ void Server::dispatch(Message *m) class C_MDS_session_finish : public Context { MDS *mds; Session *session; - __u64 state_seq; + uint64_t state_seq; bool open; version_t cmapv; interval_set inos; version_t inotablev; public: - C_MDS_session_finish(MDS *m, Session *se, __u64 sseq, bool s, version_t mv) : + C_MDS_session_finish(MDS *m, Session *se, uint64_t sseq, bool s, version_t mv) : mds(m), session(se), state_seq(sseq), open(s), cmapv(mv), inotablev(0) { } - C_MDS_session_finish(MDS *m, Session *se, __u64 sseq, bool s, version_t mv, interval_set& i, version_t iv) : + C_MDS_session_finish(MDS *m, Session *se, uint64_t sseq, bool s, version_t mv, interval_set& i, version_t iv) : mds(m), session(se), state_seq(sseq), open(s), cmapv(mv), inos(i), inotablev(iv) { } void finish(int r) { assert(r == 0); @@ -186,7 +186,7 @@ void Server::handle_client_session(MClientSession *m) return; } - __u64 sseq = 0; + uint64_t sseq = 0; switch (m->get_op()) { case CEPH_SESSION_REQUEST_OPEN: if (session->is_opening() || @@ -268,7 +268,7 @@ void Server::handle_client_session(MClientSession *m) } } -void Server::_session_logged(Session *session, __u64 state_seq, bool open, version_t pv, +void Server::_session_logged(Session *session, uint64_t state_seq, bool open, version_t pv, interval_set& inos, version_t piv) { dout(10) << "_session_logged " << session->inst << " state_seq " << state_seq << " " << (open ? "open":"close") @@ -328,7 +328,7 @@ void Server::_session_logged(Session *session, __u64 state_seq, bool open, versi } version_t Server::prepare_force_open_sessions(map& cm, - map& sseqmap) + map& sseqmap) { version_t pv = ++mds->sessionmap.projected; dout(10) << "prepare_force_open_sessions " << pv @@ -351,7 +351,7 @@ version_t Server::prepare_force_open_sessions(map& cm, } void Server::finish_force_open_sessions(map& cm, - map& sseqmap) + map& sseqmap) { /* * FIXME: need to carefully consider the race conditions between a @@ -365,7 +365,7 @@ void Server::finish_force_open_sessions(map& cm, assert(session); if (sseqmap.count(p->first)) { - __u64 sseq = sseqmap[p->first]; + uint64_t sseq = sseqmap[p->first]; if (session->get_state_seq() != sseq) { dout(10) << "force_open_sessions skipping changed " << session->inst << dendl; } else { @@ -398,7 +398,7 @@ void Server::terminate_sessions() session->is_killing() || session->is_closed()) continue; - __u64 sseq = mds->sessionmap.set_state(session, Session::STATE_CLOSING); + uint64_t sseq = mds->sessionmap.set_state(session, Session::STATE_CLOSING); version_t pv = ++mds->sessionmap.projected; mdlog->start_submit_entry(new ESession(session->inst, false, pv), new C_MDS_session_finish(mds, session, sseq, false, pv)); @@ -478,7 +478,7 @@ void Server::kill_session(Session *session) session->is_stale()) && !session->is_importing()) { dout(10) << "kill_session " << session << dendl; - __u64 sseq = mds->sessionmap.set_state(session, Session::STATE_KILLING); + uint64_t sseq = mds->sessionmap.set_state(session, Session::STATE_KILLING); version_t pv = ++mds->sessionmap.projected; mdlog->start_submit_entry(new ESession(session->inst, false, pv), new C_MDS_session_finish(mds, session, sseq, false, pv)); @@ -543,7 +543,7 @@ void Server::handle_client_reconnect(MClientReconnect *m) dout(7) << " client had no session, removing from session map" << dendl; assert(session); // ? version_t pv = ++mds->sessionmap.projected; - __u64 sseq = session->get_state_seq(); + uint64_t sseq = session->get_state_seq(); mdlog->start_submit_entry(new ESession(session->inst, false, pv), new C_MDS_session_finish(mds, session, sseq, false, pv)); mdlog->flush(); @@ -557,7 +557,7 @@ void Server::handle_client_reconnect(MClientReconnect *m) << m->get_source_inst() << dendl; mds->sessionmap.set_state(session, Session::STATE_OPENING); version_t pv = ++mds->sessionmap.projected; - __u64 sseq = session->get_state_seq(); + uint64_t sseq = session->get_state_seq(); mdlog->start_submit_entry(new ESession(session->inst, true, pv), new C_MDS_session_finish(mds, session, sseq, true, pv)); mdlog->flush(); @@ -610,7 +610,7 @@ void Server::handle_client_reconnect(MClientReconnect *m) continue; } - filepath path(p->second.path, (__u64)p->second.capinfo.pathbase); + filepath path(p->second.path, (uint64_t)p->second.capinfo.pathbase); if ((in && !in->is_auth()) || !mds->mdcache->path_is_mine(path)) { // not mine. @@ -1065,7 +1065,7 @@ void Server::handle_client_request(MClientRequest *req) p != req->releases.end(); p++) mds->locker->process_cap_update(mdr, client, - inodeno_t((__u64)p->item.ino), p->item.cap_id, + inodeno_t((uint64_t)p->item.ino), p->item.cap_id, p->item.caps, p->item.wanted, p->item.seq, p->item.issue_seq, @@ -2543,7 +2543,7 @@ void Server::handle_client_setattr(MDRequest *mdr) // trunc from bigger -> smaller? inode_t *pi = cur->get_projected_inode(); - __u64 old_size = MAX(pi->size, req->head.args.setattr.old_size); + uint64_t old_size = MAX(pi->size, req->head.args.setattr.old_size); bool truncating_smaller = false; if (mask & CEPH_SETATTR_SIZE) { truncating_smaller = req->head.args.setattr.size < old_size; diff --git a/src/mds/Server.h b/src/mds/Server.h index bf2774824104..7abfc3356ae5 100644 --- a/src/mds/Server.h +++ b/src/mds/Server.h @@ -69,12 +69,12 @@ public: Session *get_session(Message *m); void handle_client_session(class MClientSession *m); - void _session_logged(Session *session, __u64 state_seq, + void _session_logged(Session *session, uint64_t state_seq, bool open, version_t pv, interval_set& inos,version_t piv); version_t prepare_force_open_sessions(map &cm, - map& sseqmap); + map& sseqmap); void finish_force_open_sessions(map &cm, - map& sseqmap); + map& sseqmap); void terminate_sessions(); void find_idle_sessions(); void kill_session(Session *session); diff --git a/src/mds/SessionMap.cc b/src/mds/SessionMap.cc index e77bbadd3567..51f12f3f1566 100644 --- a/src/mds/SessionMap.cc +++ b/src/mds/SessionMap.cc @@ -145,7 +145,7 @@ void SessionMap::_save_finish(version_t v) void SessionMap::encode(bufferlist& bl) { - __u64 pre = -1; // for 0.19 compatibility; we forgot an encoding prefix. + uint64_t pre = -1; // for 0.19 compatibility; we forgot an encoding prefix. ::encode(pre, bl); __u8 struct_v = 2; @@ -168,9 +168,9 @@ void SessionMap::encode(bufferlist& bl) void SessionMap::decode(bufferlist::iterator& p) { utime_t now = g_clock.now(); - __u64 pre; + uint64_t pre; ::decode(pre, p); - if (pre == (__u64)-1) { + if (pre == (uint64_t)-1) { __u8 struct_v; ::decode(struct_v, p); assert(struct_v == 2); diff --git a/src/mds/SessionMap.h b/src/mds/SessionMap.h index 05f4b69a194a..73f968915f8e 100644 --- a/src/mds/SessionMap.h +++ b/src/mds/SessionMap.h @@ -76,7 +76,7 @@ public: private: int state; - __u64 state_seq; + uint64_t state_seq; int importing_count; friend class SessionMap; public: @@ -118,7 +118,7 @@ public: int get_state() { return state; } const char *get_state_name() { return get_state_name(state); } - __u64 get_state_seq() { return state_seq; } + uint64_t get_state_seq() { return state_seq; } bool is_closed() { return state == STATE_CLOSED; } bool is_opening() { return state == STATE_OPENING; } bool is_open() { return state == STATE_OPEN; } @@ -280,7 +280,7 @@ public: if (by_state[state].empty()) return 0; return by_state[state].front(); } - __u64 set_state(Session *session, int s) { + uint64_t set_state(Session *session, int s) { if (session->state != s) { session->state = s; session->state_seq++; diff --git a/src/mds/SimpleLock.h b/src/mds/SimpleLock.h index 11352793b35f..05f2224dced8 100644 --- a/src/mds/SimpleLock.h +++ b/src/mds/SimpleLock.h @@ -127,13 +127,13 @@ public: // waiting - static const __u64 WAIT_RD = (1<<0); // to read - static const __u64 WAIT_WR = (1<<1); // to write - static const __u64 WAIT_XLOCK = (1<<2); // to xlock (** dup) - static const __u64 WAIT_STABLE = (1<<2); // for a stable state - static const __u64 WAIT_REMOTEXLOCK = (1<<3); // for a remote xlock + static const uint64_t WAIT_RD = (1<<0); // to read + static const uint64_t WAIT_WR = (1<<1); // to write + static const uint64_t WAIT_XLOCK = (1<<2); // to xlock (** dup) + static const uint64_t WAIT_STABLE = (1<<2); // for a stable state + static const uint64_t WAIT_REMOTEXLOCK = (1<<3); // for a remote xlock static const int WAIT_BITS = 4; - static const __u64 WAIT_ALL = ((1<encode_lock_state(type->type, bl); } - void finish_waiters(__u64 mask, int r=0) { + void finish_waiters(uint64_t mask, int r=0) { parent->finish_waiting(mask << get_wait_shift(), r); } - void take_waiting(__u64 mask, list& ls) { + void take_waiting(uint64_t mask, list& ls) { parent->take_waiting(mask << get_wait_shift(), ls); } - void add_waiter(__u64 mask, Context *c) { + void add_waiter(uint64_t mask, Context *c) { parent->add_waiter(mask << get_wait_shift(), c); } - bool is_waiter_for(__u64 mask) { + bool is_waiter_for(uint64_t mask) { return parent->is_waiter_for(mask << get_wait_shift()); } diff --git a/src/mds/SnapServer.cc b/src/mds/SnapServer.cc index 0165f9161bae..e0c22b38c01e 100644 --- a/src/mds/SnapServer.cc +++ b/src/mds/SnapServer.cc @@ -40,7 +40,7 @@ void SnapServer::reset_state() // SERVER -void SnapServer::_prepare(bufferlist &bl, __u64 reqid, int bymds) +void SnapServer::_prepare(bufferlist &bl, uint64_t reqid, int bymds) { bufferlist::iterator p = bl.begin(); __u32 op; diff --git a/src/mds/SnapServer.h b/src/mds/SnapServer.h index 8380786b8d69..db5b6c964211 100644 --- a/src/mds/SnapServer.h +++ b/src/mds/SnapServer.h @@ -61,7 +61,7 @@ public: } // server bits - void _prepare(bufferlist &bl, __u64 reqid, int bymds); + void _prepare(bufferlist &bl, uint64_t reqid, int bymds); bool _is_prepared(version_t tid); void _commit(version_t tid); void _rollback(version_t tid); diff --git a/src/mds/events/EMetaBlob.h b/src/mds/events/EMetaBlob.h index 24a8d7b87d13..962ff8b9f8cc 100644 --- a/src/mds/events/EMetaBlob.h +++ b/src/mds/events/EMetaBlob.h @@ -351,12 +351,12 @@ private: // inodes i've truncated list truncate_start; // start truncate - map truncate_finish; // finished truncate (started in segment blah) + map truncate_finish; // finished truncate (started in segment blah) vector destroyed_inodes; // idempotent op(s) - list > client_reqs; + list > client_reqs; public: void encode(bufferlist& bl) const { @@ -409,7 +409,7 @@ private: list r; ::decode(r, bl); while (!r.empty()) { - client_reqs.push_back(pair(r.front(), 0)); + client_reqs.push_back(pair(r.front(), 0)); r.pop_front(); } } @@ -436,8 +436,8 @@ private: } } - void add_client_req(metareqid_t r, __u64 tid=0) { - client_reqs.push_back(pair(r, tid)); + void add_client_req(metareqid_t r, uint64_t tid=0) { + client_reqs.push_back(pair(r, tid)); } void add_table_transaction(int table, version_t tid) { @@ -465,7 +465,7 @@ private: void add_truncate_start(inodeno_t ino) { truncate_start.push_back(ino); } - void add_truncate_finish(inodeno_t ino, __u64 segoff) { + void add_truncate_finish(inodeno_t ino, uint64_t segoff) { truncate_finish[ino] = segoff; } diff --git a/src/mds/events/ETableServer.h b/src/mds/events/ETableServer.h index 0f4998c75ec8..a479efe2a869 100644 --- a/src/mds/events/ETableServer.h +++ b/src/mds/events/ETableServer.h @@ -24,14 +24,14 @@ struct ETableServer : public LogEvent { __u16 table; __s16 op; - __u64 reqid; + uint64_t reqid; __s32 bymds; bufferlist mutation; version_t tid; version_t version; ETableServer() : LogEvent(EVENT_TABLESERVER) { } - ETableServer(int t, int o, __u64 ri, int m, version_t ti, version_t v) : + ETableServer(int t, int o, uint64_t ri, int m, version_t ti, version_t v) : LogEvent(EVENT_TABLESERVER), table(t), op(o), reqid(ri), bymds(m), tid(ti), version(v) { } diff --git a/src/mds/journal.cc b/src/mds/journal.cc index 6e6cc26689f4..04767ea12c26 100644 --- a/src/mds/journal.cc +++ b/src/mds/journal.cc @@ -648,7 +648,7 @@ void EMetaBlob::replay(MDS *mds, LogSegment *logseg) assert(in); mds->mdcache->add_recovered_truncate(in, logseg); } - for (map::iterator p = truncate_finish.begin(); + for (map::iterator p = truncate_finish.begin(); p != truncate_finish.end(); p++) { LogSegment *ls = mds->mdlog->get_segment(p->second); @@ -673,7 +673,7 @@ void EMetaBlob::replay(MDS *mds, LogSegment *logseg) } // client requests - for (list >::iterator p = client_reqs.begin(); + for (list >::iterator p = client_reqs.begin(); p != client_reqs.end(); ++p) if (p->first.name.is_client()) { diff --git a/src/mds/mdstypes.h b/src/mds/mdstypes.h index b7bfd1d31d5f..401d96c9d3ae 100644 --- a/src/mds/mdstypes.h +++ b/src/mds/mdstypes.h @@ -108,12 +108,12 @@ struct frag_info_t { // this frag utime_t mtime; - __s64 nfiles; // files - __s64 nsubdirs; // subdirs + int64_t nfiles; // files + int64_t nsubdirs; // subdirs frag_info_t() : version(0), nfiles(0), nsubdirs(0) {} - __s64 size() const { return nfiles + nsubdirs; } + int64_t size() const { return nfiles + nsubdirs; } void zero() { *this = frag_info_t(); @@ -168,13 +168,13 @@ struct nest_info_t { // this frag + children utime_t rctime; - __s64 rbytes; - __s64 rfiles; - __s64 rsubdirs; - __s64 rsize() const { return rfiles + rsubdirs; } + int64_t rbytes; + int64_t rfiles; + int64_t rsubdirs; + int64_t rsize() const { return rfiles + rsubdirs; } - __s64 ranchors; // for dirstat, includes inode's anchored flag. - __s64 rsnaprealms; + int64_t ranchors; // for dirstat, includes inode's anchored flag. + int64_t rsnaprealms; nest_info_t() : version(0), rbytes(0), rfiles(0), rsubdirs(0), @@ -301,7 +301,7 @@ inline ostream& operator<<(ostream &out, const vinodeno_t &vino) { struct byte_range_t { - __u64 first, last; // interval client can write to + uint64_t first, last; // interval client can write to void encode(bufferlist &bl) const { ::encode(first, bl); @@ -383,8 +383,8 @@ struct inode_t { return layout.fl_object_size * layout.fl_stripe_count; } - __u64 get_max_size() const { - __u64 max = 0; + uint64_t get_max_size() const { + uint64_t max = 0; for (map::const_iterator p = client_ranges.begin(); p != client_ranges.end(); ++p) @@ -392,7 +392,7 @@ struct inode_t { max = p->second.last; return max; } - void set_max_size(__u64 new_max) { + void set_max_size(uint64_t new_max) { if (new_max == 0) { client_ranges.clear(); } else { @@ -668,7 +668,7 @@ inline ostream& operator<<(ostream& out, const string_snap_t &k) struct metareqid_t { entity_name_t name; - __u64 tid; + uint64_t tid; metareqid_t() : tid(0) {} metareqid_t(entity_name_t n, tid_t t) : name(n), tid(t) {} }; @@ -721,7 +721,7 @@ struct cap_reconnect_t { ceph_mds_cap_reconnect capinfo; cap_reconnect_t() {} - cap_reconnect_t(__u64 cap_id, inodeno_t pino, const string& p, int w, int i, uint64_t sz, utime_t mt, utime_t at, inodeno_t sr) : + cap_reconnect_t(uint64_t cap_id, inodeno_t pino, const string& p, int w, int i, uint64_t sz, utime_t mt, utime_t at, inodeno_t sr) : path(p) { capinfo.cap_id = cap_id; capinfo.wanted = w; @@ -1130,8 +1130,8 @@ class MDSCacheObject { const static int STATE_REJOINING = (1<<28); // replica has not joined w/ primary copy // -- wait -- - const static __u64 WAIT_SINGLEAUTH = (1ull<<60); - const static __u64 WAIT_UNFREEZE = (1ull<<59); // pka AUTHPINNABLE + const static uint64_t WAIT_SINGLEAUTH = (1ull<<60); + const static uint64_t WAIT_UNFREEZE = (1ull<<59); // pka AUTHPINNABLE // ============================================ @@ -1316,16 +1316,16 @@ protected: // --------------------------------------------- // waiting protected: - multimap<__u64, Context*> waiting; + multimap waiting; public: - bool is_waiter_for(__u64 mask, __u64 min=0) { + bool is_waiter_for(uint64_t mask, uint64_t min=0) { if (!min) { min = mask; while (min & (min-1)) // if more than one bit is set min &= min-1; // clear LSB } - for (multimap<__u64,Context*>::iterator p = waiting.lower_bound(min); + for (multimap::iterator p = waiting.lower_bound(min); p != waiting.end(); ++p) { if (p->first & mask) return true; @@ -1333,19 +1333,19 @@ protected: } return false; } - virtual void add_waiter(__u64 mask, Context *c) { + virtual void add_waiter(uint64_t mask, Context *c) { if (waiting.empty()) get(PIN_WAITER); - waiting.insert(pair<__u64,Context*>(mask, c)); + waiting.insert(pair(mask, c)); pdout(10,g_conf.debug_mds) << (mdsco_db_line_prefix(this)) << "add_waiter " << hex << mask << dec << " " << c << " on " << *this << dendl; } - virtual void take_waiting(__u64 mask, list& ls) { + virtual void take_waiting(uint64_t mask, list& ls) { if (waiting.empty()) return; - multimap<__u64,Context*>::iterator it = waiting.begin(); + multimap::iterator it = waiting.begin(); while (it != waiting.end()) { if (it->first & mask) { ls.push_back(it->second); @@ -1366,7 +1366,7 @@ protected: if (waiting.empty()) put(PIN_WAITER); } - void finish_waiting(__u64 mask, int result = 0) { + void finish_waiting(uint64_t mask, int result = 0) { list finished; take_waiting(mask, finished); finish_contexts(finished, result); @@ -1380,9 +1380,9 @@ protected: virtual void set_object_info(MDSCacheObjectInfo &info) { assert(0); } virtual void encode_lock_state(int type, bufferlist& bl) { assert(0); } virtual void decode_lock_state(int type, bufferlist& bl) { assert(0); } - virtual void finish_lock_waiters(int type, __u64 mask, int r=0) { assert(0); } - virtual void add_lock_waiter(int type, __u64 mask, Context *c) { assert(0); } - virtual bool is_lock_waiting(int type, __u64 mask) { assert(0); return false; } + virtual void finish_lock_waiters(int type, uint64_t mask, int r=0) { assert(0); } + virtual void add_lock_waiter(int type, uint64_t mask, Context *c) { assert(0); } + virtual bool is_lock_waiting(int type, uint64_t mask) { assert(0); return false; } virtual void clear_dirty_scattered(int type) { assert(0); } virtual void finish_scatter_gather_update(int type) { } diff --git a/src/mds/snap.cc b/src/mds/snap.cc index 7fa86b31c07c..f43ac0133a6a 100644 --- a/src/mds/snap.cc +++ b/src/mds/snap.cc @@ -25,7 +25,7 @@ #define DOUT_SUBSYS mds #undef dout_prefix #define dout_prefix _prefix(mdcache->mds->get_nodeid(), inode, seq, this) -static ostream& _prefix(int whoami, CInode *inode, __u64 seq, SnapRealm *realm) { +static ostream& _prefix(int whoami, CInode *inode, uint64_t seq, SnapRealm *realm) { return *_dout << dbeginl << " mds" << whoami << ".cache.snaprealm(" << inode->ino() diff --git a/src/messages/MAuthReply.h b/src/messages/MAuthReply.h index 94a5710dfc6a..83fb62864962 100644 --- a/src/messages/MAuthReply.h +++ b/src/messages/MAuthReply.h @@ -20,12 +20,12 @@ struct MAuthReply : public Message { __u32 protocol; __s32 result; - __u64 global_id; // if zero, meaningless + uint64_t global_id; // if zero, meaningless cstring result_msg; bufferlist result_bl; MAuthReply() : Message(CEPH_MSG_AUTH_REPLY), protocol(0), result(0) {} - MAuthReply(__u32 p, bufferlist *bl = NULL, int r = 0, __u64 gid=0, const char *msg = 0) : + MAuthReply(__u32 p, bufferlist *bl = NULL, int r = 0, uint64_t gid=0, const char *msg = 0) : Message(CEPH_MSG_AUTH_REPLY), protocol(p), result(r), global_id(gid), result_msg(msg) { diff --git a/src/messages/MClientCaps.h b/src/messages/MClientCaps.h index f48df57deab0..ed0d43a40701 100644 --- a/src/messages/MClientCaps.h +++ b/src/messages/MClientCaps.h @@ -33,12 +33,12 @@ class MClientCaps : public Message { inodeno_t get_ino() { return inodeno_t(head.ino); } inodeno_t get_realm() { return inodeno_t(head.realm); } - __u64 get_cap_id() { return head.cap_id; } + uint64_t get_cap_id() { return head.cap_id; } - __u64 get_size() { return head.size; } - __u64 get_max_size() { return head.max_size; } + uint64_t get_size() { return head.size; } + uint64_t get_max_size() { return head.max_size; } __u32 get_truncate_seq() { return head.truncate_seq; } - __u64 get_truncate_size() { return head.truncate_size; } + uint64_t get_truncate_size() { return head.truncate_size; } utime_t get_ctime() { return utime_t(head.ctime); } utime_t get_mtime() { return utime_t(head.mtime); } utime_t get_atime() { return utime_t(head.atime); } @@ -49,8 +49,8 @@ class MClientCaps : public Message { int get_migrate_seq() { return head.migrate_seq; } int get_op() { return head.op; } - __u64 get_client_tid() { return get_tid(); } - void set_client_tid(__u64 s) { set_tid(s); } + uint64_t get_client_tid() { return get_tid(); } + void set_client_tid(uint64_t s) { set_tid(s); } snapid_t get_snap_follows() { return snapid_t(head.snap_follows); } void set_snap_follows(snapid_t s) { head.snap_follows = s; } @@ -58,7 +58,7 @@ class MClientCaps : public Message { void set_caps(int c) { head.caps = c; } void set_wanted(int w) { head.wanted = w; } - void set_max_size(__u64 ms) { head.max_size = ms; } + void set_max_size(uint64_t ms) { head.max_size = ms; } void set_migrate_seq(unsigned m) { head.migrate_seq = m; } void set_op(int o) { head.op = o; } @@ -71,7 +71,7 @@ class MClientCaps : public Message { MClientCaps(int op, inodeno_t ino, inodeno_t realm, - __u64 id, + uint64_t id, long seq, int caps, int wanted, @@ -91,7 +91,7 @@ class MClientCaps : public Message { } MClientCaps(int op, inodeno_t ino, inodeno_t realm, - __u64 id, int mseq) : + uint64_t id, int mseq) : Message(CEPH_MSG_CLIENT_CAPS) { memset(&head, 0, sizeof(head)); head.op = op; diff --git a/src/messages/MClientLease.h b/src/messages/MClientLease.h index 3e6a0d8c9cc5..ed2d690e0b1d 100644 --- a/src/messages/MClientLease.h +++ b/src/messages/MClientLease.h @@ -30,7 +30,7 @@ struct MClientLease : public Message { snapid_t get_last() { return snapid_t(h.last); } MClientLease() : Message(CEPH_MSG_CLIENT_LEASE) {} - MClientLease(int ac, ceph_seq_t seq, int m, __u64 i, __u64 sf, __u64 sl) : + MClientLease(int ac, ceph_seq_t seq, int m, uint64_t i, uint64_t sf, uint64_t sl) : Message(CEPH_MSG_CLIENT_LEASE) { h.action = ac; h.seq = seq; @@ -39,7 +39,7 @@ struct MClientLease : public Message { h.first = sf; h.last = sl; } - MClientLease(int ac, ceph_seq_t seq, int m, __u64 i, __u64 sf, __u64 sl, const nstring& d) : + MClientLease(int ac, ceph_seq_t seq, int m, uint64_t i, uint64_t sf, uint64_t sl, const nstring& d) : Message(CEPH_MSG_CLIENT_LEASE), dname(d) { h.action = ac; diff --git a/src/messages/MClientReconnect.h b/src/messages/MClientReconnect.h index 27fd843b9747..81f294421133 100644 --- a/src/messages/MClientReconnect.h +++ b/src/messages/MClientReconnect.h @@ -34,7 +34,7 @@ public: << caps.size() << " caps)"; } - void add_cap(inodeno_t ino, __u64 cap_id, inodeno_t pathbase, const string& path, + void add_cap(inodeno_t ino, uint64_t cap_id, inodeno_t pathbase, const string& path, int wanted, int issued, loff_t sz, utime_t mt, utime_t at, inodeno_t sr) { diff --git a/src/messages/MClientReply.h b/src/messages/MClientReply.h index 0163cc423614..ab6d9bb9acd5 100644 --- a/src/messages/MClientReply.h +++ b/src/messages/MClientReply.h @@ -101,7 +101,7 @@ struct InodeStat { unsigned mode, uid, gid, nlink, rdev; loff_t size, max_size; version_t truncate_seq; - __u64 truncate_size; + uint64_t truncate_size; utime_t ctime, mtime, atime; version_t time_warp_seq; diff --git a/src/messages/MMDSBeacon.h b/src/messages/MMDSBeacon.h index f516c33062a3..6ad26af4349e 100644 --- a/src/messages/MMDSBeacon.h +++ b/src/messages/MMDSBeacon.h @@ -23,7 +23,7 @@ class MMDSBeacon : public PaxosServiceMessage { ceph_fsid_t fsid; - __u64 global_id; + uint64_t global_id; string name; __u32 state; @@ -33,13 +33,13 @@ class MMDSBeacon : public PaxosServiceMessage { public: MMDSBeacon() : PaxosServiceMessage(MSG_MDS_BEACON, 0) {} - MMDSBeacon(const ceph_fsid_t &f, __u64 g, string& n, epoch_t les, int st, version_t se) : + MMDSBeacon(const ceph_fsid_t &f, uint64_t g, string& n, epoch_t les, int st, version_t se) : PaxosServiceMessage(MSG_MDS_BEACON, les), fsid(f), global_id(g), name(n), state(st), seq(se), standby_for_rank(-1) { } ceph_fsid_t& get_fsid() { return fsid; } - __u64 get_global_id() { return global_id; } + uint64_t get_global_id() { return global_id; } string& get_name() { return name; } epoch_t get_last_epoch_seen() { return version; } int get_state() { return state; } diff --git a/src/messages/MMDSLoadTargets.h b/src/messages/MMDSLoadTargets.h index 8b77d361ea77..381ffdd2c73c 100644 --- a/src/messages/MMDSLoadTargets.h +++ b/src/messages/MMDSLoadTargets.h @@ -24,12 +24,12 @@ using std::map; class MMDSLoadTargets : public PaxosServiceMessage { public: - __u64 global_id; + uint64_t global_id; set targets; MMDSLoadTargets() : PaxosServiceMessage(MSG_MDS_OFFLOAD_TARGETS, 0) {} - MMDSLoadTargets(__u64 g, set& mds_targets) : + MMDSLoadTargets(uint64_t g, set& mds_targets) : PaxosServiceMessage(MSG_MDS_OFFLOAD_TARGETS, 0), global_id(g), targets(mds_targets) {} diff --git a/src/messages/MMDSTableRequest.h b/src/messages/MMDSTableRequest.h index 0d7d8ff8e93c..a203a68fe219 100644 --- a/src/messages/MMDSTableRequest.h +++ b/src/messages/MMDSTableRequest.h @@ -23,11 +23,11 @@ class MMDSTableRequest : public Message { public: __u16 table; __s16 op; - __u64 reqid; + uint64_t reqid; bufferlist bl; MMDSTableRequest() {} - MMDSTableRequest(int tab, int o, __u64 r, version_t v=0) : + MMDSTableRequest(int tab, int o, uint64_t r, version_t v=0) : Message(MSG_MDS_TABLE_REQUEST), table(tab), op(o), reqid(r) { set_tid(v); diff --git a/src/messages/MOSDOp.h b/src/messages/MOSDOp.h index 748da1f98050..d3ed9970625d 100644 --- a/src/messages/MOSDOp.h +++ b/src/messages/MOSDOp.h @@ -103,14 +103,14 @@ public: void set_mtime(utime_t mt) { head.mtime = mt; } // ops - void add_simple_op(int o, __u64 off, __u64 len) { + void add_simple_op(int o, uint64_t off, uint64_t len) { OSDOp osd_op; osd_op.op.op = o; osd_op.op.extent.offset = off; osd_op.op.extent.length = len; ops.push_back(osd_op); } - void write(__u64 off, __u64 len, bufferlist& bl) { + void write(uint64_t off, uint64_t len, bufferlist& bl) { add_simple_op(CEPH_OSD_OP_WRITE, off, len); data.claim(bl); header.data_off = off; @@ -120,17 +120,17 @@ public: data.claim(bl); header.data_off = 0; } - void zero(__u64 off, __u64 len) { + void zero(uint64_t off, uint64_t len) { add_simple_op(CEPH_OSD_OP_ZERO, off, len); } - void truncate(__u64 off) { + void truncate(uint64_t off) { add_simple_op(CEPH_OSD_OP_TRUNCATE, off, 0); } void remove() { add_simple_op(CEPH_OSD_OP_DELETE, 0, 0); } - void read(__u64 off, __u64 len) { + void read(uint64_t off, uint64_t len) { add_simple_op(CEPH_OSD_OP_READ, off, len); } void stat() { @@ -205,7 +205,7 @@ public: out << "w"; #endif if (head.snapid != CEPH_NOSNAP) - out << "@" << snapid_t((__u64)head.snapid); + out << "@" << snapid_t((uint64_t)head.snapid); out << " " << ops; out << " " << pg_t(head.layout.ol_pgid); diff --git a/src/messages/MOSDSubOp.h b/src/messages/MOSDSubOp.h index f0936f59e846..19fe94da7daa 100644 --- a/src/messages/MOSDSubOp.h +++ b/src/messages/MOSDSubOp.h @@ -42,7 +42,7 @@ public: bool noop; bool old_exists; - __u64 old_size; + uint64_t old_size; eversion_t old_version; SnapSet snapset; @@ -61,8 +61,8 @@ public: map attrset; - interval_set<__u64> data_subset; - map > clone_subsets; + interval_set data_subset; + map > clone_subsets; virtual void decode_payload() { bufferlist::iterator p = payload.begin(); diff --git a/src/messages/MPoolOp.h b/src/messages/MPoolOp.h index 9965e7980fc2..43c99f693c83 100644 --- a/src/messages/MPoolOp.h +++ b/src/messages/MPoolOp.h @@ -49,7 +49,7 @@ public: int pool; string name; int op; - __u64 auid; + uint64_t auid; MPoolOp() : PaxosServiceMessage(MSG_POOLOP, 0) {} MPoolOp(const ceph_fsid_t& f, tid_t t, int p, string& n, int o, version_t v) : @@ -58,7 +58,7 @@ public: set_tid(t); } MPoolOp(const ceph_fsid_t& f, tid_t t, int p, string& n, - int o, __u64 uid, version_t v) : + int o, uint64_t uid, version_t v) : PaxosServiceMessage(MSG_POOLOP, v), fsid(f), pool(p), name(n), op(o), auid(uid) { set_tid(t); diff --git a/src/messages/MRoute.h b/src/messages/MRoute.h index 9a0e350746a1..f0701404fce4 100644 --- a/src/messages/MRoute.h +++ b/src/messages/MRoute.h @@ -21,14 +21,14 @@ #include "include/encoding.h" struct MRoute : public Message { - __u64 session_mon_tid; + uint64_t session_mon_tid; Message *msg; entity_inst_t dest; MRoute() : Message(MSG_ROUTE), msg(NULL) {} - MRoute(__u64 t, Message *m, entity_inst_t i) : + MRoute(uint64_t t, Message *m, entity_inst_t i) : Message(MSG_ROUTE), session_mon_tid(t), msg(m), dest(i) {} - MRoute(__u64 t, bufferlist bl, entity_inst_t i) : + MRoute(uint64_t t, bufferlist bl, entity_inst_t i) : Message(MSG_ROUTE), session_mon_tid(t), dest(i) { bufferlist::iterator p = bl.begin(); msg = decode_message(p); diff --git a/src/messages/PaxosServiceMessage.h b/src/messages/PaxosServiceMessage.h index 88695f3d7536..59a30182b3e1 100644 --- a/src/messages/PaxosServiceMessage.h +++ b/src/messages/PaxosServiceMessage.h @@ -8,7 +8,7 @@ class PaxosServiceMessage : public Message { public: version_t version; __s16 session_mon; - __u64 session_mon_tid; + uint64_t session_mon_tid; PaxosServiceMessage() : Message(MSG_PAXOS), version(0), session_mon(-1), session_mon_tid(0) { } diff --git a/src/mon/AuthMonitor.cc b/src/mon/AuthMonitor.cc index 9eb745004ebe..eeffecd1e33b 100644 --- a/src/mon/AuthMonitor.cc +++ b/src/mon/AuthMonitor.cc @@ -416,7 +416,7 @@ bool AuthMonitor::prep_auth(MAuth *m, bool paxos_writable) } try { - __u64 auid; + uint64_t auid; if (start) { // new session proto = s->auth_handler->start_session(entity_name, indata, response_bl, caps_info); diff --git a/src/mon/MDSMonitor.cc b/src/mon/MDSMonitor.cc index e8557468c111..ff74ab325d26 100644 --- a/src/mon/MDSMonitor.cc +++ b/src/mon/MDSMonitor.cc @@ -142,7 +142,7 @@ bool MDSMonitor::preprocess_query(PaxosServiceMessage *m) void MDSMonitor::_note_beacon(MMDSBeacon *m) { - __u64 gid = m->get_global_id(); + uint64_t gid = m->get_global_id(); version_t seq = m->get_seq(); dout(15) << "_note_beacon " << *m << " noting time" << dendl; @@ -154,7 +154,7 @@ bool MDSMonitor::preprocess_beacon(MMDSBeacon *m) { entity_addr_t addr = m->get_orig_source_inst().addr; int state = m->get_state(); - __u64 gid = m->get_global_id(); + uint64_t gid = m->get_global_id(); version_t seq = m->get_seq(); MDSMap::mds_info_t info; @@ -250,7 +250,7 @@ bool MDSMonitor::preprocess_beacon(MMDSBeacon *m) bool MDSMonitor::preprocess_offload_targets(MMDSLoadTargets* m) { dout(10) << "preprocess_offload_targets " << *m << " from " << m->get_orig_source() << dendl; - __u64 gid; + uint64_t gid; // check privileges, ignore message if fails MonSession *session = m->get_session(); @@ -305,7 +305,7 @@ bool MDSMonitor::prepare_beacon(MMDSBeacon *m) // -- this is an update -- dout(12) << "prepare_beacon " << *m << " from " << m->get_orig_source_inst() << dendl; entity_addr_t addr = m->get_orig_source_inst().addr; - __u64 gid = m->get_global_id(); + uint64_t gid = m->get_global_id(); int state = m->get_state(); version_t seq = m->get_seq(); @@ -361,7 +361,7 @@ bool MDSMonitor::prepare_beacon(MMDSBeacon *m) bool MDSMonitor::prepare_offload_targets(MMDSLoadTargets *m) { - __u64 gid = m->global_id; + uint64_t gid = m->global_id; if (pending_mdsmap.mds_info.count(gid)) { dout(10) << "prepare_offload_targets " << gid << " " << m->targets << dendl; pending_mdsmap.mds_info[gid].export_targets = m->targets; @@ -523,7 +523,7 @@ bool MDSMonitor::prepare_command(MMonCommand *m) int who = atoi(m->cmd[2].c_str()); if (mdsmap.is_active(who)) { r = 0; - __u64 gid = pending_mdsmap.up[who]; + uint64_t gid = pending_mdsmap.up[who]; ss << "telling mds" << who << " " << pending_mdsmap.mds_info[gid].addr << " to stop"; pending_mdsmap.mds_info[gid].state = MDSMap::STATE_STOPPING; } else { @@ -554,7 +554,7 @@ bool MDSMonitor::prepare_command(MMonCommand *m) //ss << "mdsmap fsid " << map.fsid << " does not match monitor fsid " << mon->monmap->fsid; } else if (m->cmd[1] == "set_state" && m->cmd.size() == 4) { - __u64 gid = atoi(m->cmd[2].c_str()); + uint64_t gid = atoi(m->cmd[2].c_str()); int state = atoi(m->cmd[3].c_str()); if (!pending_mdsmap.is_dne_gid(gid)) { MDSMap::mds_info_t& info = pending_mdsmap.get_info_gid(gid); @@ -628,7 +628,7 @@ void MDSMonitor::tick() string name; while (pending_mdsmap.is_in(mds)) mds++; - __u64 newgid = pending_mdsmap.find_standby_for(mds, name); + uint64_t newgid = pending_mdsmap.find_standby_for(mds, name); if (!newgid) break; @@ -653,7 +653,7 @@ void MDSMonitor::tick() cutoff -= g_conf.mds_beacon_grace; // make sure last_beacon is fully populated - for (map<__u64,MDSMap::mds_info_t>::iterator p = pending_mdsmap.mds_info.begin(); + for (map::iterator p = pending_mdsmap.mds_info.begin(); p != pending_mdsmap.mds_info.end(); ++p) { if (last_beacon.count(p->first) == 0) { @@ -670,11 +670,11 @@ void MDSMonitor::tick() bool propose_osdmap = false; - map<__u64, beacon_info_t>::iterator p = last_beacon.begin(); + map::iterator p = last_beacon.begin(); while (p != last_beacon.end()) { - __u64 gid = p->first; + uint64_t gid = p->first; utime_t since = p->second.stamp; - __u64 seq = p->second.seq; + uint64_t seq = p->second.seq; p++; if (pending_mdsmap.mds_info.count(gid) == 0) { @@ -694,7 +694,7 @@ void MDSMonitor::tick() // are we in? // and is there a non-laggy standby that can take over for us? - __u64 sgid; + uint64_t sgid; if (info.rank >= 0 && info.state != CEPH_MDS_STATE_STANDBY && (sgid = pending_mdsmap.find_standby_for(info.rank, info.name)) != 0) { @@ -769,7 +769,7 @@ void MDSMonitor::tick() set::iterator p = failed.begin(); while (p != failed.end()) { int f = *p++; - __u64 sgid; + uint64_t sgid; string name; // FIXME sgid = pending_mdsmap.find_standby_for(f, name); if (sgid) { @@ -791,8 +791,8 @@ void MDSMonitor::tick() pending_mdsmap.get_num_mds(MDSMap::STATE_STANDBY) >= pending_mdsmap.get_num_mds()) { // see which nodes are shadowed set shadowed; - map > avail; - for (map<__u64,MDSMap::mds_info_t>::iterator p = pending_mdsmap.mds_info.begin(); + map > avail; + for (map::iterator p = pending_mdsmap.mds_info.begin(); p != pending_mdsmap.mds_info.end(); p++) { if (p->second.state == MDSMap::STATE_STANDBY_REPLAY) @@ -810,7 +810,7 @@ void MDSMonitor::tick() continue; // already shadowed. if (pending_mdsmap.get_state(*p) < MDSMap::STATE_ACTIVE) continue; // only shadow active mds - __u64 sgid; + uint64_t sgid; if (avail[*p].size()) { sgid = *avail[*p].begin(); avail[*p].erase(avail[*p].begin()); @@ -845,9 +845,9 @@ void MDSMonitor::do_stop() dout(7) << "do_stop stopping active mds nodes" << dendl; print_map(mdsmap); - map<__u64,MDSMap::mds_info_t>::iterator p = pending_mdsmap.mds_info.begin(); + map::iterator p = pending_mdsmap.mds_info.begin(); while (p != pending_mdsmap.mds_info.end()) { - __u64 gid = p->first; + uint64_t gid = p->first; MDSMap::mds_info_t& info = p->second; p++; switch (info.state) { diff --git a/src/mon/MDSMonitor.h b/src/mon/MDSMonitor.h index 4765545056f4..b833ac1730dc 100644 --- a/src/mon/MDSMonitor.h +++ b/src/mon/MDSMonitor.h @@ -89,9 +89,9 @@ class MDSMonitor : public PaxosService { // beacons struct beacon_info_t { utime_t stamp; - __u64 seq; + uint64_t seq; }; - map<__u64, beacon_info_t> last_beacon; + map last_beacon; public: MDSMonitor(Monitor *mn, Paxos *p) : PaxosService(mn, p) { } diff --git a/src/mon/MonCaps.cc b/src/mon/MonCaps.cc index bd8b523ee837..1b297d1d6ba3 100644 --- a/src/mon/MonCaps.cc +++ b/src/mon/MonCaps.cc @@ -244,7 +244,7 @@ rwx_t MonCaps::get_caps(int service) * only get as much access as they allow you AND you have on your own data. * */ -bool MonCaps::check_privileges(int service, int req_perms, __u64 req_auid) +bool MonCaps::check_privileges(int service, int req_perms, uint64_t req_auid) { if (allow_all) return true; //you're an admin, do anything! if (req_auid != CEPH_AUTH_UID_DEFAULT && req_auid != auid) { diff --git a/src/mon/MonCaps.h b/src/mon/MonCaps.h index 65ac28ff9778..64ec34dd606a 100644 --- a/src/mon/MonCaps.h +++ b/src/mon/MonCaps.h @@ -67,7 +67,7 @@ struct MonCaps { bool is_rwx(string& token, rwx_t& cap_val); int get_service_id(string& token); bool allow_all; - __u64 auid; + uint64_t auid; public: MonCaps() : text(), default_action(0), allow_all(false), auid(CEPH_AUTH_UID_DEFAULT) {} @@ -75,9 +75,9 @@ public: bool parse(bufferlist::iterator& iter); rwx_t get_caps(int service); bool check_privileges(int service, int req_perm, - __u64 auid=CEPH_AUTH_UID_DEFAULT); + uint64_t auid=CEPH_AUTH_UID_DEFAULT); void set_allow_all(bool allow) { allow_all = allow; } - void set_auid(__u64 uid) { auid = uid; } + void set_auid(uint64_t uid) { auid = uid; } void encode(bufferlist& bl) const { ::encode(text, bl); diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index 3a9559f4eb12..9da444f2d3ae 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -482,7 +482,7 @@ void Monitor::resend_routed_requests() { dout(10) << "resend_routed_requests" << dendl; int mon = get_leader(); - for (map<__u64, RoutedRequest*>::iterator p = routed_requests.begin(); + for (map::iterator p = routed_requests.begin(); p != routed_requests.end(); p++) { RoutedRequest *rr = p->second; @@ -501,7 +501,7 @@ void Monitor::remove_session(MonSession *s) { dout(10) << "remove_session " << s << " " << s->inst << dendl; assert(!s->closed); - for (set<__u64>::iterator p = s->routed_request_tids.begin(); + for (set::iterator p = s->routed_request_tids.begin(); p != s->routed_request_tids.end(); p++) { if (routed_requests.count(*p)) { diff --git a/src/mon/Monitor.h b/src/mon/Monitor.h index cba7f401da28..829c506e346f 100644 --- a/src/mon/Monitor.h +++ b/src/mon/Monitor.h @@ -161,7 +161,7 @@ public: // request routing struct RoutedRequest { - __u64 tid; + uint64_t tid; bufferlist request_bl; MonSession *session; @@ -170,8 +170,8 @@ public: session->put(); } }; - __u64 routed_request_tid; - map<__u64, RoutedRequest*> routed_requests; + uint64_t routed_request_tid; + map routed_requests; void forward_request_leader(PaxosServiceMessage *req); void handle_forward(MForward *m); diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index f1ccdb459a02..3691d17ca3ed 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -1052,7 +1052,7 @@ bool OSDMonitor::preprocess_command(MMonCommand *m) } } else if (m->cmd[1] == "lspools") { - __u64 uid_pools = 0; + uint64_t uid_pools = 0; if (m->cmd.size() > 2) { uid_pools = strtol(m->cmd[2].c_str(), NULL, 10); } @@ -1087,7 +1087,7 @@ int OSDMonitor::prepare_new_pool(MPoolOp *m) return prepare_new_pool(m->name, session->caps.auid); } -int OSDMonitor::prepare_new_pool(string& name, __u64 auid) +int OSDMonitor::prepare_new_pool(string& name, uint64_t auid) { if (osdmap.name_pool.count(name)) { return -EEXIST; diff --git a/src/mon/OSDMonitor.h b/src/mon/OSDMonitor.h index 246822508f97..ba151ae6411e 100644 --- a/src/mon/OSDMonitor.h +++ b/src/mon/OSDMonitor.h @@ -90,7 +90,7 @@ private: bool prepare_pool_op_create (MPoolOp *m); bool prepare_pool_op_delete(MPoolOp *m); bool prepare_pool_op_auid(MPoolOp *m); - int prepare_new_pool(string& name, __u64 auid = CEPH_AUTH_UID_DEFAULT); + int prepare_new_pool(string& name, uint64_t auid = CEPH_AUTH_UID_DEFAULT); int prepare_new_pool(MPoolOp *m); void _pool_op(MPoolOp *m, int replyCode, epoch_t epoch); diff --git a/src/mon/Session.h b/src/mon/Session.h index 0c3ad3666831..d67222612b8a 100644 --- a/src/mon/Session.h +++ b/src/mon/Session.h @@ -39,7 +39,7 @@ struct MonSession : public RefCountedObject { utime_t until; bool closed; xlist::item item; - set<__u64> routed_request_tids; + set routed_request_tids; MonCaps caps; uint64_t global_id; uint64_t notified_global_id; diff --git a/src/msg/Message.h b/src/msg/Message.h index 97bca7172f39..f850de3abe6c 100644 --- a/src/msg/Message.h +++ b/src/msg/Message.h @@ -311,8 +311,8 @@ public: int get_type() { return header.type; } void set_type(int t) { header.type = t; } - __u64 get_tid() { return header.tid; } - void set_tid(__u64 t) { header.tid = t; } + uint64_t get_tid() { return header.tid; } + void set_tid(uint64_t t) { header.tid = t; } unsigned get_seq() { return header.seq; } void set_seq(unsigned s) { header.seq = s; } diff --git a/src/msg/SimpleMessenger.cc b/src/msg/SimpleMessenger.cc index 5f72aca530e2..bf60434e90ce 100644 --- a/src/msg/SimpleMessenger.cc +++ b/src/msg/SimpleMessenger.cc @@ -622,7 +622,7 @@ int SimpleMessenger::Pipe::accept() bufferptr bp; bufferlist authorizer, authorizer_reply; bool authorizer_valid; - __u64 feat_missing; + uint64_t feat_missing; // this should roughly mirror pseudocode at // http://ceph.newdream.net/wiki/Messaging_protocol @@ -671,7 +671,7 @@ int SimpleMessenger::Pipe::accept() goto reply; } - feat_missing = get_required_bits() & ~(__u64)connect.features; + feat_missing = get_required_bits() & ~(uint64_t)connect.features; if (feat_missing) { dout(1) << "peer missing required features " << std::hex << feat_missing << std::dec << dendl; reply.tag = CEPH_MSGR_TAG_FEATURES; @@ -803,7 +803,7 @@ int SimpleMessenger::Pipe::accept() assert(0); reply: - reply.features = ((__u64)connect.features & get_supported_bits()) | get_required_bits(); + reply.features = ((uint64_t)connect.features & get_supported_bits()) | get_required_bits(); reply.authorizer_len = authorizer_reply.length(); rc = tcp_write(sd, (char*)&reply, sizeof(reply)); if (rc < 0) @@ -1148,7 +1148,7 @@ int SimpleMessenger::Pipe::connect() } if (reply.tag == CEPH_MSGR_TAG_READY) { - __u64 feat_missing = get_required_bits() & ~(__u64)reply.features; + uint64_t feat_missing = get_required_bits() & ~(uint64_t)reply.features; if (feat_missing) { dout(1) << "missing required features " << std::hex << feat_missing << std::dec << dendl; goto fail_locked; @@ -1879,7 +1879,7 @@ int SimpleMessenger::Pipe::do_sendmsg(int sd, struct msghdr *msg, int len, bool } -int SimpleMessenger::Pipe::write_ack(__u64 seq) +int SimpleMessenger::Pipe::write_ack(uint64_t seq) { dout(10) << "write_ack " << seq << dendl; diff --git a/src/msg/SimpleMessenger.h b/src/msg/SimpleMessenger.h index d0a520dcad41..dc9ade0a01af 100644 --- a/src/msg/SimpleMessenger.h +++ b/src/msg/SimpleMessenger.h @@ -131,8 +131,8 @@ private: bool keepalive; __u32 connect_seq, peer_global_seq; - __u64 out_seq; - __u64 in_seq, in_seq_acked; + uint64_t out_seq; + uint64_t in_seq, in_seq_acked; int get_required_bits(); /* get bits this Messenger requires * the peer to support */ @@ -147,7 +147,7 @@ private: Message *read_message(); int write_message(Message *m); int do_sendmsg(int sd, struct msghdr *msg, int len, bool more=false); - int write_ack(__u64 s); + int write_ack(uint64_t s); int write_keepalive(); void fault(bool silent=false, bool reader=false); diff --git a/src/msg/msg_types.h b/src/msg/msg_types.h index 584692564f3d..fac13173fc0c 100644 --- a/src/msg/msg_types.h +++ b/src/msg/msg_types.h @@ -23,7 +23,7 @@ class entity_name_t { public: __u8 _type; - __s64 _num; + int64_t _num; public: static const int TYPE_MON = CEPH_ENTITY_TYPE_MON; @@ -35,7 +35,7 @@ public: // cons entity_name_t() : _type(0), _num(0) { } - entity_name_t(int t, __s64 n) : _type(t), _num(n) { } + entity_name_t(int t, int64_t n) : _type(t), _num(n) { } entity_name_t(const ceph_entity_name &n) : _type(n.type), _num(n.num) { } @@ -45,7 +45,7 @@ public: static entity_name_t OSD(int i=NEW) { return entity_name_t(TYPE_OSD, i); } static entity_name_t CLIENT(int i=NEW) { return entity_name_t(TYPE_CLIENT, i); } - __s64 num() const { return _num; } + int64_t num() const { return _num; } int type() const { return _type; } const char *type_str() const { return ceph_entity_type_name(type()); diff --git a/src/os/FileJournal.cc b/src/os/FileJournal.cc index ad66036915c4..9d5f20af9cdd 100644 --- a/src/os/FileJournal.cc +++ b/src/os/FileJournal.cc @@ -59,7 +59,7 @@ int FileJournal::_open(bool forwrite, bool create) block_size = st.st_blksize; if (create && max_size < (g_conf.osd_journal_size << 20)) { - __u64 newsize = g_conf.osd_journal_size << 20; + uint64_t newsize = g_conf.osd_journal_size << 20; dout(10) << "_open extending to " << newsize << " bytes" << dendl; r = ::ftruncate(fd, newsize); if (r == 0) @@ -180,7 +180,7 @@ int FileJournal::create() return 0; } -int FileJournal::open(__u64 next_seq) +int FileJournal::open(uint64_t next_seq) { dout(2) << "open " << fn << " next_seq " << next_seq << dendl; @@ -227,7 +227,7 @@ int FileJournal::open(__u64 next_seq) // find next entry read_pos = header.start; - __u64 seq = 0; + uint64_t seq = 0; while (1) { bufferlist bl; off64_t old_pos = read_pos; @@ -324,7 +324,7 @@ bufferptr FileJournal::prepare_header() -int FileJournal::check_for_full(__u64 seq, off64_t pos, off64_t size) +int FileJournal::check_for_full(uint64_t seq, off64_t pos, off64_t size) { // already full? if (full_commit_seq || full_restart_seq) @@ -377,7 +377,7 @@ int FileJournal::check_for_full(__u64 seq, off64_t pos, off64_t size) return -ENOSPC; } -int FileJournal::prepare_multi_write(bufferlist& bl, __u64& orig_ops, __u64& orig_bytes) +int FileJournal::prepare_multi_write(bufferlist& bl, uint64_t& orig_ops, uint64_t& orig_bytes) { // gather queued writes off64_t queue_pos = write_pos; @@ -415,10 +415,10 @@ int FileJournal::prepare_multi_write(bufferlist& bl, __u64& orig_ops, __u64& ori return 0; } -int FileJournal::prepare_single_write(bufferlist& bl, off64_t& queue_pos, __u64& orig_ops, __u64& orig_bytes) +int FileJournal::prepare_single_write(bufferlist& bl, off64_t& queue_pos, uint64_t& orig_ops, uint64_t& orig_bytes) { // grab next item - __u64 seq = writeq.front().seq; + uint64_t seq = writeq.front().seq; bufferlist &ebl = writeq.front().bl; off64_t base_size = 2*sizeof(entry_header_t) + ebl.length(); off64_t size = ROUND_UP_TO(base_size, header.alignment); @@ -458,7 +458,7 @@ int FileJournal::prepare_single_write(bufferlist& bl, off64_t& queue_pos, __u64& // pop from writeq writeq.pop_front(); - journalq.push_back(pair<__u64,off64_t>(seq, queue_pos)); + journalq.push_back(pair(seq, queue_pos)); queue_pos += size; if (queue_pos > header.max_size) @@ -622,8 +622,8 @@ void FileJournal::write_thread_entry() continue; } - __u64 orig_ops = 0; - __u64 orig_bytes = 0; + uint64_t orig_ops = 0; + uint64_t orig_bytes = 0; bufferlist bl; int r = prepare_multi_write(bl, orig_ops, orig_bytes); @@ -636,8 +636,8 @@ void FileJournal::write_thread_entry() assert(r == 0); do_write(bl); - __u64 new_ops = throttle_ops.put(orig_ops); - __u64 new_bytes = throttle_bytes.put(orig_bytes); + uint64_t new_ops = throttle_ops.put(orig_ops); + uint64_t new_bytes = throttle_bytes.put(orig_bytes); dout(10) << "write_thread throttle finished " << orig_ops << " ops and " << orig_bytes << " bytes, now " << new_ops << " ops and " << new_bytes << " bytes" @@ -649,7 +649,7 @@ void FileJournal::write_thread_entry() } -void FileJournal::submit_entry(__u64 seq, bufferlist& e, Context *oncommit) +void FileJournal::submit_entry(uint64_t seq, bufferlist& e, Context *oncommit) { Mutex::Locker locker(write_lock); // ** lock ** @@ -682,7 +682,7 @@ void FileJournal::submit_entry(__u64 seq, bufferlist& e, Context *oncommit) } -void FileJournal::committed_thru(__u64 seq) +void FileJournal::committed_thru(uint64_t seq) { Mutex::Locker locker(write_lock); @@ -786,7 +786,7 @@ void FileJournal::wrap_read_bl(off64_t& pos, int64_t olen, bufferlist& bl) } } -bool FileJournal::read_entry(bufferlist& bl, __u64& seq) +bool FileJournal::read_entry(bufferlist& bl, uint64_t& seq) { if (!read_pos) { dout(2) << "read_entry -- not readable" << dendl; @@ -843,7 +843,7 @@ bool FileJournal::read_entry(bufferlist& bl, __u64& seq) // ok! seq = h->seq; - journalq.push_back(pair<__u64,off64_t>(h->seq, read_pos)); + journalq.push_back(pair(h->seq, read_pos)); read_pos = pos; assert(read_pos % header.alignment == 0); diff --git a/src/os/FileJournal.h b/src/os/FileJournal.h index d96c4d68f355..80a3b090ab5a 100644 --- a/src/os/FileJournal.h +++ b/src/os/FileJournal.h @@ -33,11 +33,11 @@ public: struct header_t { __u32 version; __u32 flags; - __u64 fsid; + uint64_t fsid; __u32 block_size; __u32 alignment; - __s64 max_size; // max size of journal ring buffer - __s64 start; // offset of first entry + int64_t max_size; // max size of journal ring buffer + int64_t start; // offset of first entry header_t() : version(1), flags(0), fsid(0), block_size(0), alignment(0), max_size(0), start(0) {} @@ -78,27 +78,27 @@ private: off64_t write_pos; // byte where the next entry to be written will go off64_t read_pos; // - __u64 last_committed_seq; + uint64_t last_committed_seq; - __u64 full_commit_seq; // don't write, wait for this seq to commit - __u64 full_restart_seq; // start writing again with this seq + uint64_t full_commit_seq; // don't write, wait for this seq to commit + uint64_t full_restart_seq; // start writing again with this seq int fd; // in journal - deque > journalq; // track seq offsets, so we can trim later. + deque > journalq; // track seq offsets, so we can trim later. // currently being journaled and awaiting callback. // or, awaiting callback bc journal was full. - deque<__u64> writing_seq; + deque writing_seq; deque writing_fin; // waiting to be journaled struct write_item { - __u64 seq; + uint64_t seq; bufferlist bl; Context *fin; - write_item(__u64 s, bufferlist& b, Context *f) : seq(s), fin(f) { bl.claim(b); } + write_item(uint64_t s, bufferlist& b, Context *f) : seq(s), fin(f) { bl.claim(b); } }; deque writeq; @@ -120,9 +120,9 @@ private: void stop_writer(); void write_thread_entry(); - int check_for_full(__u64 seq, off64_t pos, off64_t size); - int prepare_multi_write(bufferlist& bl, __u64& orig_ops, __u64& orig_bytee); - int prepare_single_write(bufferlist& bl, off64_t& queue_pos, __u64& orig_ops, __u64& orig_bytes); + int check_for_full(uint64_t seq, off64_t pos, off64_t size); + int prepare_multi_write(bufferlist& bl, uint64_t& orig_ops, uint64_t& orig_bytee); + int prepare_single_write(bufferlist& bl, off64_t& queue_pos, uint64_t& orig_ops, uint64_t& orig_bytes); void do_write(bufferlist& bl); void write_bl(off64_t& pos, bufferlist& bl); @@ -143,7 +143,7 @@ private: } public: - FileJournal(__u64 fsid, Finisher *fin, Cond *sync_cond, const char *f, bool dio=false) : + FileJournal(uint64_t fsid, Finisher *fin, Cond *sync_cond, const char *f, bool dio=false) : Journal(fsid, fin, sync_cond), fn(f), zero_buf(NULL), max_size(0), block_size(0), @@ -161,7 +161,7 @@ private: } int create(); - int open(__u64 last_seq); + int open(uint64_t last_seq); void close(); void flush(); @@ -174,14 +174,14 @@ private: void make_writeable(); // writes - void submit_entry(__u64 seq, bufferlist& bl, Context *oncommit); // submit an item - void committed_thru(__u64 seq); + void submit_entry(uint64_t seq, bufferlist& bl, Context *oncommit); // submit an item + void committed_thru(uint64_t seq); bool is_full(); void set_wait_on_full(bool b) { wait_on_full = b; } // reads - bool read_entry(bufferlist& bl, __u64& seq); + bool read_entry(bufferlist& bl, uint64_t& seq); }; #endif diff --git a/src/os/FileStore.cc b/src/os/FileStore.cc index 26c667a4dc2e..1db470eb1f84 100644 --- a/src/os/FileStore.cc +++ b/src/os/FileStore.cc @@ -626,7 +626,7 @@ int FileStore::mount() } else if (!btrfs) { dout(0) << "mount WARNING: not btrfs, store may be in inconsistent state" << dendl; } else { - __u64 cp = snaps.back(); + uint64_t cp = snaps.back(); btrfs_ioctl_vol_args snapargs; // drop current @@ -665,7 +665,7 @@ int FileStore::mount() op_fd = ::open(current_op_seq_fn, O_CREAT|O_RDWR, 0644); assert(op_fd >= 0); - __u64 initial_op_seq = 0; + uint64_t initial_op_seq = 0; { char s[40]; int l = ::read(op_fd, s, sizeof(s)); @@ -740,9 +740,9 @@ int FileStore::umount() /// ----------------------------- -void FileStore::queue_op(Sequencer *posr, __u64 op_seq, list& tls, Context *onreadable, Context *onreadable_sync) +void FileStore::queue_op(Sequencer *posr, uint64_t op_seq, list& tls, Context *onreadable, Context *onreadable_sync) { - __u64 bytes = 0, ops = 0; + uint64_t bytes = 0, ops = 0; for (list::iterator p = tls.begin(); p != tls.end(); p++) { @@ -864,12 +864,12 @@ void FileStore::_finish_op(OpSequencer *osr) struct C_JournaledAhead : public Context { FileStore *fs; ObjectStore::Sequencer *osr; - __u64 op; + uint64_t op; list tls; Context *onreadable, *onreadable_sync; Context *ondisk; - C_JournaledAhead(FileStore *f, ObjectStore::Sequencer *os, __u64 o, list& t, + C_JournaledAhead(FileStore *f, ObjectStore::Sequencer *os, uint64_t o, list& t, Context *onr, Context *ond, Context *onrsync) : fs(f), osr(os), op(o), tls(t), onreadable(onr), onreadable_sync(onrsync), ondisk(ond) { } void finish(int r) { @@ -893,7 +893,7 @@ int FileStore::queue_transactions(Sequencer *osr, list &tls, journal->throttle(); - __u64 op = op_journal_start(0); + uint64_t op = op_journal_start(0); dout(10) << "queue_transactions (parallel) " << op << " " << tls << dendl; journal_transactions(tls, op, ondisk); @@ -905,7 +905,7 @@ int FileStore::queue_transactions(Sequencer *osr, list &tls, return 0; } else if (g_conf.filestore_journal_writeahead) { - __u64 op = op_journal_start(0); + uint64_t op = op_journal_start(0); dout(10) << "queue_transactions (writeahead) " << op << " " << tls << dendl; journal_transactions(tls, op, new C_JournaledAhead(this, osr, op, tls, onreadable, ondisk, onreadable_sync)); @@ -914,7 +914,7 @@ int FileStore::queue_transactions(Sequencer *osr, list &tls, } } - __u64 op_seq = op_apply_start(0); + uint64_t op_seq = op_apply_start(0); dout(10) << "queue_transactions (trailing journal) " << op_seq << " " << tls << dendl; int r = do_transactions(tls, op_seq); op_apply_finish(); @@ -938,7 +938,7 @@ int FileStore::queue_transactions(Sequencer *osr, list &tls, return r; } -void FileStore::_journaled_ahead(Sequencer *osr, __u64 op, +void FileStore::_journaled_ahead(Sequencer *osr, uint64_t op, list &tls, Context *onreadable, Context *ondisk, Context *onreadable_sync) @@ -955,11 +955,11 @@ void FileStore::_journaled_ahead(Sequencer *osr, __u64 op, } } -int FileStore::do_transactions(list &tls, __u64 op_seq) +int FileStore::do_transactions(list &tls, uint64_t op_seq) { int r = 0; - __u64 bytes = 0, ops = 0; + uint64_t bytes = 0, ops = 0; for (list::iterator p = tls.begin(); p != tls.end(); p++) { @@ -1014,7 +1014,7 @@ unsigned FileStore::apply_transactions(list &tls, my_lock.Unlock(); dout(10) << "apply done r = " << r << dendl; } else { - __u64 op_seq = op_apply_start(0); + uint64_t op_seq = op_apply_start(0); r = do_transactions(tls, op_seq); op_apply_finish(); @@ -1032,7 +1032,7 @@ unsigned FileStore::apply_transactions(list &tls, // btrfs transaction start/end interface -int FileStore::_transaction_start(__u64 bytes, __u64 ops) +int FileStore::_transaction_start(uint64_t bytes, uint64_t ops) { #ifdef DARWIN return 0; @@ -1104,8 +1104,8 @@ unsigned FileStore::_do_transaction(Transaction& t) { coll_t cid = t.get_cid(); sobject_t oid = t.get_oid(); - __u64 off = t.get_length(); - __u64 len = t.get_length(); + uint64_t off = t.get_length(); + uint64_t len = t.get_length(); bufferlist bl; t.get_bl(bl); _write(cid, oid, off, len, bl); @@ -1116,8 +1116,8 @@ unsigned FileStore::_do_transaction(Transaction& t) { coll_t cid = t.get_cid(); sobject_t oid = t.get_oid(); - __u64 off = t.get_length(); - __u64 len = t.get_length(); + uint64_t off = t.get_length(); + uint64_t len = t.get_length(); _zero(cid, oid, off, len); } break; @@ -1126,8 +1126,8 @@ unsigned FileStore::_do_transaction(Transaction& t) { coll_t cid = t.get_cid(); sobject_t oid = t.get_oid(); - __u64 off = t.get_length(); - __u64 len = t.get_length(); + uint64_t off = t.get_length(); + uint64_t len = t.get_length(); trim_from_cache(cid, oid, off, len); } break; @@ -1136,7 +1136,7 @@ unsigned FileStore::_do_transaction(Transaction& t) { coll_t cid = t.get_cid(); sobject_t oid = t.get_oid(); - __u64 off = t.get_length(); + uint64_t off = t.get_length(); _truncate(cid, oid, off); } break; @@ -1201,8 +1201,8 @@ unsigned FileStore::_do_transaction(Transaction& t) coll_t cid = t.get_cid(); sobject_t oid = t.get_oid(); sobject_t noid = t.get_oid(); - __u64 off = t.get_length(); - __u64 len = t.get_length(); + uint64_t off = t.get_length(); + uint64_t len = t.get_length(); _clone_range(cid, oid, noid, off, len); } break; @@ -1295,7 +1295,7 @@ int FileStore::stat(coll_t cid, const sobject_t& oid, struct stat *st) } int FileStore::read(coll_t cid, const sobject_t& oid, - __u64 offset, size_t len, + uint64_t offset, size_t len, bufferlist& bl) { char fn[PATH_MAX]; get_coname(cid, oid, fn, sizeof(fn)); @@ -1309,7 +1309,7 @@ int FileStore::read(coll_t cid, const sobject_t& oid, dout(10) << "read couldn't open " << fn << " errno " << errno << " " << strerror_r(errno, buf, sizeof(buf)) << dendl; r = -errno; } else { - __u64 actual = ::lseek64(fd, offset, SEEK_SET); + uint64_t actual = ::lseek64(fd, offset, SEEK_SET); size_t got = 0; if (len == 0) { @@ -1344,7 +1344,7 @@ int FileStore::_remove(coll_t cid, const sobject_t& oid) return r; } -int FileStore::_truncate(coll_t cid, const sobject_t& oid, __u64 size) +int FileStore::_truncate(coll_t cid, const sobject_t& oid, uint64_t size) { char fn[PATH_MAX]; get_coname(cid, oid, fn, sizeof(fn)); @@ -1376,7 +1376,7 @@ int FileStore::_touch(coll_t cid, const sobject_t& oid) } int FileStore::_write(coll_t cid, const sobject_t& oid, - __u64 offset, size_t len, + uint64_t offset, size_t len, const bufferlist& bl) { char fn[PATH_MAX]; @@ -1394,7 +1394,7 @@ int FileStore::_write(coll_t cid, const sobject_t& oid, } else { // seek - __u64 actual = ::lseek64(fd, offset, SEEK_SET); + uint64_t actual = ::lseek64(fd, offset, SEEK_SET); int did = 0; assert(actual == offset); @@ -1431,7 +1431,7 @@ int FileStore::_write(coll_t cid, const sobject_t& oid, return r; } -int FileStore::_zero(coll_t cid, const sobject_t& oid, __u64 offset, size_t len) +int FileStore::_zero(coll_t cid, const sobject_t& oid, uint64_t offset, size_t len) { // write zeros.. yuck! bufferptr bp(len); @@ -1482,7 +1482,7 @@ int FileStore::_clone(coll_t cid, const sobject_t& oldoid, const sobject_t& newo return 0; } -int FileStore::_do_clone_range(int from, int to, __u64 off, __u64 len) +int FileStore::_do_clone_range(int from, int to, uint64_t off, uint64_t len) { dout(20) << "_do_clone_range " << off << "~" << len << dendl; int r = 0; @@ -1522,7 +1522,7 @@ int FileStore::_do_clone_range(int from, int to, __u64 off, __u64 len) return r; } -int FileStore::_clone_range(coll_t cid, const sobject_t& oldoid, const sobject_t& newoid, __u64 off, __u64 len) +int FileStore::_clone_range(coll_t cid, const sobject_t& oldoid, const sobject_t& newoid, uint64_t off, uint64_t len) { char ofn[PATH_MAX], nfn[PATH_MAX]; get_coname(cid, oldoid, ofn, sizeof(ofn)); @@ -1552,7 +1552,7 @@ int FileStore::_clone_range(coll_t cid, const sobject_t& oldoid, const sobject_t } -bool FileStore::queue_flusher(int fd, __u64 off, __u64 len) +bool FileStore::queue_flusher(int fd, uint64_t off, uint64_t len) { bool queued; lock.Lock(); @@ -1585,20 +1585,20 @@ void FileStore::flusher_entry() while (true) { if (!flusher_queue.empty()) { #ifdef HAVE_SYNC_FILE_RANGE - list<__u64> q; + list q; q.swap(flusher_queue); int num = flusher_queue_len; // see how many we're taking, here lock.Unlock(); while (!q.empty()) { - __u64 ep = q.front(); + uint64_t ep = q.front(); q.pop_front(); int fd = q.front(); q.pop_front(); - __u64 off = q.front(); + uint64_t off = q.front(); q.pop_front(); - __u64 len = q.front(); + uint64_t len = q.front(); q.pop_front(); if (!stop && ep == sync_epoch) { dout(10) << "flusher_entry flushing+closing " << fd << " ep " << ep << dendl; @@ -1654,7 +1654,7 @@ void FileStore::sync_entry() if (commit_start()) { utime_t start = g_clock.now(); - __u64 cp = op_seq; + uint64_t cp = op_seq; // make flusher stop flushing previously queued stuff sync_epoch++; diff --git a/src/os/FileStore.h b/src/os/FileStore.h index 88a2980067df..a12d701aedfd 100644 --- a/src/os/FileStore.h +++ b/src/os/FileStore.h @@ -41,7 +41,7 @@ class FileStore : public JournalingObjectStore { string basedir, journalpath; char current_fn[PATH_MAX]; char current_op_seq_fn[PATH_MAX]; - __u64 fsid; + uint64_t fsid; bool btrfs; bool btrfs_trans_start_end; @@ -51,7 +51,7 @@ class FileStore : public JournalingObjectStore { int fsid_fd, op_fd; int basedir_fd, current_fd; - deque<__u64> snaps; + deque snaps; // fake attrs? FakeAttrs attrs; @@ -76,7 +76,7 @@ class FileStore : public JournalingObjectStore { // sync thread Mutex lock; Cond sync_cond; - __u64 sync_epoch; + uint64_t sync_epoch; bool stop; void sync_entry(); struct SyncThread : public Thread { @@ -92,10 +92,10 @@ class FileStore : public JournalingObjectStore { // -- op workqueue -- struct Op { - __u64 op; + uint64_t op; list tls; Context *onreadable, *onreadable_sync; - __u64 ops, bytes; + uint64_t ops, bytes; }; struct OpSequencer { Sequencer *parent; @@ -105,11 +105,11 @@ class FileStore : public JournalingObjectStore { }; Sequencer default_osr; deque op_queue; - __u64 op_queue_len, op_queue_bytes; + uint64_t op_queue_len, op_queue_bytes; Cond op_throttle_cond; Finisher op_finisher; - __u64 next_finish; - map<__u64, pair > finish_queue; + uint64_t next_finish; + map > finish_queue; ThreadPool op_tp; struct OpWQ : public ThreadPool::WorkQueue { @@ -148,14 +148,14 @@ class FileStore : public JournalingObjectStore { void _do_op(OpSequencer *o); void _finish_op(OpSequencer *o); - void queue_op(Sequencer *osr, __u64 op, list& tls, Context *onreadable, Context *onreadable_sync); - void _journaled_ahead(Sequencer *osr, __u64 op, list &tls, + void queue_op(Sequencer *osr, uint64_t op, list& tls, Context *onreadable, Context *onreadable_sync); + void _journaled_ahead(Sequencer *osr, uint64_t op, list &tls, Context *onreadable, Context *ondisk, Context *onreadable_sync); friend class C_JournaledAhead; // flusher thread Cond flusher_cond; - list<__u64> flusher_queue; + list flusher_queue; int flusher_queue_len; void flusher_entry(); struct FlusherThread : public Thread { @@ -166,7 +166,7 @@ class FileStore : public JournalingObjectStore { return 0; } } flusher_thread; - bool queue_flusher(int fd, __u64 off, __u64 len); + bool queue_flusher(int fd, uint64_t off, uint64_t len); int open_journal(); @@ -201,10 +201,10 @@ class FileStore : public JournalingObjectStore { int statfs(struct statfs *buf); - int do_transactions(list &tls, __u64 op_seq); + int do_transactions(list &tls, uint64_t op_seq); unsigned apply_transaction(Transaction& t, Context *ondisk=0); unsigned apply_transactions(list& tls, Context *ondisk=0); - int _transaction_start(__u64 bytes, __u64 ops); + int _transaction_start(uint64_t bytes, uint64_t ops); void _transaction_finish(int id); unsigned _do_transaction(Transaction& t); @@ -219,15 +219,15 @@ class FileStore : public JournalingObjectStore { } bool exists(coll_t cid, const sobject_t& oid); int stat(coll_t cid, const sobject_t& oid, struct stat *st); - int read(coll_t cid, const sobject_t& oid, __u64 offset, size_t len, bufferlist& bl); + int read(coll_t cid, const sobject_t& oid, uint64_t offset, size_t len, bufferlist& bl); int _touch(coll_t cid, const sobject_t& oid); - int _write(coll_t cid, const sobject_t& oid, __u64 offset, size_t len, const bufferlist& bl); - int _zero(coll_t cid, const sobject_t& oid, __u64 offset, size_t len); - int _truncate(coll_t cid, const sobject_t& oid, __u64 size); + int _write(coll_t cid, const sobject_t& oid, uint64_t offset, size_t len, const bufferlist& bl); + int _zero(coll_t cid, const sobject_t& oid, uint64_t offset, size_t len); + int _truncate(coll_t cid, const sobject_t& oid, uint64_t size); int _clone(coll_t cid, const sobject_t& oldoid, const sobject_t& newoid); - int _clone_range(coll_t cid, const sobject_t& oldoid, const sobject_t& newoid, __u64 off, __u64 len); - int _do_clone_range(int from, int to, __u64 off, __u64 len); + int _clone_range(coll_t cid, const sobject_t& oldoid, const sobject_t& newoid, uint64_t off, uint64_t len); + int _do_clone_range(int from, int to, uint64_t off, uint64_t len); int _remove(coll_t cid, const sobject_t& oid); void _start_sync(); @@ -272,8 +272,8 @@ class FileStore : public JournalingObjectStore { int _collection_add(coll_t c, coll_t ocid, const sobject_t& o); int _collection_remove(coll_t c, const sobject_t& o); - void trim_from_cache(coll_t cid, const sobject_t& oid, __u64 offset, size_t len) {} - int is_cached(coll_t cid, const sobject_t& oid, __u64 offset, size_t len) { return -1; } + void trim_from_cache(coll_t cid, const sobject_t& oid, uint64_t offset, size_t len) {} + int is_cached(coll_t cid, const sobject_t& oid, uint64_t offset, size_t len) { return -1; } }; #endif diff --git a/src/os/Journal.h b/src/os/Journal.h index 4b2051303c71..67ef8863102f 100644 --- a/src/os/Journal.h +++ b/src/os/Journal.h @@ -22,19 +22,19 @@ class Journal { protected: - __u64 fsid; + uint64_t fsid; Finisher *finisher; Cond *do_sync_cond; bool wait_on_full; public: - Journal(__u64 f, Finisher *fin, Cond *c=0) : fsid(f), finisher(fin), + Journal(uint64_t f, Finisher *fin, Cond *c=0) : fsid(f), finisher(fin), do_sync_cond(c), wait_on_full(false) { } virtual ~Journal() { } virtual int create() = 0; - virtual int open(__u64 last_seq) = 0; + virtual int open(uint64_t last_seq) = 0; virtual void close() = 0; virtual void flush() = 0; @@ -45,9 +45,9 @@ public: // writes virtual bool is_writeable() = 0; virtual void make_writeable() = 0; - virtual void submit_entry(__u64 seq, bufferlist& e, Context *oncommit) = 0; - virtual void committed_thru(__u64 seq) = 0; - virtual bool read_entry(bufferlist& bl, __u64 &seq) = 0; + virtual void submit_entry(uint64_t seq, bufferlist& e, Context *oncommit) = 0; + virtual void committed_thru(uint64_t seq) = 0; + virtual bool read_entry(bufferlist& bl, uint64_t &seq) = 0; // reads/recovery diff --git a/src/os/JournalingObjectStore.cc b/src/os/JournalingObjectStore.cc index 7203d7826ce2..097cfd393d87 100644 --- a/src/os/JournalingObjectStore.cc +++ b/src/os/JournalingObjectStore.cc @@ -26,7 +26,7 @@ void JournalingObjectStore::journal_stop() } } -int JournalingObjectStore::journal_replay(__u64 fs_op_seq) +int JournalingObjectStore::journal_replay(uint64_t fs_op_seq) { dout(10) << "journal_replay fs op_seq " << fs_op_seq << dendl; op_seq = fs_op_seq; @@ -47,7 +47,7 @@ int JournalingObjectStore::journal_replay(__u64 fs_op_seq) int count = 0; while (1) { bufferlist bl; - __u64 seq = op_seq + 1; + uint64_t seq = op_seq + 1; if (!journal->read_entry(bl, seq)) { dout(3) << "journal_replay: end of journal, done." << dendl; break; @@ -88,7 +88,7 @@ int JournalingObjectStore::journal_replay(__u64 fs_op_seq) // ------------------------------------ -__u64 JournalingObjectStore::op_apply_start(__u64 op) +uint64_t JournalingObjectStore::op_apply_start(uint64_t op) { lock.Lock(); while (blocked) { @@ -114,7 +114,7 @@ void JournalingObjectStore::op_apply_finish() lock.Unlock(); } -__u64 JournalingObjectStore::op_journal_start(__u64 op) +uint64_t JournalingObjectStore::op_journal_start(uint64_t op) { journal_lock.Lock(); if (!op) { @@ -183,7 +183,7 @@ void JournalingObjectStore::commit_finish() } } -void JournalingObjectStore::journal_transaction(ObjectStore::Transaction& t, __u64 op, +void JournalingObjectStore::journal_transaction(ObjectStore::Transaction& t, uint64_t op, Context *onjournal) { Mutex::Locker l(lock); @@ -196,7 +196,7 @@ void JournalingObjectStore::journal_transaction(ObjectStore::Transaction& t, __u commit_waiters[op].push_back(onjournal); } -void JournalingObjectStore::journal_transactions(list& tls, __u64 op, +void JournalingObjectStore::journal_transactions(list& tls, uint64_t op, Context *onjournal) { Mutex::Locker l(lock); diff --git a/src/os/JournalingObjectStore.h b/src/os/JournalingObjectStore.h index 047610939852..79a82c3716bc 100644 --- a/src/os/JournalingObjectStore.h +++ b/src/os/JournalingObjectStore.h @@ -21,8 +21,8 @@ class JournalingObjectStore : public ObjectStore { protected: - __u64 op_seq, applied_seq; - __u64 committing_seq, committed_seq; + uint64_t op_seq, applied_seq; + uint64_t committing_seq, committed_seq; map > commit_waiters; int open_ops; @@ -38,16 +38,16 @@ protected: protected: void journal_start(); void journal_stop(); - int journal_replay(__u64 fs_op_seq); + int journal_replay(uint64_t fs_op_seq); // -- - __u64 op_apply_start(__u64 op); + uint64_t op_apply_start(uint64_t op); void op_apply_finish(); - __u64 op_journal_start(__u64 op); + uint64_t op_journal_start(uint64_t op); void op_journal_finish(); - void journal_transaction(ObjectStore::Transaction& t, __u64 op, Context *onjournal); - void journal_transactions(list& tls, __u64 op, Context *onjournal); + void journal_transaction(ObjectStore::Transaction& t, uint64_t op, Context *onjournal); + void journal_transactions(list& tls, uint64_t op, Context *onjournal); bool commit_start(); void commit_started(); // allow new ops (underlying fs should now be committing all prior ops) diff --git a/src/os/ObjectStore.h b/src/os/ObjectStore.h index 2830380bff97..2f1131915d1f 100644 --- a/src/os/ObjectStore.h +++ b/src/os/ObjectStore.h @@ -40,7 +40,7 @@ using std::vector; # define MIN(a,b) ((a) < (b) ? (a):(b)) #endif -typedef __u64 collection_list_handle_t; +typedef uint64_t collection_list_handle_t; /* * low-level interface to the local OSD file system @@ -114,7 +114,7 @@ public: static const int OP_RMATTRS = 28; // cid, oid private: - __u64 ops, bytes; + uint64_t ops, bytes; bufferlist tbl; bufferlist::iterator p; @@ -135,9 +135,9 @@ public: unsigned opp, blp, oidp, cidp, lengthp, attrnamep, attrsetp; public: - __u64 get_num_bytes() { + uint64_t get_num_bytes() { if (old) { - __u64 s = 16384 + + uint64_t s = 16384 + (opvec.size() + oids.size() + cids.size() + lengths.size()) * 4096; for (vector::iterator p = bls.begin(); p != bls.end(); p++) s += bls.size() + 4096; @@ -200,12 +200,12 @@ public: ::decode(c, p); return c; } - __u64 get_length() { + uint64_t get_length() { if (old) return lengths[lengthp++]; if (p.get_off() == 0) p = tbl.begin(); - __u64 len; + uint64_t len; ::decode(len, p); return len; } @@ -242,7 +242,7 @@ public: ::encode(oid, tbl); ops++; } - void write(coll_t cid, const sobject_t& oid, __u64 off, __u64 len, const bufferlist& data) { + void write(coll_t cid, const sobject_t& oid, uint64_t off, uint64_t len, const bufferlist& data) { __u32 op = OP_WRITE; ::encode(op, tbl); ::encode(cid, tbl); @@ -252,7 +252,7 @@ public: ::encode(data, tbl); ops++; } - void zero(coll_t cid, const sobject_t& oid, __u64 off, __u64 len) { + void zero(coll_t cid, const sobject_t& oid, uint64_t off, uint64_t len) { __u32 op = OP_ZERO; ::encode(op, tbl); ::encode(cid, tbl); @@ -261,7 +261,7 @@ public: ::encode(len, tbl); ops++; } - void trim_from_cache(coll_t cid, const sobject_t& oid, __u64 off, __u64 len) { + void trim_from_cache(coll_t cid, const sobject_t& oid, uint64_t off, uint64_t len) { __u32 op = OP_TRIMCACHE; ::encode(op, tbl); ::encode(cid, tbl); @@ -270,7 +270,7 @@ public: ::encode(len, tbl); ops++; } - void truncate(coll_t cid, const sobject_t& oid, __u64 off) { + void truncate(coll_t cid, const sobject_t& oid, uint64_t off) { __u32 op = OP_TRUNCATE; ::encode(op, tbl); ::encode(cid, tbl); @@ -339,7 +339,7 @@ public: ::encode(noid, tbl); ops++; } - void clone_range(coll_t cid, const sobject_t& oid, sobject_t noid, __u64 off, __u64 len) { + void clone_range(coll_t cid, const sobject_t& oid, sobject_t noid, uint64_t off, uint64_t len) { __u32 op = OP_CLONERANGE; ::encode(op, tbl); ::encode(cid, tbl); @@ -503,13 +503,13 @@ public: // objects virtual bool exists(coll_t cid, const sobject_t& oid) = 0; // useful? virtual int stat(coll_t cid, const sobject_t& oid, struct stat *st) = 0; // struct stat? - virtual int read(coll_t cid, const sobject_t& oid, __u64 offset, size_t len, bufferlist& bl) = 0; + virtual int read(coll_t cid, const sobject_t& oid, uint64_t offset, size_t len, bufferlist& bl) = 0; /* virtual int _remove(coll_t cid, sobject_t oid) = 0; - virtual int _truncate(coll_t cid, sobject_t oid, __u64 size) = 0; - virtual int _write(coll_t cid, sobject_t oid, __u64 offset, size_t len, const bufferlist& bl) = 0; - virtual int _zero(coll_t cid, sobject_t oid, __u64 offset, size_t len) { + virtual int _truncate(coll_t cid, sobject_t oid, uint64_t size) = 0; + virtual int _write(coll_t cid, sobject_t oid, uint64_t offset, size_t len, const bufferlist& bl) = 0; + virtual int _zero(coll_t cid, sobject_t oid, uint64_t offset, size_t len) { // write zeros.. yuck! bufferptr bp(len); bufferlist bl; @@ -518,8 +518,8 @@ public: } */ - virtual void trim_from_cache(coll_t cid, const sobject_t& oid, __u64 offset, size_t len) = 0; //{ } - virtual int is_cached(coll_t cid, const sobject_t& oid, __u64 offset, size_t len) = 0; //{ return -1; } + virtual void trim_from_cache(coll_t cid, const sobject_t& oid, uint64_t offset, size_t len) = 0; //{ } + virtual int is_cached(coll_t cid, const sobject_t& oid, uint64_t offset, size_t len) = 0; //{ return -1; } virtual int getattr(coll_t cid, const sobject_t& oid, const char *name, void *value, size_t size) = 0; virtual int getattr(coll_t cid, const sobject_t& oid, const char *name, bufferptr& value) = 0; diff --git a/src/os/btrfs_ioctl.h b/src/os/btrfs_ioctl.h index bc49914475eb..a514adfa45f2 100644 --- a/src/os/btrfs_ioctl.h +++ b/src/os/btrfs_ioctl.h @@ -26,14 +26,14 @@ /* this should be 4k */ struct btrfs_ioctl_vol_args { - __s64 fd; + int64_t fd; char name[BTRFS_PATH_NAME_MAX + 1]; }; struct btrfs_ioctl_clone_range_args { - __s64 src_fd; - __u64 src_offset, src_length; - __u64 dest_offset; + int64_t src_fd; + uint64_t src_offset, src_length; + uint64_t dest_offset; }; #define BTRFS_IOC_SNAP_CREATE _IOW(BTRFS_IOCTL_MAGIC, 1, \ diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index fc2998964492..e0cb14a669ba 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -1702,7 +1702,7 @@ bool OSD::ms_verify_authorizer(Connection *con, int peer_type, AuthCapsInfo caps_info; EntityName name; uint64_t global_id; - __u64 auid; + uint64_t auid; isvalid = authorize_handler->verify_authorizer(monc->rotating_secrets, authorizer_data, authorizer_reply, name, global_id, caps_info, &auid); diff --git a/src/osd/OSDCaps.cc b/src/osd/OSDCaps.cc index b88dbe408823..61b5ef78588b 100644 --- a/src/osd/OSDCaps.cc +++ b/src/osd/OSDCaps.cc @@ -191,7 +191,7 @@ do { \ * on the pool, check if you're the pool owner and grant full. * Otherwise, you get nothing. */ -int OSDCaps::get_pool_cap(int pool_id, __u64 uid) +int OSDCaps::get_pool_cap(int pool_id, uint64_t uid) { if (allow_all) return OSD_POOL_CAP_ALL; diff --git a/src/osd/OSDCaps.h b/src/osd/OSDCaps.h index f01015e3f420..d84a4f34406b 100644 --- a/src/osd/OSDCaps.h +++ b/src/osd/OSDCaps.h @@ -62,7 +62,7 @@ struct OSDCaps { rwx_t default_action; bool allow_all; int peer_type; - __u64 auid; + uint64_t auid; bool get_next_token(string s, size_t& pos, string& token); bool is_rwx(string& token, rwx_t& cap_val); @@ -70,13 +70,13 @@ struct OSDCaps { OSDCaps() : default_action(0), allow_all(false), auid(CEPH_AUTH_UID_DEFAULT) {} bool parse(bufferlist::iterator& iter); - int get_pool_cap(int pool_id, __u64 uid = CEPH_AUTH_UID_DEFAULT); + int get_pool_cap(int pool_id, uint64_t uid = CEPH_AUTH_UID_DEFAULT); bool is_mon() { return CEPH_ENTITY_TYPE_MON == peer_type; } bool is_osd() { return CEPH_ENTITY_TYPE_OSD == peer_type; } bool is_mds() { return CEPH_ENTITY_TYPE_MDS == peer_type; } void set_allow_all(bool allow) { allow_all = allow; } void set_peer_type (int pt) { peer_type = pt; } - void set_auid(__u64 uid) { auid = uid; } + void set_auid(uint64_t uid) { auid = uid; } }; static inline ostream& operator<<(ostream& out, const OSDCaps& c) { diff --git a/src/osd/PG.cc b/src/osd/PG.cc index bd9689d63da4..d920492460f7 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -1998,9 +1998,9 @@ void PG::write_log(ObjectStore::Transaction& t) for (list::iterator p = log.log.begin(); p != log.log.end(); p++) { - __u64 startoff = bl.length(); + uint64_t startoff = bl.length(); ::encode(*p, bl); - __u64 endoff = bl.length(); + uint64_t endoff = bl.length(); if (startoff / 4096 != endoff / 4096) { // we reached a new block. *p was the last entry with bytes in previous block ondisklog.block_map[startoff] = p->version; @@ -2043,7 +2043,7 @@ void PG::trim_ondisklog_to(ObjectStore::Transaction& t, eversion_t v) { dout(15) << "trim_ondisk_log_to v " << v << dendl; - map<__u64,eversion_t>::iterator p = ondisklog.block_map.begin(); + map::iterator p = ondisklog.block_map.begin(); while (p != ondisklog.block_map.end()) { //dout(15) << " " << p->first << " -> " << p->second << dendl; p++; @@ -2058,7 +2058,7 @@ void PG::trim_ondisklog_to(ObjectStore::Transaction& t, eversion_t v) return; // can't trim anything! // we can trim! - __u64 trim = p->first; + uint64_t trim = p->first; dout(10) << " " << ondisklog.tail << "~" << ondisklog.length() << " -> " << trim << "~" << (ondisklog.head-trim) << dendl; @@ -2160,7 +2160,7 @@ void PG::read_log(ObjectStore *store) eversion_t last; bool reorder = false; while (!p.end()) { - __u64 pos = ondisklog.tail + p.get_off(); + uint64_t pos = ondisklog.tail + p.get_off(); ::decode(e, p); dout(20) << "read_log " << pos << " " << e << dendl; @@ -2185,7 +2185,7 @@ void PG::read_log(ObjectStore *store) osd->get_logclient()->log(LOG_ERROR, ss); } - __u64 endpos = ondisklog.tail + p.get_off(); + uint64_t endpos = ondisklog.tail + p.get_off(); if (endpos / 4096 != pos / 4096) ondisklog.block_map[pos] = e.version; // last event in prior block log.log.push_back(e); diff --git a/src/osd/PG.h b/src/osd/PG.h index 77d0d8c73418..ae2e842a0753 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -458,13 +458,13 @@ public: class OndiskLog { public: // ok - __u64 tail; // first byte of log. - __u64 head; // byte following end of log. - map<__u64,eversion_t> block_map; // offset->version of _last_ entry with _any_ bytes in each block + uint64_t tail; // first byte of log. + uint64_t head; // byte following end of log. + map block_map; // offset->version of _last_ entry with _any_ bytes in each block OndiskLog() : tail(0), head(0) {} - __u64 length() { return head - tail; } + uint64_t length() { return head - tail; } bool trim_to(eversion_t v, ObjectStore::Transaction& t); void encode(bufferlist& bl) const { diff --git a/src/osd/PGLS.h b/src/osd/PGLS.h index a36c50f43a73..c5b9ca99ad2d 100644 --- a/src/osd/PGLS.h +++ b/src/osd/PGLS.h @@ -10,11 +10,11 @@ struct PGLSResponse { list entries; void encode(bufferlist& bl) const { - ::encode((__u64)handle, bl); + ::encode((uint64_t)handle, bl); ::encode(entries, bl); } void decode(bufferlist::iterator& bl) { - __u64 tmp; + uint64_t tmp; ::decode(tmp, bl); handle = (collection_list_handle_t)tmp; ::decode(entries, bl); diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index f196701fe9d6..187d7477f154 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -388,7 +388,7 @@ void ReplicatedPG::do_pg_op(MOSDOp *op) dout(10) << " pgls pg=" << op->get_pg() << dendl; // read into a buffer PGLSResponse response; - response.handle = (collection_list_handle_t)(__u64)(p->op.pgls.cookie); + response.handle = (collection_list_handle_t)(uint64_t)(p->op.pgls.cookie); vector sentries; result = osd->store->collection_list_partial(coll_t::build_pg_coll(info.pgid), snapid, sentries, p->op.pgls.count, @@ -571,7 +571,7 @@ void ReplicatedPG::do_op(MOSDOp *op) // note some basic context for op replication that prepare_transaction may clobber eversion_t old_last_update = ctx->at_version; bool old_exists = obc->obs.exists; - __u64 old_size = obc->obs.oi.size; + uint64_t old_size = obc->obs.oi.size; eversion_t old_version = obc->obs.oi.version; // we are acker. @@ -783,7 +783,7 @@ bool ReplicatedPG::snap_trimmer() if (p != snapset.clones.begin()) { // not the oldest... merge overlap into next older clone vector::iterator n = p - 1; - interval_set<__u64> keep; + interval_set keep; keep.union_of(snapset.clone_overlap[*n], snapset.clone_overlap[*p]); add_interval_usage(keep, info.stats); // not deallocated snapset.clone_overlap[*n].intersection_of(snapset.clone_overlap[*p]); @@ -993,7 +993,7 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector& ops, memset(&st, 0, sizeof(st)); result = osd->store->stat(coll_t::build_pg_coll(info.pgid), soid, &st); if (result >= 0) { - __u64 size = st.st_size; + uint64_t size = st.st_size; ::encode(size, odata); ::encode(oi.mtime, odata); } @@ -1066,7 +1066,7 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector& ops, } if (ssc->snapset.clones.size()) { snapid_t newest = *ssc->snapset.clones.rbegin(); - interval_set<__u64> ch; + interval_set ch; if (op.extent.length) ch.insert(op.extent.offset, op.extent.length); ch.intersection_of(ssc->snapset.clone_overlap[newest]); @@ -1074,7 +1074,7 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector& ops, add_interval_usage(ch, info.stats); } if (op.extent.length && (op.extent.offset + op.extent.length > oi.size)) { - __u64 new_size = op.extent.offset + op.extent.length; + uint64_t new_size = op.extent.offset + op.extent.length; info.stats.num_bytes += new_size - oi.size; info.stats.num_kb += SHIFT_ROUND_UP(new_size, 10) - SHIFT_ROUND_UP(oi.size, 10); oi.size = new_size; @@ -1118,7 +1118,7 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector& ops, t.zero(coll_t::build_pg_coll(info.pgid), soid, op.extent.offset, op.extent.length); if (ssc->snapset.clones.size()) { snapid_t newest = *ssc->snapset.clones.rbegin(); - interval_set<__u64> ch; + interval_set ch; ch.insert(op.extent.offset, op.extent.length); ch.intersection_of(ssc->snapset.clone_overlap[newest]); ssc->snapset.clone_overlap[newest].subtract(ch); @@ -1167,13 +1167,13 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector& ops, t.truncate(coll_t::build_pg_coll(info.pgid), soid, op.extent.offset); if (ssc->snapset.clones.size()) { snapid_t newest = *ssc->snapset.clones.rbegin(); - interval_set<__u64> trim; + interval_set trim; if (oi.size > op.extent.offset) { trim.insert(op.extent.offset, oi.size-op.extent.offset); trim.intersection_of(ssc->snapset.clone_overlap[newest]); add_interval_usage(trim, info.stats); } - interval_set<__u64> keep; + interval_set keep; if (op.extent.offset) keep.insert(0, op.extent.offset); ssc->snapset.clone_overlap[newest].intersection_of(keep); @@ -1617,9 +1617,9 @@ void ReplicatedPG::make_writeable(OpContext *ctx) } -void ReplicatedPG::add_interval_usage(interval_set<__u64>& s, pg_stat_t& stats) +void ReplicatedPG::add_interval_usage(interval_set& s, pg_stat_t& stats) { - for (map<__u64,__u64>::iterator p = s.m.begin(); p != s.m.end(); p++) { + for (map::iterator p = s.m.begin(); p != s.m.end(); p++) { stats.num_bytes += p->second; stats.num_kb += SHIFT_ROUND_UP(p->first+p->second, 10) - (p->first >> 10); } @@ -1943,7 +1943,7 @@ void ReplicatedPG::eval_repop(RepGather *repop) void ReplicatedPG::issue_repop(RepGather *repop, int dest, utime_t now, - bool old_exists, __u64 old_size, eversion_t old_version) + bool old_exists, uint64_t old_size, eversion_t old_version) { const sobject_t& soid = repop->ctx->obs->oi.soid; dout(7) << " issue_repop rep_tid " << repop->rep_tid @@ -2532,8 +2532,8 @@ void ReplicatedPG::sub_op_modify_reply(MOSDSubOpReply *r) void ReplicatedPG::calc_head_subsets(SnapSet& snapset, const sobject_t& head, Missing& missing, - interval_set<__u64>& data_subset, - map >& clone_subsets) + interval_set& data_subset, + map >& clone_subsets) { dout(10) << "calc_head_subsets " << head << " clone_overlap " << snapset.clone_overlap << dendl; @@ -2541,8 +2541,8 @@ void ReplicatedPG::calc_head_subsets(SnapSet& snapset, const sobject_t& head, struct stat st; osd->store->stat(coll_t::build_pg_coll(info.pgid), head, &st); - interval_set<__u64> cloning; - interval_set<__u64> prev; + interval_set cloning; + interval_set prev; if (st.st_size) prev.insert(0, st.st_size); @@ -2573,13 +2573,13 @@ void ReplicatedPG::calc_head_subsets(SnapSet& snapset, const sobject_t& head, void ReplicatedPG::calc_clone_subsets(SnapSet& snapset, const sobject_t& soid, Missing& missing, - interval_set<__u64>& data_subset, - map >& clone_subsets) + interval_set& data_subset, + map >& clone_subsets) { dout(10) << "calc_clone_subsets " << soid << " clone_overlap " << snapset.clone_overlap << dendl; - __u64 size = snapset.clone_size[soid.snap]; + uint64_t size = snapset.clone_size[soid.snap]; unsigned i; for (i=0; i < snapset.clones.size(); i++) @@ -2587,8 +2587,8 @@ void ReplicatedPG::calc_clone_subsets(SnapSet& snapset, const sobject_t& soid, break; // any overlap with next older clone? - interval_set<__u64> cloning; - interval_set<__u64> prev; + interval_set cloning; + interval_set prev; if (size) prev.insert(0, size); for (int j=i-1; j>=0; j--) { @@ -2607,7 +2607,7 @@ void ReplicatedPG::calc_clone_subsets(SnapSet& snapset, const sobject_t& soid, } // overlap with next newest? - interval_set<__u64> next; + interval_set next; if (size) next.insert(0, size); for (unsigned j=i+1; j > clone_subsets; - interval_set<__u64> data_subset; + map > clone_subsets; + interval_set data_subset; // is this a snapped object? if so, consult the snapset.. we may not need the entire object! if (soid.snap && soid.snap < CEPH_NOSNAP) { @@ -2738,8 +2738,8 @@ void ReplicatedPG::push_to_replica(const sobject_t& soid, int peer) int r = osd->store->stat(coll_t::build_pg_coll(info.pgid), soid, &st); assert(r == 0); - map > clone_subsets; - interval_set<__u64> data_subset; + map > clone_subsets; + interval_set data_subset; bufferlist bv; r = osd->store->getattr(coll_t::build_pg_coll(info.pgid), soid, OI_ATTR, bv); @@ -2755,8 +2755,8 @@ void ReplicatedPG::push_to_replica(const sobject_t& soid, int peer) dout(10) << "push_to_replica osd" << peer << " has correct old " << head << " v" << oi.prior_version << ", pushing " << soid << " attrs as a clone op" << dendl; - interval_set<__u64> data_subset; - map > clone_subsets; + interval_set data_subset; + map > clone_subsets; if (st.st_size) clone_subsets[head].insert(0, st.st_size); push(soid, peer, data_subset, clone_subsets); @@ -2800,19 +2800,19 @@ void ReplicatedPG::push_to_replica(const sobject_t& soid, int peer) */ void ReplicatedPG::push(const sobject_t& soid, int peer) { - interval_set<__u64> subset; - map > clone_subsets; + interval_set subset; + map > clone_subsets; push(soid, peer, subset, clone_subsets); } void ReplicatedPG::push(const sobject_t& soid, int peer, - interval_set<__u64> &data_subset, - map >& clone_subsets) + interval_set &data_subset, + map >& clone_subsets) { // read data+attrs bufferlist bl; map attrset; - __u64 size; + uint64_t size; if (data_subset.size() || clone_subsets.size()) { struct stat st; @@ -2820,7 +2820,7 @@ void ReplicatedPG::push(const sobject_t& soid, int peer, assert(r == 0); size = st.st_size; - for (map<__u64,__u64>::iterator p = data_subset.m.begin(); + for (map::iterator p = data_subset.m.begin(); p != data_subset.m.end(); p++) { bufferlist bit; @@ -2991,8 +2991,8 @@ void ReplicatedPG::sub_op_push(MOSDSubOp *op) << " data len " << op->get_data().length() << dendl; - interval_set<__u64> data_subset; - map > clone_subsets; + interval_set data_subset; + map > clone_subsets; bufferlist data; data.claim(op->get_data()); @@ -3016,7 +3016,7 @@ void ReplicatedPG::sub_op_push(MOSDSubOp *op) clone_subsets.clear(); // forget what pusher said; recalculate cloning. - interval_set<__u64> data_needed; + interval_set data_needed; calc_clone_subsets(ssc->snapset, soid, missing, data_needed, clone_subsets); put_snapset_context(ssc); @@ -3029,22 +3029,22 @@ void ReplicatedPG::sub_op_push(MOSDSubOp *op) // did we get more data than we need? if (!data_subset.subset_of(data_needed)) { - interval_set<__u64> extra = data_subset; + interval_set extra = data_subset; extra.subtract(data_needed); dout(10) << " we got some extra: " << extra << dendl; bufferlist result; int off = 0; - for (map<__u64,__u64>::iterator p = data_subset.m.begin(); + for (map::iterator p = data_subset.m.begin(); p != data_subset.m.end(); p++) { - interval_set<__u64> x; + interval_set x; x.insert(p->first, p->second); x.intersection_of(data_needed); dout(20) << " data_subset object extent " << p->first << "~" << p->second << " need " << x << dendl; if (!x.empty()) { - __u64 first = x.m.begin()->first; - __u64 len = x.m.begin()->second; + uint64_t first = x.m.begin()->first; + uint64_t len = x.m.begin()->second; bufferlist sub; int boff = off + (first - p->first); dout(20) << " keeping buffer extent " << boff << "~" << len << dendl; @@ -3069,17 +3069,17 @@ void ReplicatedPG::sub_op_push(MOSDSubOp *op) ObjectStore::Transaction *t = new ObjectStore::Transaction; t->remove(coll_t::build_pg_coll(info.pgid), soid); // in case old version exists - __u64 boff = 0; - for (map >::iterator p = clone_subsets.begin(); + uint64_t boff = 0; + for (map >::iterator p = clone_subsets.begin(); p != clone_subsets.end(); p++) - for (map<__u64,__u64>::iterator q = p->second.m.begin(); + for (map::iterator q = p->second.m.begin(); q != p->second.m.end(); q++) { dout(15) << " clone_range " << p->first << " " << q->first << "~" << q->second << dendl; t->clone_range(coll_t::build_pg_coll(info.pgid), p->first, soid, q->first, q->second); } - for (map<__u64,__u64>::iterator p = data_subset.m.begin(); + for (map::iterator p = data_subset.m.begin(); p != data_subset.m.end(); p++) { bufferlist bit; @@ -3635,10 +3635,10 @@ int ReplicatedPG::_scrub(ScrubMap& scrubmap, int& errors, int& fixed) curclone = snapset.clones.size()-1; // subtract off any clone overlap - for (map >::iterator q = snapset.clone_overlap.begin(); + for (map >::iterator q = snapset.clone_overlap.begin(); q != snapset.clone_overlap.end(); q++) { - for (map<__u64,__u64>::iterator r = q->second.m.begin(); + for (map::iterator r = q->second.m.begin(); r != q->second.m.end(); r++) { stat.num_bytes -= r->second; diff --git a/src/osd/ReplicatedPG.h b/src/osd/ReplicatedPG.h index f5ff2e3a4827..1c2e3419a758 100644 --- a/src/osd/ReplicatedPG.h +++ b/src/osd/ReplicatedPG.h @@ -405,7 +405,7 @@ protected: void op_commit(RepGather *repop); void eval_repop(RepGather*); void issue_repop(RepGather *repop, int dest, utime_t now, - bool old_exists, __u64 old_size, eversion_t old_version); + bool old_exists, uint64_t old_size, eversion_t old_version); RepGather *new_repop(OpContext *ctx, ObjectContext *obc, bool noop, tid_t rep_tid); void repop_ack(RepGather *repop, int result, int ack_type, @@ -463,15 +463,15 @@ protected: void calc_head_subsets(SnapSet& snapset, const sobject_t& head, Missing& missing, - interval_set<__u64>& data_subset, - map >& clone_subsets); + interval_set& data_subset, + map >& clone_subsets); void calc_clone_subsets(SnapSet& snapset, const sobject_t& poid, Missing& missing, - interval_set<__u64>& data_subset, - map >& clone_subsets); + interval_set& data_subset, + map >& clone_subsets); void push_to_replica(const sobject_t& oid, int dest); void push(const sobject_t& oid, int dest); - void push(const sobject_t& oid, int dest, interval_set<__u64>& data_subset, - map >& clone_subsets); + void push(const sobject_t& oid, int dest, interval_set& data_subset, + map >& clone_subsets); bool pull(const sobject_t& oid); @@ -482,7 +482,7 @@ protected: object_info_t *poi); void make_writeable(OpContext *ctx); void log_op_stats(const sobject_t &soid, OpContext *ctx); - void add_interval_usage(interval_set<__u64>& s, pg_stat_t& st); + void add_interval_usage(interval_set& s, pg_stat_t& st); int prepare_transaction(OpContext *ctx); void log_op(vector& log, eversion_t trim_to, ObjectStore::Transaction& t); diff --git a/src/osd/osd_types.h b/src/osd/osd_types.h index 36136fc7ae52..f7e009a4008c 100644 --- a/src/osd/osd_types.h +++ b/src/osd/osd_types.h @@ -750,18 +750,18 @@ struct pg_stat_t { eversion_t last_scrub; utime_t last_scrub_stamp; - __u64 num_bytes; // in bytes - __u64 num_kb; // in KB - __u64 num_objects; - __u64 num_object_clones; - __u64 num_object_copies; // num_objects * num_replicas - __u64 num_objects_missing_on_primary; - __u64 num_objects_degraded; - __u64 log_size; - __u64 ondisk_log_size; // >= active_log_size - - __u64 num_rd, num_rd_kb; - __u64 num_wr, num_wr_kb; + uint64_t num_bytes; // in bytes + uint64_t num_kb; // in KB + uint64_t num_objects; + uint64_t num_object_clones; + uint64_t num_object_copies; // num_objects * num_replicas + uint64_t num_objects_missing_on_primary; + uint64_t num_objects_degraded; + uint64_t log_size; + uint64_t ondisk_log_size; // >= active_log_size + + uint64_t num_rd, num_rd_kb; + uint64_t num_wr, num_wr_kb; vector up, acting; @@ -875,17 +875,17 @@ WRITE_CLASS_ENCODER(pg_stat_t) * summation over an entire pool */ struct pool_stat_t { - __u64 num_bytes; // in bytes - __u64 num_kb; // in KB - __u64 num_objects; - __u64 num_object_clones; - __u64 num_object_copies; // num_objects * num_replicas - __u64 num_objects_missing_on_primary; - __u64 num_objects_degraded; - __u64 log_size; - __u64 ondisk_log_size; // >= active_log_size - __u64 num_rd, num_rd_kb; - __u64 num_wr, num_wr_kb; + uint64_t num_bytes; // in bytes + uint64_t num_kb; // in KB + uint64_t num_objects; + uint64_t num_object_clones; + uint64_t num_object_copies; // num_objects * num_replicas + uint64_t num_objects_missing_on_primary; + uint64_t num_objects_degraded; + uint64_t log_size; + uint64_t ondisk_log_size; // >= active_log_size + uint64_t num_rd, num_rd_kb; + uint64_t num_wr, num_wr_kb; pool_stat_t() : num_bytes(0), num_kb(0), num_objects(0), num_object_clones(0), num_object_copies(0), @@ -1098,7 +1098,7 @@ inline ostream& operator<<(ostream& out, OSDSuperblock& sb) // ------- -WRITE_CLASS_ENCODER(interval_set<__u64>) +WRITE_CLASS_ENCODER(interval_set) @@ -1113,8 +1113,8 @@ struct SnapSet { bool head_exists; vector snaps; // ascending vector clones; // ascending - map > clone_overlap; // overlap w/ next newest - map clone_size; + map > clone_overlap; // overlap w/ next newest + map clone_size; SnapSet() : head_exists(false) {} SnapSet(bufferlist& bl) { @@ -1162,13 +1162,13 @@ struct object_info_t { eversion_t version, prior_version; osd_reqid_t last_reqid; - __u64 size; + uint64_t size; utime_t mtime; osd_reqid_t wrlock_by; // [head] vector snaps; // [clone] - __u64 truncate_seq, truncate_size; + uint64_t truncate_seq, truncate_size; void encode(bufferlist& bl) const { const __u8 v = 1; @@ -1235,7 +1235,7 @@ inline ostream& operator<<(ostream& out, const object_info_t& oi) { struct ScrubMap { struct object { sobject_t poid; - __u64 size; + uint64_t size; map attrs; void encode(bufferlist& bl) const { @@ -1299,12 +1299,12 @@ inline ostream& operator<<(ostream& out, const OSDOp& op) { break; case CEPH_OSD_OP_MASKTRUNC: case CEPH_OSD_OP_TRIMTRUNC: - out << " " << op.op.extent.truncate_seq << "@" << (__s64)op.op.extent.truncate_size; + out << " " << op.op.extent.truncate_seq << "@" << (int64_t)op.op.extent.truncate_size; break; default: out << " " << op.op.extent.offset << "~" << op.op.extent.length; if (op.op.extent.truncate_seq) - out << " [" << op.op.extent.truncate_seq << "@" << (__s64)op.op.extent.truncate_size << "]"; + out << " [" << op.op.extent.truncate_seq << "@" << (int64_t)op.op.extent.truncate_size << "]"; } } else if (ceph_osd_op_type_attr(op.op.op)) { // xattr name diff --git a/src/osdc/Filer.cc b/src/osdc/Filer.cc index adc54211c5c3..fe8901767ad5 100644 --- a/src/osdc/Filer.cc +++ b/src/osdc/Filer.cc @@ -36,7 +36,7 @@ public: Filer *filer; Probe *probe; object_t oid; - __u64 size; + uint64_t size; utime_t mtime; C_Probe(Filer *f, Probe *p, object_t o) : filer(f), probe(p), oid(o), size(0) {} void finish(int r) { @@ -47,8 +47,8 @@ public: int Filer::probe(inodeno_t ino, ceph_file_layout *layout, snapid_t snapid, - __u64 start_from, - __u64 *end, // LB, when !fwd + uint64_t start_from, + uint64_t *end, // LB, when !fwd utime_t *pmtime, bool fwd, int flags, @@ -64,7 +64,7 @@ int Filer::probe(inodeno_t ino, Probe *probe = new Probe(ino, *layout, snapid, start_from, end, pmtime, flags, fwd, onfinish); // period (bytes before we jump unto a new set of object(s)) - __u64 period = layout->fl_stripe_count * layout->fl_object_size; + uint64_t period = layout->fl_stripe_count * layout->fl_object_size; // start with 1+ periods. probe->probing_len = period; @@ -104,7 +104,7 @@ void Filer::_probe(Probe *probe) } } -void Filer::_probed(Probe *probe, const object_t& oid, __u64 size, utime_t mtime) +void Filer::_probed(Probe *probe, const object_t& oid, uint64_t size, utime_t mtime) { dout(10) << "_probed " << probe->ino << " object " << oid << " has size " << size << " mtime " << mtime << dendl; @@ -120,7 +120,7 @@ void Filer::_probed(Probe *probe, const object_t& oid, __u64 size, utime_t mtime return; // waiting for more! // analyze! - __u64 end = 0; + uint64_t end = 0; if (!probe->fwd) { // reverse @@ -135,7 +135,7 @@ void Filer::_probed(Probe *probe, const object_t& oid, __u64 size, utime_t mtime for (vector::iterator p = probe->probing.begin(); p != probe->probing.end(); p++) { - __u64 shouldbe = p->length + p->offset; + uint64_t shouldbe = p->length + p->offset; dout(10) << "_probed " << probe->ino << " object " << hex << p->oid << dec << " should be " << shouldbe << ", actual is " << probe->known_size[p->oid] @@ -156,11 +156,11 @@ void Filer::_probed(Probe *probe, const object_t& oid, __u64 size, utime_t mtime // aha, we found the end! // calc offset into buffer_extent to get distance from probe->from. - __u64 oleft = probe->known_size[p->oid] - p->offset; + uint64_t oleft = probe->known_size[p->oid] - p->offset; for (map<__u32,__u32>::iterator i = p->buffer_extents.begin(); i != p->buffer_extents.end(); i++) { - if (oleft <= (__u64)i->second) { + if (oleft <= (uint64_t)i->second) { end = probe->probing_off + i->first + oleft; dout(10) << "_probed end is in buffer_extent " << i->first << "~" << i->second << " off " << oleft << ", from was " << probe->probing_off << ", end is " << end @@ -183,7 +183,7 @@ void Filer::_probed(Probe *probe, const object_t& oid, __u64 size, utime_t mtime // keep probing! dout(10) << "_probed probing further" << dendl; - __u64 period = probe->layout.fl_stripe_count * probe->layout.fl_object_size; + uint64_t period = probe->layout.fl_stripe_count * probe->layout.fl_object_size; if (probe->fwd) { probe->probing_off += probe->probing_len; assert(probe->probing_off % period == 0); @@ -216,7 +216,7 @@ struct PurgeRange { inodeno_t ino; ceph_file_layout layout; SnapContext snapc; - __u64 first, num; + uint64_t first, num; utime_t mtime; int flags; Context *oncommit; @@ -226,7 +226,7 @@ struct PurgeRange { int Filer::purge_range(inodeno_t ino, ceph_file_layout *layout, const SnapContext& snapc, - __u64 first_obj, __u64 num_obj, + uint64_t first_obj, uint64_t num_obj, utime_t mtime, int flags, Context *oncommit) @@ -296,7 +296,7 @@ void Filer::_do_purge_range(PurgeRange *pr, int fin) // ----------------------- void Filer::file_to_extents(inodeno_t ino, ceph_file_layout *layout, - __u64 offset, __u64 len, + uint64_t offset, uint64_t len, vector& extents) { dout(10) << "file_to_extents " << offset << "~" << len @@ -314,18 +314,18 @@ void Filer::file_to_extents(inodeno_t ino, ceph_file_layout *layout, __u32 su = layout->fl_stripe_unit; __u32 stripe_count = layout->fl_stripe_count; assert(object_size >= su); - __u64 stripes_per_object = object_size / su; + uint64_t stripes_per_object = object_size / su; dout(20) << " stripes_per_object " << stripes_per_object << dendl; - __u64 cur = offset; - __u64 left = len; + uint64_t cur = offset; + uint64_t left = len; while (left > 0) { // layout into objects - __u64 blockno = cur / su; // which block - __u64 stripeno = blockno / stripe_count; // which horizontal stripe (Y) - __u64 stripepos = blockno % stripe_count; // which object in the object set (X) - __u64 objectsetno = stripeno / stripes_per_object; // which object set - __u64 objectno = objectsetno * stripe_count + stripepos; // object id + uint64_t blockno = cur / su; // which block + uint64_t stripeno = blockno / stripe_count; // which horizontal stripe (Y) + uint64_t stripepos = blockno % stripe_count; // which object in the object set (X) + uint64_t objectsetno = stripeno / stripes_per_object; // which object set + uint64_t objectno = objectsetno * stripe_count + stripepos; // object id // find oid, extent ObjectExtent *ex = 0; @@ -339,18 +339,18 @@ void Filer::file_to_extents(inodeno_t ino, ceph_file_layout *layout, } // map range into object - __u64 block_start = (stripeno % stripes_per_object)*su; - __u64 block_off = cur % su; - __u64 max = su - block_off; + uint64_t block_start = (stripeno % stripes_per_object)*su; + uint64_t block_off = cur % su; + uint64_t max = su - block_off; - __u64 x_offset = block_start + block_off; - __u64 x_len; + uint64_t x_offset = block_start + block_off; + uint64_t x_len; if (left > max) x_len = max; else x_len = left; - if (ex->offset + (__u64)ex->length == x_offset) { + if (ex->offset + (uint64_t)ex->length == x_offset) { // add to extent ex->length += x_len; } else { diff --git a/src/osdc/Filer.h b/src/osdc/Filer.h index 0208a8905621..73e43028a48a 100644 --- a/src/osdc/Filer.h +++ b/src/osdc/Filer.h @@ -48,7 +48,7 @@ class Filer { ceph_file_layout layout; snapid_t snapid; - __u64 *psize; + uint64_t *psize; utime_t *pmtime; int flags; @@ -58,9 +58,9 @@ class Filer { Context *onfinish; vector probing; - __u64 probing_off, probing_len; + uint64_t probing_off, probing_len; - map known_size; + map known_size; utime_t max_mtime; map ops; @@ -69,7 +69,7 @@ class Filer { bool found_size; Probe(inodeno_t i, ceph_file_layout &l, snapid_t sn, - __u64 f, __u64 *e, utime_t *m, int fl, bool fw, Context *c) : + uint64_t f, uint64_t *e, utime_t *m, int fl, bool fw, Context *c) : ino(i), layout(l), snapid(sn), psize(e), pmtime(m), flags(fl), fwd(fw), onfinish(c), probing_off(f), probing_len(0), @@ -79,7 +79,7 @@ class Filer { class C_Probe; void _probe(Probe *p); - void _probed(Probe *p, const object_t& oid, __u64 size, utime_t mtime); + void _probed(Probe *p, const object_t& oid, uint64_t size, utime_t mtime); public: Filer(Objecter *o) : objecter(o) {} @@ -97,7 +97,7 @@ class Filer { * ranges in objects on (primary) osds) */ void file_to_extents(inodeno_t ino, ceph_file_layout *layout, - __u64 offset, __u64 len, + uint64_t offset, uint64_t len, vector& extents); @@ -108,8 +108,8 @@ class Filer { int read(inodeno_t ino, ceph_file_layout *layout, snapid_t snap, - __u64 offset, - __u64 len, + uint64_t offset, + uint64_t len, bufferlist *bl, // ptr to data int flags, Context *onfinish) { @@ -123,11 +123,11 @@ class Filer { int read_trunc(inodeno_t ino, ceph_file_layout *layout, snapid_t snap, - __u64 offset, - __u64 len, + uint64_t offset, + uint64_t len, bufferlist *bl, // ptr to data int flags, - __u64 truncate_size, + uint64_t truncate_size, __u32 truncate_seq, Context *onfinish) { assert(snap); // (until there is a non-NOSNAP write) @@ -141,8 +141,8 @@ class Filer { int write(inodeno_t ino, ceph_file_layout *layout, const SnapContext& snapc, - __u64 offset, - __u64 len, + uint64_t offset, + uint64_t len, bufferlist& bl, utime_t mtime, int flags, @@ -157,12 +157,12 @@ class Filer { int write_trunc(inodeno_t ino, ceph_file_layout *layout, const SnapContext& snapc, - __u64 offset, - __u64 len, + uint64_t offset, + uint64_t len, bufferlist& bl, utime_t mtime, int flags, - __u64 truncate_size, + uint64_t truncate_size, __u32 truncate_seq, Context *onack, Context *oncommit) { @@ -176,8 +176,8 @@ class Filer { int truncate(inodeno_t ino, ceph_file_layout *layout, const SnapContext& snapc, - __u64 offset, - __u64 len, + uint64_t offset, + uint64_t len, __u32 truncate_seq, utime_t mtime, int flags, @@ -213,8 +213,8 @@ class Filer { int zero(inodeno_t ino, ceph_file_layout *layout, const SnapContext& snapc, - __u64 offset, - __u64 len, + uint64_t offset, + uint64_t len, utime_t mtime, int flags, Context *onack, @@ -244,7 +244,7 @@ class Filer { int purge_range(inodeno_t ino, ceph_file_layout *layout, const SnapContext& snapc, - __u64 first_obj, __u64 num_obj, + uint64_t first_obj, uint64_t num_obj, utime_t mtime, int flags, Context *oncommit); @@ -258,8 +258,8 @@ class Filer { int probe(inodeno_t ino, ceph_file_layout *layout, snapid_t snapid, - __u64 start_from, - __u64 *end, + uint64_t start_from, + uint64_t *end, utime_t *mtime, bool fwd, int flags, diff --git a/src/osdc/Journaler.cc b/src/osdc/Journaler.cc index 85ef1a783a2c..641fe6da125b 100644 --- a/src/osdc/Journaler.cc +++ b/src/osdc/Journaler.cc @@ -77,7 +77,7 @@ public: class Journaler::C_ProbeEnd : public Context { Journaler *ls; public: - __s64 end; + int64_t end; C_ProbeEnd(Journaler *l) : ls(l), end(-1) {} void finish(int r) { ls->_finish_probe_end(r, end); @@ -146,10 +146,10 @@ void Journaler::_finish_read_head(int r, bufferlist& bl) state = STATE_PROBING; C_ProbeEnd *fin = new C_ProbeEnd(this); filer.probe(ino, &layout, CEPH_NOSNAP, - h.write_pos, (__u64 *)&fin->end, 0, true, 0, fin); + h.write_pos, (uint64_t *)&fin->end, 0, true, 0, fin); } -void Journaler::_finish_probe_end(int r, __s64 end) +void Journaler::_finish_probe_end(int r, int64_t end) { assert(state == STATE_PROBING); @@ -228,15 +228,15 @@ void Journaler::_finish_write_head(Header &wrote, Context *oncommit) class Journaler::C_Flush : public Context { Journaler *ls; - __s64 start; + int64_t start; utime_t stamp; bool safe; public: - C_Flush(Journaler *l, __s64 s, utime_t st, bool sa) : ls(l), start(s), stamp(st), safe(sa) {} + C_Flush(Journaler *l, int64_t s, utime_t st, bool sa) : ls(l), start(s), stamp(st), safe(sa) {} void finish(int r) { ls->_finish_flush(r, start, stamp, safe); } }; -void Journaler::_finish_flush(int r, __s64 start, utime_t stamp, bool safe) +void Journaler::_finish_flush(int r, int64_t start, utime_t stamp, bool safe) { assert(r>=0); @@ -309,17 +309,17 @@ void Journaler::_finish_flush(int r, __s64 start, utime_t stamp, bool safe) } -__s64 Journaler::append_entry(bufferlist& bl) +int64_t Journaler::append_entry(bufferlist& bl) { uint32_t s = bl.length(); if (!g_conf.journaler_allow_split_entries) { // will we span a stripe boundary? int p = layout.fl_stripe_unit; - if (write_pos / p != (write_pos + (__s64)(bl.length() + sizeof(s))) / p) { + if (write_pos / p != (write_pos + (int64_t)(bl.length() + sizeof(s))) / p) { // yes. // move write_pos forward. - __s64 owp = write_pos; + int64_t owp = write_pos; write_pos += p; write_pos -= (write_pos % p); @@ -568,7 +568,7 @@ void Journaler::_finish_read(int r) * then discover we need even more for an especially large entry. * i don't think that circumstance will arise particularly often. */ -void Journaler::_issue_read(__s64 len) +void Journaler::_issue_read(int64_t len) { // make sure we're fully flushed _do_flush(); @@ -612,7 +612,7 @@ void Journaler::_issue_read(__s64 len) void Journaler::_prefetch() { // prefetch? - __s64 left = requested_pos - read_pos; + int64_t left = requested_pos - read_pos; if (left <= prefetch_from && // should read more, !_is_reading() && // and not reading anything right now write_pos > requested_pos) { // there's something more to read... @@ -696,7 +696,7 @@ bool Journaler::is_readable() // start reading some more? if (!_is_reading()) { if (s) - fetch_len = MAX(fetch_len, (__s64)(sizeof(s)+s-read_buf.length())); + fetch_len = MAX(fetch_len, (int64_t)(sizeof(s)+s-read_buf.length())); _issue_read(fetch_len); } @@ -710,7 +710,7 @@ bool Journaler::truncate_tail_junk(Context *c) return true; } - __s64 len = junk_tail_pos - write_pos; + int64_t len = junk_tail_pos - write_pos; dout(10) << "truncate_tail_junk " << write_pos << "~" << len << dendl; SnapContext snapc; filer.zero(ino, &layout, snapc, write_pos, len, g_clock.now(), 0, NULL, c); @@ -772,9 +772,9 @@ void Journaler::wait_for_readable(Context *onreadable) class Journaler::C_Trim : public Context { Journaler *ls; - __s64 to; + int64_t to; public: - C_Trim(Journaler *l, __s64 t) : ls(l), to(t) {} + C_Trim(Journaler *l, int64_t t) : ls(l), to(t) {} void finish(int r) { ls->_trim_finish(r, to); } @@ -782,9 +782,9 @@ public: void Journaler::trim() { - __u64 period = layout.fl_stripe_count * layout.fl_object_size; + uint64_t period = layout.fl_stripe_count * layout.fl_object_size; - __s64 trim_to = last_committed.expire_pos; + int64_t trim_to = last_committed.expire_pos; trim_to -= trim_to % period; dout(10) << "trim last_commited head was " << last_committed << ", can trim to " << trim_to @@ -810,15 +810,15 @@ void Journaler::trim() << dendl; // delete range of objects - __u64 first = trimming_pos / period; - __u64 num = (trim_to - trimming_pos) / period; + uint64_t first = trimming_pos / period; + uint64_t num = (trim_to - trimming_pos) / period; SnapContext snapc; filer.purge_range(ino, &layout, snapc, first, num, g_clock.now(), 0, new C_Trim(this, trim_to)); trimming_pos = trim_to; } -void Journaler::_trim_finish(int r, __s64 to) +void Journaler::_trim_finish(int r, int64_t to) { dout(10) << "_trim_finish trimmed_pos was " << trimmed_pos << ", trimmed/trimming/expire now " diff --git a/src/osdc/Journaler.h b/src/osdc/Journaler.h index 0152857d647c..dc907cac0907 100644 --- a/src/osdc/Journaler.h +++ b/src/osdc/Journaler.h @@ -64,10 +64,10 @@ class Journaler { public: // this goes at the head of the log "file". struct Header { - __s64 trimmed_pos; - __s64 expire_pos; - __s64 read_pos; - __s64 write_pos; + int64_t trimmed_pos; + int64_t expire_pos; + int64_t read_pos; + int64_t write_pos; nstring magic; ceph_file_layout layout; @@ -142,7 +142,7 @@ public: list waitfor_recover; void _finish_read_head(int r, bufferlist& bl); - void _finish_probe_end(int r, __s64 end); + void _finish_probe_end(int r, int64_t end); class C_ReadHead; friend class C_ReadHead; class C_ProbeEnd; @@ -151,33 +151,33 @@ public: // writer - __s64 write_pos; // logical write position, where next entry will go - __s64 flush_pos; // where we will flush. if write_pos>flush_pos, we're buffering writes. - __s64 ack_pos; // what has been acked. - __s64 safe_pos; // what has been committed safely to disk. + int64_t write_pos; // logical write position, where next entry will go + int64_t flush_pos; // where we will flush. if write_pos>flush_pos, we're buffering writes. + int64_t ack_pos; // what has been acked. + int64_t safe_pos; // what has been committed safely to disk. bufferlist write_buf; // write buffer. flush_pos + write_buf.length() == write_pos. - std::set<__s64> pending_ack, pending_safe; - std::map<__s64, std::list > waitfor_ack; // when flushed through given offset - std::map<__s64, std::list > waitfor_safe; // when safe through given offset - std::set<__s64> ack_barrier; + std::set pending_ack, pending_safe; + std::map > waitfor_ack; // when flushed through given offset + std::map > waitfor_safe; // when safe through given offset + std::set ack_barrier; void _do_flush(unsigned amount=0); - void _finish_flush(int r, __s64 start, utime_t stamp, bool safe); + void _finish_flush(int r, int64_t start, utime_t stamp, bool safe); class C_Flush; friend class C_Flush; // reader - __s64 read_pos; // logical read position, where next entry starts. - __s64 requested_pos; // what we've requested from OSD. - __s64 received_pos; // what we've received from OSD. + int64_t read_pos; // logical read position, where next entry starts. + int64_t requested_pos; // what we've requested from OSD. + int64_t received_pos; // what we've received from OSD. bufferlist read_buf; // read buffer. read_pos + read_buf.length() == prefetch_pos. bufferlist reading_buf; // what i'm reading into - __s64 fetch_len; // how much to read at a time - __s64 prefetch_from; // how far from end do we read next chunk + int64_t fetch_len; // how much to read at a time + int64_t prefetch_from; // how far from end do we read next chunk - __s64 junk_tail_pos; // for truncate + int64_t junk_tail_pos; // for truncate // for read_entry() in-progress read bufferlist *read_bl; @@ -189,7 +189,7 @@ public: return requested_pos > received_pos; } void _finish_read(int r); // we just read some (read completion callback) - void _issue_read(__s64 len); // read some more + void _issue_read(int64_t len); // read some more void _prefetch(); // maybe read ahead class C_Read; friend class C_Read; @@ -197,12 +197,12 @@ public: friend class C_RetryRead; // trimmer - __s64 expire_pos; // what we're allowed to trim to - __s64 trimming_pos; // what we've requested to trim through - __s64 trimmed_pos; // what has been trimmed - map<__s64, list > waitfor_trim; + int64_t expire_pos; // what we're allowed to trim to + int64_t trimming_pos; // what we've requested to trim through + int64_t trimmed_pos; // what has been trimmed + map > waitfor_trim; - void _trim_finish(int r, __s64 to); + void _trim_finish(int r, int64_t to); class C_Trim; friend class C_Trim; @@ -240,23 +240,23 @@ public: bool is_active() { return state == STATE_ACTIVE; } int get_error() { return error; } - __s64 get_write_pos() const { return write_pos; } - __s64 get_write_ack_pos() const { return ack_pos; } - __s64 get_write_safe_pos() const { return safe_pos; } - __s64 get_read_pos() const { return read_pos; } - __s64 get_expire_pos() const { return expire_pos; } - __s64 get_trimmed_pos() const { return trimmed_pos; } + int64_t get_write_pos() const { return write_pos; } + int64_t get_write_ack_pos() const { return ack_pos; } + int64_t get_write_safe_pos() const { return safe_pos; } + int64_t get_read_pos() const { return read_pos; } + int64_t get_expire_pos() const { return expire_pos; } + int64_t get_trimmed_pos() const { return trimmed_pos; } - __s64 get_layout_period() const { return layout.fl_stripe_count * layout.fl_object_size; } + int64_t get_layout_period() const { return layout.fl_stripe_count * layout.fl_object_size; } ceph_file_layout& get_layout() { return layout; } // write - __s64 append_entry(bufferlist& bl); + int64_t append_entry(bufferlist& bl); void wait_for_flush(Context *onsync = 0, Context *onsafe = 0, bool add_ack_barrier=false); void flush(Context *onsync = 0, Context *onsafe = 0, bool add_ack_barrier=false); // read - void set_read_pos(__s64 p) { + void set_read_pos(int64_t p) { assert(requested_pos == received_pos); // we can't cope w/ in-progress read right now. assert(read_bl == 0); // ... read_pos = requested_pos = received_pos = p; @@ -270,10 +270,10 @@ public: bool truncate_tail_junk(Context *fin); // trim - void set_expire_pos(__s64 ep) { expire_pos = ep; } + void set_expire_pos(int64_t ep) { expire_pos = ep; } void trim(); //bool is_trimmable() { return trimming_pos < expire_pos; } - //void trim(__s64 trim_to=0, Context *c=0); + //void trim(int64_t trim_to=0, Context *c=0); }; WRITE_CLASS_ENCODER(Journaler::Header) diff --git a/src/osdc/ObjectCacher.cc b/src/osdc/ObjectCacher.cc index 52f106759737..f789688b65e8 100644 --- a/src/osdc/ObjectCacher.cc +++ b/src/osdc/ObjectCacher.cc @@ -444,7 +444,7 @@ void ObjectCacher::bh_read(BufferHead *bh) onfinish); } -void ObjectCacher::bh_read_finish(sobject_t oid, loff_t start, __u64 length, bufferlist &bl) +void ObjectCacher::bh_read_finish(sobject_t oid, loff_t start, uint64_t length, bufferlist &bl) { //lock.Lock(); dout(7) << "bh_read_finish " @@ -610,7 +610,7 @@ void ObjectCacher::lock_ack(list& oids, tid_t tid) } } -void ObjectCacher::bh_write_ack(sobject_t oid, loff_t start, __u64 length, tid_t tid) +void ObjectCacher::bh_write_ack(sobject_t oid, loff_t start, uint64_t length, tid_t tid) { //lock.Lock(); @@ -677,7 +677,7 @@ void ObjectCacher::bh_write_ack(sobject_t oid, loff_t start, __u64 length, tid_t //lock.Unlock(); } -void ObjectCacher::bh_write_commit(sobject_t oid, loff_t start, __u64 length, tid_t tid) +void ObjectCacher::bh_write_commit(sobject_t oid, loff_t start, uint64_t length, tid_t tid) { //lock.Lock(); @@ -808,7 +808,7 @@ int ObjectCacher::readx(OSDRead *rd, ObjectSet *oset, Context *onfinish) { bool success = true; list hit_ls; - map<__u64, bufferlist> stripe_map; // final buffer offset -> substring + map stripe_map; // final buffer offset -> substring for (vector::iterator ex_it = rd->extents.begin(); ex_it != rd->extents.end(); @@ -867,9 +867,9 @@ int ObjectCacher::readx(OSDRead *rd, ObjectSet *oset, Context *onfinish) loff_t opos = ex_it->offset; map::iterator bh_it = hits.begin(); assert(bh_it->second->start() <= opos); - __u64 bhoff = opos - bh_it->second->start(); + uint64_t bhoff = opos - bh_it->second->start(); map<__u32,__u32>::iterator f_it = ex_it->buffer_extents.begin(); - __u64 foff = 0; + uint64_t foff = 0; while (1) { BufferHead *bh = bh_it->second; assert(opos == (loff_t)(bh->start() + bhoff)); @@ -879,7 +879,7 @@ int ObjectCacher::readx(OSDRead *rd, ObjectSet *oset, Context *onfinish) << " frag " << f_it->first << "~" << f_it->second << " +" << foff << dendl; - __u64 len = MIN(f_it->second - foff, + uint64_t len = MIN(f_it->second - foff, bh->length() - bhoff); bufferlist bit; // put substr here first, since substr_of clobbers, and // we may get multiple bh's at this stripe_map position @@ -920,10 +920,10 @@ int ObjectCacher::readx(OSDRead *rd, ObjectSet *oset, Context *onfinish) dout(10) << "readx has all buffers" << dendl; // ok, assemble into result buffer. - __u64 pos = 0; + uint64_t pos = 0; if (rd->bl) { rd->bl->clear(); - for (map<__u64,bufferlist>::iterator i = stripe_map.begin(); + for (map::iterator i = stripe_map.begin(); i != stripe_map.end(); i++) { assert(pos == i->first); @@ -971,7 +971,7 @@ int ObjectCacher::writex(OSDWrite *wr, ObjectSet *oset) f_it != ex_it->buffer_extents.end(); f_it++) { dout(10) << "writex writing " << f_it->first << "~" << f_it->second << " into " << *bh << " at " << opos << dendl; - __u64 bhoff = bh->start() - opos; + uint64_t bhoff = bh->start() - opos; assert(f_it->second <= bh->length() - bhoff); // get the frag we're mapping in @@ -1005,7 +1005,7 @@ int ObjectCacher::writex(OSDWrite *wr, ObjectSet *oset) // blocking wait for write. -bool ObjectCacher::wait_for_write(__u64 len, Mutex& lock) +bool ObjectCacher::wait_for_write(uint64_t len, Mutex& lock) { int blocked = 0; @@ -1613,10 +1613,10 @@ loff_t ObjectCacher::release_set(ObjectSet *oset) } -__u64 ObjectCacher::release_all() +uint64_t ObjectCacher::release_all() { dout(10) << "release_all" << dendl; - __u64 unclean = 0; + uint64_t unclean = 0; hash_map::iterator p = objects.begin(); while (p != objects.end()) { diff --git a/src/osdc/ObjectCacher.h b/src/osdc/ObjectCacher.h index c4e5c592bc1b..44d8ccd80c1e 100644 --- a/src/osdc/ObjectCacher.h +++ b/src/osdc/ObjectCacher.h @@ -249,7 +249,7 @@ class ObjectCacher { void *parent; inodeno_t ino; - __u64 truncate_seq, truncate_size; + uint64_t truncate_seq, truncate_size; xlist objects; xlist uncommitted; @@ -436,19 +436,19 @@ class ObjectCacher { void wrunlock(Object *o); public: - void bh_read_finish(sobject_t oid, loff_t offset, __u64 length, bufferlist &bl); - void bh_write_ack(sobject_t oid, loff_t offset, __u64 length, tid_t t); - void bh_write_commit(sobject_t oid, loff_t offset, __u64 length, tid_t t); + void bh_read_finish(sobject_t oid, loff_t offset, uint64_t length, bufferlist &bl); + void bh_write_ack(sobject_t oid, loff_t offset, uint64_t length, tid_t t); + void bh_write_commit(sobject_t oid, loff_t offset, uint64_t length, tid_t t); void lock_ack(list& oids, tid_t tid); class C_ReadFinish : public Context { ObjectCacher *oc; sobject_t oid; loff_t start; - __u64 length; + uint64_t length; public: bufferlist bl; - C_ReadFinish(ObjectCacher *c, sobject_t o, loff_t s, __u64 l) : oc(c), oid(o), start(s), length(l) {} + C_ReadFinish(ObjectCacher *c, sobject_t o, loff_t s, uint64_t l) : oc(c), oid(o), start(s), length(l) {} void finish(int r) { oc->bh_read_finish(oid, start, length, bl); } @@ -458,10 +458,10 @@ class ObjectCacher { ObjectCacher *oc; sobject_t oid; loff_t start; - __u64 length; + uint64_t length; public: tid_t tid; - C_WriteAck(ObjectCacher *c, sobject_t o, loff_t s, __u64 l) : oc(c), oid(o), start(s), length(l) {} + C_WriteAck(ObjectCacher *c, sobject_t o, loff_t s, uint64_t l) : oc(c), oid(o), start(s), length(l) {} void finish(int r) { oc->bh_write_ack(oid, start, length, tid); } @@ -470,10 +470,10 @@ class ObjectCacher { ObjectCacher *oc; sobject_t oid; loff_t start; - __u64 length; + uint64_t length; public: tid_t tid; - C_WriteCommit(ObjectCacher *c, sobject_t o, loff_t s, __u64 l) : oc(c), oid(o), start(s), length(l) {} + C_WriteCommit(ObjectCacher *c, sobject_t o, loff_t s, uint64_t l) : oc(c), oid(o), start(s), length(l) {} void finish(int r) { oc->bh_write_commit(oid, start, length, tid); } @@ -546,7 +546,7 @@ class ObjectCacher { bool is_cached(ObjectSet *oset, vector& extents, snapid_t snapid); // write blocking - bool wait_for_write(__u64 len, Mutex& lock); + bool wait_for_write(uint64_t len, Mutex& lock); // blocking. atomic+sync. int atomic_sync_readx(OSDRead *rd, ObjectSet *oset, Mutex& lock); @@ -564,7 +564,7 @@ class ObjectCacher { void purge_set(ObjectSet *oset); loff_t release_set(ObjectSet *oset); // returns # of bytes not released (ie non-clean) - __u64 release_all(); + uint64_t release_all(); void truncate_set(ObjectSet *oset, vector& ex); @@ -576,14 +576,14 @@ class ObjectCacher { /*** async+caching (non-blocking) file interface ***/ int file_is_cached(ObjectSet *oset, ceph_file_layout *layout, snapid_t snapid, - loff_t offset, __u64 len) { + loff_t offset, uint64_t len) { vector extents; filer.file_to_extents(oset->ino, layout, offset, len, extents); return is_cached(oset, extents, snapid); } int file_read(ObjectSet *oset, ceph_file_layout *layout, snapid_t snapid, - loff_t offset, __u64 len, + loff_t offset, uint64_t len, bufferlist *bl, int flags, Context *onfinish) { @@ -593,7 +593,7 @@ class ObjectCacher { } int file_write(ObjectSet *oset, ceph_file_layout *layout, const SnapContext& snapc, - loff_t offset, __u64 len, + loff_t offset, uint64_t len, bufferlist& bl, utime_t mtime, int flags) { OSDWrite *wr = prepare_write(snapc, bl, mtime, flags); filer.file_to_extents(oset->ino, layout, offset, len, wr->extents); @@ -606,7 +606,7 @@ class ObjectCacher { int file_atomic_sync_read(ObjectSet *oset, ceph_file_layout *layout, snapid_t snapid, - loff_t offset, __u64 len, + loff_t offset, uint64_t len, bufferlist *bl, int flags, Mutex &lock) { OSDRead *rd = prepare_read(snapid, bl, flags); @@ -616,7 +616,7 @@ class ObjectCacher { int file_atomic_sync_write(ObjectSet *oset, ceph_file_layout *layout, const SnapContext& snapc, - loff_t offset, __u64 len, + loff_t offset, uint64_t len, bufferlist& bl, utime_t mtime, int flags, Mutex &lock) { OSDWrite *wr = prepare_write(snapc, bl, mtime, flags); diff --git a/src/osdc/Objecter.cc b/src/osdc/Objecter.cc index 8b51e85daebd..e599ffad0f0e 100644 --- a/src/osdc/Objecter.cc +++ b/src/osdc/Objecter.cc @@ -613,7 +613,7 @@ void Objecter::_list_reply(ListContext *list_context, bufferlist *bl, Context *f bufferlist::iterator iter = bl->begin(); PGLSResponse response; ::decode(response, iter); - list_context->cookie = (__u64)response.handle; + list_context->cookie = (uint64_t)response.handle; int response_size = response.entries.size(); dout(20) << "response.entries.size " << response_size @@ -687,7 +687,7 @@ int Objecter::delete_pool_snap(int pool, string& snapName, Context *onfinish) return 0; } -int Objecter::create_pool(string& name, Context *onfinish, __u64 auid) +int Objecter::create_pool(string& name, Context *onfinish, uint64_t auid) { dout(10) << "create_pool name=" << name << dendl; PoolOp *op = new PoolOp; @@ -730,7 +730,7 @@ int Objecter::delete_pool(int pool, Context *onfinish) * on both the pool's current auid and the new (parameter) auid. * Uses the standard Context callback when done. */ -int Objecter::change_pool_auid(int pool, Context *onfinish, __u64 auid) +int Objecter::change_pool_auid(int pool, Context *onfinish, uint64_t auid) { dout(10) << "change_pool_auid " << pool << " to " << auid << dendl; PoolOp *op = new PoolOp; @@ -877,7 +877,7 @@ void Objecter::_sg_read_finish(vector& extents, vector bufferlist *bl, Context *onfinish) { // all done - __u64 bytes_read = 0; + uint64_t bytes_read = 0; dout(15) << "_sg_read_finish" << dendl; @@ -891,7 +891,7 @@ void Objecter::_sg_read_finish(vector& extents, vector */ // map extents back into buffer - map<__u64, bufferlist*> by_off; // buffer offset -> bufferlist + map by_off; // buffer offset -> bufferlist // for each object extent... vector::iterator bit = resultbl.begin(); @@ -943,11 +943,11 @@ void Objecter::_sg_read_finish(vector& extents, vector } // sort and string bits together - for (map<__u64, bufferlist*>::iterator it = by_off.begin(); + for (map::iterator it = by_off.begin(); it != by_off.end(); it++) { assert(it->second->length()); - if (it->first < (__u64)bytes_read) { + if (it->first < (uint64_t)bytes_read) { dout(21) << " concat buffer frag off " << it->first << " len " << it->second->length() << dendl; bl->claim_append(*(it->second)); } else { diff --git a/src/osdc/Objecter.h b/src/osdc/Objecter.h index a2f751e892b8..d81270f60613 100644 --- a/src/osdc/Objecter.h +++ b/src/osdc/Objecter.h @@ -55,7 +55,7 @@ struct ObjectOperation { ops.resize(s+1); ops[s].op.op = op; } - void add_data(int op, __u64 off, __u64 len, bufferlist& bl) { + void add_data(int op, uint64_t off, uint64_t len, bufferlist& bl) { int s = ops.size(); ops.resize(s+1); ops[s].op.op = op; @@ -84,7 +84,7 @@ struct ObjectOperation { ops[s].data.append(method, ops[s].op.cls.method_len); ops[s].data.append(indata); } - void add_pgls(int op, __u64 count, __u64 cookie) { + void add_pgls(int op, uint64_t count, uint64_t cookie) { int s = ops.size(); ops.resize(s+1); ops[s].op.op = op; @@ -95,23 +95,23 @@ struct ObjectOperation { // ------ // pg - void pg_ls(__u64 count, __u64 cookie) { + void pg_ls(uint64_t count, uint64_t cookie) { add_pgls(CEPH_OSD_OP_PGLS, count, cookie); flags |= CEPH_OSD_FLAG_PGOP; } // object data - void read(__u64 off, __u64 len) { + void read(uint64_t off, uint64_t len) { bufferlist bl; add_data(CEPH_OSD_OP_READ, off, len, bl); } - void write(__u64 off, __u64 len, bufferlist& bl) { + void write(uint64_t off, uint64_t len, bufferlist& bl) { add_data(CEPH_OSD_OP_WRITE, off, len, bl); } void write_full(bufferlist& bl) { add_data(CEPH_OSD_OP_WRITEFULL, 0, bl.length(), bl); } - void zero(__u64 off, __u64 len) { + void zero(uint64_t off, uint64_t len) { bufferlist bl; add_data(CEPH_OSD_OP_ZERO, off, len, bl); } @@ -243,15 +243,15 @@ public: struct C_Stat : public Context { bufferlist bl; - __u64 *psize; + uint64_t *psize; utime_t *pmtime; Context *fin; - C_Stat(__u64 *ps, utime_t *pm, Context *c) : + C_Stat(uint64_t *ps, utime_t *pm, Context *c) : psize(ps), pmtime(pm), fin(c) {} void finish(int r) { if (r >= 0) { bufferlist::iterator p = bl.begin(); - __u64 s; + uint64_t s; utime_t m; ::decode(s, p); ::decode(m, p); @@ -284,7 +284,7 @@ public: // Pools and statistics struct ListContext { int current_pg; - __u64 cookie; + uint64_t cookie; int starting_pg_num; bool at_end; @@ -340,7 +340,7 @@ public: Context *onfinish; int pool_op; int* replyCode; - __u64 auid; + uint64_t auid; utime_t last_submit; PoolOp() : tid(0), pool(0), onfinish(0), pool_op(0), @@ -470,7 +470,7 @@ private: // high-level helpers tid_t stat(const object_t& oid, ceph_object_layout ol, snapid_t snap, - __u64 *psize, utime_t *pmtime, int flags, + uint64_t *psize, utime_t *pmtime, int flags, Context *onfinish) { vector ops(1); ops[0].op.op = CEPH_OSD_OP_STAT; @@ -482,7 +482,7 @@ private: } tid_t read(const object_t& oid, ceph_object_layout ol, - __u64 off, __u64 len, snapid_t snap, bufferlist *pbl, int flags, + uint64_t off, uint64_t len, snapid_t snap, bufferlist *pbl, int flags, Context *onfinish) { vector ops(1); ops[0].op.op = CEPH_OSD_OP_READ; @@ -496,8 +496,8 @@ private: return op_submit(o); } tid_t read_trunc(const object_t& oid, ceph_object_layout ol, - __u64 off, __u64 len, snapid_t snap, bufferlist *pbl, int flags, - __u64 trunc_size, __u32 trunc_seq, + uint64_t off, uint64_t len, snapid_t snap, bufferlist *pbl, int flags, + uint64_t trunc_size, __u32 trunc_seq, Context *onfinish) { vector ops(1); ops[0].op.op = CEPH_OSD_OP_READ; @@ -555,7 +555,7 @@ private: return op_submit(o); } tid_t write(const object_t& oid, ceph_object_layout ol, - __u64 off, __u64 len, const SnapContext& snapc, const bufferlist &bl, + uint64_t off, uint64_t len, const SnapContext& snapc, const bufferlist &bl, utime_t mtime, int flags, Context *onack, Context *oncommit) { vector ops(1); @@ -571,9 +571,9 @@ private: return op_submit(o); } tid_t write_trunc(const object_t& oid, ceph_object_layout ol, - __u64 off, __u64 len, const SnapContext& snapc, const bufferlist &bl, + uint64_t off, uint64_t len, const SnapContext& snapc, const bufferlist &bl, utime_t mtime, int flags, - __u64 trunc_size, __u32 trunc_seq, + uint64_t trunc_size, __u32 trunc_seq, Context *onack, Context *oncommit) { vector ops(1); ops[0].op.op = CEPH_OSD_OP_WRITE; @@ -601,7 +601,7 @@ private: return op_submit(o); } tid_t zero(const object_t& oid, ceph_object_layout ol, - __u64 off, __u64 len, const SnapContext& snapc, utime_t mtime, int flags, + uint64_t off, uint64_t len, const SnapContext& snapc, utime_t mtime, int flags, Context *onack, Context *oncommit) { vector ops(1); ops[0].op.op = CEPH_OSD_OP_ZERO; @@ -672,9 +672,9 @@ public: int create_pool_snap(int pool, string& snapName, Context *onfinish); int delete_pool_snap(int pool, string& snapName, Context *onfinish); - int create_pool(string& name, Context *onfinish, __u64 auid=0); + int create_pool(string& name, Context *onfinish, uint64_t auid=0); int delete_pool(int pool, Context *onfinish); - int change_pool_auid(int pool, Context *onfinish, __u64 auid); + int change_pool_auid(int pool, Context *onfinish, uint64_t auid); void handle_pool_op_reply(MPoolOpReply *m); @@ -719,7 +719,7 @@ public: }; void sg_read_trunc(vector& extents, snapid_t snap, bufferlist *bl, int flags, - __u64 trunc_size, __u32 trunc_seq, Context *onfinish) { + uint64_t trunc_size, __u32 trunc_seq, Context *onfinish) { if (extents.size() == 1) { read_trunc(extents[0].oid, extents[0].layout, extents[0].offset, extents[0].length, snap, bl, flags, trunc_size, trunc_seq, onfinish); @@ -740,7 +740,7 @@ public: } void sg_write_trunc(vector& extents, const SnapContext& snapc, const bufferlist& bl, utime_t mtime, - int flags, __u64 trunc_size, __u32 trunc_seq, + int flags, uint64_t trunc_size, __u32 trunc_seq, Context *onack, Context *oncommit) { if (extents.size() == 1) { write_trunc(extents[0].oid, extents[0].layout, extents[0].offset, extents[0].length, diff --git a/src/psim.cc b/src/psim.cc index 20a177d08e8d..fe1b310905af 100644 --- a/src/psim.cc +++ b/src/psim.cc @@ -61,7 +61,7 @@ int main(int argc, char **argv) } } - __u64 avg = 0; + uint64_t avg = 0; for (int i=0; iimage_size; - __u64 numseg = size >> header->obj_order; - __u64 start = newsize >> header->obj_order; + uint64_t size = header->image_size; + uint64_t numseg = size >> header->obj_order; + uint64_t start = newsize >> header->obj_order; cout << "trimming image data from " << numseg << " to " << start << " objects..." << std::endl; - for (__u64 i=start; i& result, map& common_prefixes) = 0; /** Create a new bucket*/ - virtual int create_bucket(std::string& id, std::string& bucket, map& attrs, __u64 auid=0) = 0; + virtual int create_bucket(std::string& id, std::string& bucket, map& attrs, uint64_t auid=0) = 0; /** write an object to the storage device in the appropriate pool with the given stats */ virtual int put_obj(std::string& id, std::string& bucket, std::string& obj, const char *data, size_t size, diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc index 8d40adf7e782..1f3558693df4 100644 --- a/src/rgw/rgw_admin.cc +++ b/src/rgw/rgw_admin.cc @@ -98,7 +98,7 @@ int main(int argc, char **argv) bool list_buckets = false; bool delete_user = false; int actions = 0 ; - __u64 auid = 0; + uint64_t auid = 0; RGWUserInfo info; RGWAccess *store; diff --git a/src/rgw/rgw_common.h b/src/rgw/rgw_common.h index 20b102ccdd76..fa095e83c88d 100644 --- a/src/rgw/rgw_common.h +++ b/src/rgw/rgw_common.h @@ -35,7 +35,7 @@ using namespace std; #define RGW_ATTR_CONTENT_TYPE RGW_ATTR_PREFIX "content_type" #define USER_INFO_VER 2 -#define CEPH_AUTH_UID_DEFAULT (__u64) -1 +#define CEPH_AUTH_UID_DEFAULT (uint64_t) -1 typedef void *RGWAccessHandle; @@ -107,7 +107,7 @@ class RGWAccessControlPolicy; struct RGWUserInfo { - __u64 auid; + uint64_t auid; string user_id; string secret_key; string display_name; @@ -195,7 +195,7 @@ struct RGWObjEnt { void encode(bufferlist& bl) const { __u8 struct_v = 1; ::encode(struct_v, bl); - __u64 s = size; + uint64_t s = size; __u32 mt = mtime; ::encode(name, bl); ::encode(s, bl); @@ -205,7 +205,7 @@ struct RGWObjEnt { __u8 struct_v; ::decode(struct_v, bl); __u32 mt; - __u64 s; + uint64_t s; ::decode(name, bl); ::decode(s, bl); ::decode(mt, bl); diff --git a/src/rgw/rgw_fs.cc b/src/rgw/rgw_fs.cc index bbbbb3c94eb6..aa4c9a9f6490 100644 --- a/src/rgw/rgw_fs.cc +++ b/src/rgw/rgw_fs.cc @@ -145,7 +145,7 @@ int RGWFS::list_objects(string& id, string& bucket, int max, string& prefix, str } -int RGWFS::create_bucket(std::string& id, std::string& bucket, map& attrs, __u64 auid) +int RGWFS::create_bucket(std::string& id, std::string& bucket, map& attrs, uint64_t auid) { int len = strlen(DIR_NAME) + 1 + bucket.size() + 1; char buf[len]; diff --git a/src/rgw/rgw_fs.h b/src/rgw/rgw_fs.h index 084c5fa5e94b..87bac4043afb 100644 --- a/src/rgw/rgw_fs.h +++ b/src/rgw/rgw_fs.h @@ -13,7 +13,7 @@ public: int list_objects(std::string& id, std::string& bucket, int max, std::string& prefix, std::string& delim, std::string& marker, std::vector& result, map& common_prefixes); - int create_bucket(std::string& id, std::string& bucket, map& attrs, __u64 auid=0); + int create_bucket(std::string& id, std::string& bucket, map& attrs, uint64_t auid=0); int put_obj(std::string& id, std::string& bucket, std::string& obj, const char *data, size_t size, time_t *mtime, map& attrs); diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 8c9b8114aaf5..3c42260e3fda 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -184,7 +184,7 @@ int RGWRados::list_objects(string& id, string& bucket, int max, string& prefix, } } - __u64 s; + uint64_t s; if (rados->stat(pool, *p, &s, &obj.mtime) < 0) continue; obj.size = s; @@ -207,7 +207,7 @@ int RGWRados::list_objects(string& id, string& bucket, int max, string& prefix, * if auid is set, it sets the auid of the underlying rados pool * returns 0 on success, -ERR# otherwise. */ -int RGWRados::create_bucket(std::string& id, std::string& bucket, map& attrs, __u64 auid) +int RGWRados::create_bucket(std::string& id, std::string& bucket, map& attrs, uint64_t auid) { int ret = rados->create(root_pool, bucket, true); if (ret < 0) @@ -456,7 +456,7 @@ int RGWRados::get_obj(std::string& bucket, std::string& oid, struct rgw_err *err) { int r = -EINVAL; - __u64 size, len; + uint64_t size, len; bufferlist etag; time_t mtime; bufferlist bl; diff --git a/src/rgw/rgw_rados.h b/src/rgw/rgw_rados.h index ac4c5a015639..4c8f7b3a7698 100644 --- a/src/rgw/rgw_rados.h +++ b/src/rgw/rgw_rados.h @@ -28,7 +28,7 @@ public: * create a bucket with name bucket and the given list of attrs * returns 0 on success, -ERR# otherwise. */ - int create_bucket(std::string& id, std::string& bucket, map& attrs, __u64 auid=0); + int create_bucket(std::string& id, std::string& bucket, map& attrs, uint64_t auid=0); /** Write/overwrite an object to the bucket storage. */ int put_obj(std::string& id, std::string& bucket, std::string& obj, const char *data, size_t size, diff --git a/src/testmsgr.cc b/src/testmsgr.cc index 745d9c5c22d4..497ba2c663b8 100644 --- a/src/testmsgr.cc +++ b/src/testmsgr.cc @@ -41,7 +41,7 @@ Messenger *messenger = 0; Mutex lock("mylock"); Cond cond; -__u64 received = 0; +uint64_t received = 0; class Admin : public Dispatcher { bool ms_dispatch(Message *m) { @@ -102,7 +102,7 @@ int main(int argc, const char **argv, const char *envp[]) { isend = 100; lock.Lock(); - __u64 sent = 0; + uint64_t sent = 0; while (1) { while (received + isend <= sent) { //cerr << "wait r " << received << " s " << sent << " is " << isend << std::endl;