From 1268dbb36e11c55f7160f416d8579676eb53d74f Mon Sep 17 00:00:00 2001 From: Dan Mick Date: Thu, 27 Feb 2014 17:29:28 -0800 Subject: [PATCH] Change tid_t to ceph_tid_t to avoid conflicts with a popular type Signed-off-by: Dan Mick --- src/client/Client.cc | 14 ++-- src/client/Client.h | 4 +- src/client/Inode.h | 2 +- src/client/MetaRequest.h | 6 +- src/client/ObjecterWriteback.h | 4 +- src/include/types.h | 2 +- src/librados/AioCompletionImpl.h | 2 +- src/librados/IoCtxImpl.cc | 6 +- src/librados/IoCtxImpl.h | 4 +- src/librados/RadosClient.cc | 4 +- src/librbd/LibrbdWriteback.cc | 2 +- src/librbd/LibrbdWriteback.h | 4 +- src/mds/LogSegment.h | 2 +- src/mds/MDCache.cc | 10 +-- src/mds/MDCache.h | 16 ++-- src/mds/MDS.h | 4 +- src/mds/SessionMap.h | 10 +-- src/mds/mdstypes.cc | 4 +- src/mds/mdstypes.h | 4 +- src/messages/MClientRequest.h | 4 +- src/messages/MClientRequestForward.h | 2 +- src/messages/MGetPoolStats.h | 2 +- src/messages/MGetPoolStatsReply.h | 2 +- src/messages/MMDSFindIno.h | 4 +- src/messages/MMDSFindInoReply.h | 4 +- src/messages/MMDSOpenIno.h | 2 +- src/messages/MMDSOpenInoReply.h | 2 +- src/messages/MMonGetVersion.h | 2 +- src/messages/MMonGetVersionReply.h | 2 +- src/messages/MOSDOp.h | 2 +- src/messages/MOSDSubOp.h | 2 +- src/messages/MPoolOp.h | 4 +- src/messages/MPoolOpReply.h | 4 +- src/messages/MStatfs.h | 2 +- src/messages/MStatfsReply.h | 2 +- src/mon/MonClient.cc | 4 +- src/mon/MonClient.h | 4 +- src/msg/Message.h | 6 +- src/msg/Pipe.cc | 2 +- src/osd/ECBackend.cc | 42 +++++----- src/osd/ECBackend.h | 16 ++-- src/osd/ECMsgTypes.h | 10 +-- src/osd/OSD.cc | 2 +- src/osd/OSD.h | 14 ++-- src/osd/OpRequest.h | 4 +- src/osd/PGBackend.h | 6 +- src/osd/ReplicatedBackend.cc | 8 +- src/osd/ReplicatedBackend.h | 10 +-- src/osd/ReplicatedPG.cc | 40 +++++----- src/osd/ReplicatedPG.h | 22 +++--- src/osdc/ObjectCacher.cc | 6 +- src/osdc/ObjectCacher.h | 22 +++--- src/osdc/Objecter.cc | 112 +++++++++++++-------------- src/osdc/Objecter.h | 112 +++++++++++++-------------- src/osdc/WritebackHandler.h | 13 ++-- src/test/osdc/FakeWriteback.cc | 2 +- src/test/osdc/FakeWriteback.h | 9 ++- 57 files changed, 308 insertions(+), 304 deletions(-) diff --git a/src/client/Client.cc b/src/client/Client.cc index 3e7c4e6f16003..8691cd7678e89 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -1202,7 +1202,7 @@ void Client::dump_mds_sessions(Formatter *f) } void Client::dump_mds_requests(Formatter *f) { - for (map::iterator p = mds_requests.begin(); + for (map::iterator p = mds_requests.begin(); p != mds_requests.end(); ++p) { f->open_object_section("request"); @@ -1315,7 +1315,7 @@ int Client::make_request(MetaRequest *request, int r = 0; // assign a unique tid - tid_t tid = ++last_tid; + ceph_tid_t tid = ++last_tid; request->set_tid(tid); // make note mds_requests[tid] = request->get(); @@ -1726,7 +1726,7 @@ void Client::handle_client_request_forward(MClientRequestForward *fwd) fwd->put(); return; } - tid_t tid = fwd->get_tid(); + ceph_tid_t tid = fwd->get_tid(); if (mds_requests.count(tid) == 0) { ldout(cct, 10) << "handle_client_request_forward no pending request on tid " << tid << dendl; @@ -1765,7 +1765,7 @@ void Client::handle_client_reply(MClientReply *reply) return; } - tid_t tid = reply->get_tid(); + ceph_tid_t tid = reply->get_tid(); bool is_safe = reply->is_safe(); if (mds_requests.count(tid) == 0) { @@ -2043,7 +2043,7 @@ void Client::send_reconnect(MetaSession *session) void Client::kick_requests(MetaSession *session) { ldout(cct, 10) << "kick_requests for mds." << session->mds_num << dendl; - for (map::iterator p = mds_requests.begin(); + for (map::iterator p = mds_requests.begin(); p != mds_requests.end(); ++p) { if (p->second->mds == session->mds_num) { @@ -2063,7 +2063,7 @@ void Client::resend_unsafe_requests(MetaSession *session) void Client::kick_requests_closed(MetaSession *session) { ldout(cct, 10) << "kick_requests_closed for mds." << session->mds_num << dendl; - for (map::iterator p = mds_requests.begin(); + for (map::iterator p = mds_requests.begin(); p != mds_requests.end(); ++p) { if (p->second->mds == session->mds_num) { @@ -6513,7 +6513,7 @@ int Client::_fsync(Fh *f, bool syncdataonly) int r = 0; Inode *in = f->inode; - tid_t wait_on_flush = 0; + ceph_tid_t wait_on_flush = 0; bool flushed_metadata = false; Mutex lock("Client::_fsync::lock"); Cond cond; diff --git a/src/client/Client.h b/src/client/Client.h index 20169fc7fd1b2..0aa81706bdd6a 100644 --- a/src/client/Client.h +++ b/src/client/Client.h @@ -255,8 +255,8 @@ public: void resend_unsafe_requests(MetaSession *s); // mds requests - tid_t last_tid, last_flush_seq; - map mds_requests; + ceph_tid_t last_tid, last_flush_seq; + map mds_requests; set failed_mds; void dump_mds_requests(Formatter *f); diff --git a/src/client/Inode.h b/src/client/Inode.h index 587a7ea6c4543..d8e001fce7984 100644 --- a/src/client/Inode.h +++ b/src/client/Inode.h @@ -149,7 +149,7 @@ class Inode { int snap_caps, snap_cap_refs; utime_t hold_caps_until; xlist::item cap_item, flushing_cap_item; - tid_t last_flush_tid; + ceph_tid_t last_flush_tid; SnapRealm *snaprealm; xlist::item snaprealm_item; diff --git a/src/client/MetaRequest.h b/src/client/MetaRequest.h index 5583cd1628138..45a90dc02083c 100644 --- a/src/client/MetaRequest.h +++ b/src/client/MetaRequest.h @@ -140,8 +140,8 @@ public: } // normal fields - void set_tid(tid_t t) { tid = t; } - void set_oldest_client_tid(tid_t t) { head.oldest_client_tid = t; } + void set_tid(ceph_tid_t t) { tid = t; } + void set_oldest_client_tid(ceph_tid_t t) { head.oldest_client_tid = t; } void inc_num_fwd() { head.num_fwd = head.num_fwd + 1; } void set_retry_attempt(int a) { head.num_retry = a; } void set_filepath(const filepath& fp) { path = fp; } @@ -154,7 +154,7 @@ public: head.flags = head.flags | CEPH_MDS_FLAG_WANT_DENTRY; } int get_op() { return head.op; } - tid_t get_tid() { return tid; } + ceph_tid_t get_tid() { return tid; } filepath& get_filepath() { return path; } filepath& get_filepath2() { return path2; } diff --git a/src/client/ObjecterWriteback.h b/src/client/ObjecterWriteback.h index 9a10fb48a0656..f2d903a59b71f 100644 --- a/src/client/ObjecterWriteback.h +++ b/src/client/ObjecterWriteback.h @@ -23,7 +23,7 @@ class ObjecterWriteback : public WritebackHandler { return false; } - virtual tid_t write(const object_t& oid, const object_locator_t& oloc, + virtual ceph_tid_t write(const object_t& oid, const object_locator_t& oloc, uint64_t off, uint64_t len, const SnapContext& snapc, const bufferlist &bl, utime_t mtime, uint64_t trunc_size, __u32 trunc_seq, Context *oncommit) { @@ -31,7 +31,7 @@ class ObjecterWriteback : public WritebackHandler { trunc_size, trunc_seq, NULL, oncommit); } - virtual tid_t lock(const object_t& oid, const object_locator_t& oloc, int op, + virtual ceph_tid_t lock(const object_t& oid, const object_locator_t& oloc, int op, int flags, Context *onack, Context *oncommit) { return m_objecter->lock(oid, oloc, op, flags, onack, oncommit); } diff --git a/src/include/types.h b/src/include/types.h index 974edee02fd9f..ffb0202b2d17e 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -235,7 +235,7 @@ WRITE_RAW_ENCODER(ceph_mon_statfs_reply) // some basic types // NOTE: these must match ceph_fs.h typedefs -typedef uint64_t tid_t; // transaction id +typedef uint64_t ceph_tid_t; // transaction id typedef uint64_t version_t; typedef __u32 epoch_t; // map epoch (32bits -> 13 epochs/second for 10 years) diff --git a/src/librados/AioCompletionImpl.h b/src/librados/AioCompletionImpl.h index 48941bb2b4942..521f3bc153b00 100644 --- a/src/librados/AioCompletionImpl.h +++ b/src/librados/AioCompletionImpl.h @@ -43,7 +43,7 @@ struct librados::AioCompletionImpl { unsigned maxlen; IoCtxImpl *io; - tid_t aio_write_seq; + ceph_tid_t aio_write_seq; xlist::item aio_write_list_item; AioCompletionImpl() : lock("AioCompletionImpl lock", false, false), diff --git a/src/librados/IoCtxImpl.cc b/src/librados/IoCtxImpl.cc index 692596160b622..4f5387aa578c4 100644 --- a/src/librados/IoCtxImpl.cc +++ b/src/librados/IoCtxImpl.cc @@ -95,7 +95,7 @@ void librados::IoCtxImpl::complete_aio_write(AioCompletionImpl *c) assert(c->io == this); c->aio_write_list_item.remove_myself(); - map >::iterator waiters = aio_write_waiters.begin(); + map >::iterator waiters = aio_write_waiters.begin(); while (waiters != aio_write_waiters.end()) { if (!aio_write_list.empty() && aio_write_list.front()->aio_write_seq <= waiters->first) { @@ -123,7 +123,7 @@ void librados::IoCtxImpl::flush_aio_writes_async(AioCompletionImpl *c) ldout(client->cct, 20) << "flush_aio_writes_async " << this << " completion " << c << dendl; Mutex::Locker l(aio_write_list_lock); - tid_t seq = aio_write_seq; + ceph_tid_t seq = aio_write_seq; if (aio_write_list.empty()) { ldout(client->cct, 20) << "flush_aio_writes_async no writes. (tid " << seq << ")" << dendl; @@ -140,7 +140,7 @@ void librados::IoCtxImpl::flush_aio_writes() { ldout(client->cct, 20) << "flush_aio_writes" << dendl; aio_write_list_lock.Lock(); - tid_t seq = aio_write_seq; + ceph_tid_t seq = aio_write_seq; while (!aio_write_list.empty() && aio_write_list.front()->aio_write_seq <= seq) aio_write_cond.Wait(aio_write_list_lock); diff --git a/src/librados/IoCtxImpl.h b/src/librados/IoCtxImpl.h index 58e27ed49c979..528022f3e0fa6 100644 --- a/src/librados/IoCtxImpl.h +++ b/src/librados/IoCtxImpl.h @@ -42,10 +42,10 @@ struct librados::IoCtxImpl { object_locator_t oloc; Mutex aio_write_list_lock; - tid_t aio_write_seq; + ceph_tid_t aio_write_seq; Cond aio_write_cond; xlist aio_write_list; - map > aio_write_waiters; + map > aio_write_waiters; Mutex *lock; Objecter *objecter; diff --git a/src/librados/RadosClient.cc b/src/librados/RadosClient.cc index b656b5e25f23f..249c34f564f00 100644 --- a/src/librados/RadosClient.cc +++ b/src/librados/RadosClient.cc @@ -754,7 +754,7 @@ int librados::RadosClient::osd_command(int osd, vector& cmd, Cond cond; bool done; int ret; - tid_t tid; + ceph_tid_t tid; if (osd < 0) return -EINVAL; @@ -781,7 +781,7 @@ int librados::RadosClient::pg_command(pg_t pgid, vector& cmd, Cond cond; bool done; int ret; - tid_t tid; + ceph_tid_t tid; lock.Lock(); int r = objecter->pg_command(pgid, cmd, inbl, &tid, poutbl, prs, new C_SafeCond(&mylock, &cond, &done, &ret)); diff --git a/src/librbd/LibrbdWriteback.cc b/src/librbd/LibrbdWriteback.cc index ddb882dfbbb9c..854ac9dc3e78b 100644 --- a/src/librbd/LibrbdWriteback.cc +++ b/src/librbd/LibrbdWriteback.cc @@ -131,7 +131,7 @@ namespace librbd { return may; } - tid_t LibrbdWriteback::write(const object_t& oid, + ceph_tid_t LibrbdWriteback::write(const object_t& oid, const object_locator_t& oloc, uint64_t off, uint64_t len, const SnapContext& snapc, diff --git a/src/librbd/LibrbdWriteback.h b/src/librbd/LibrbdWriteback.h index 0967421e9e3c2..a8bd9cb2b57a1 100644 --- a/src/librbd/LibrbdWriteback.h +++ b/src/librbd/LibrbdWriteback.h @@ -32,7 +32,7 @@ namespace librbd { virtual bool may_copy_on_write(const object_t& oid, uint64_t read_off, uint64_t read_len, snapid_t snapid); // Note that oloc, trunc_size, and trunc_seq are ignored - virtual tid_t write(const object_t& oid, const object_locator_t& oloc, + virtual ceph_tid_t write(const object_t& oid, const object_locator_t& oloc, uint64_t off, uint64_t len, const SnapContext& snapc, const bufferlist &bl, utime_t mtime, uint64_t trunc_size, __u32 trunc_seq, Context *oncommit); @@ -52,7 +52,7 @@ namespace librbd { private: void complete_writes(const std::string& oid); - tid_t m_tid; + ceph_tid_t m_tid; Mutex& m_lock; librbd::ImageCtx *m_ictx; ceph::unordered_map > m_writes; diff --git a/src/mds/LogSegment.h b/src/mds/LogSegment.h index c9fdfd7f4096e..2fffe3bbaf933 100644 --- a/src/mds/LogSegment.h +++ b/src/mds/LogSegment.h @@ -59,7 +59,7 @@ class LogSegment { set uncommitted_fragments; // client request ids - map last_client_tids; + map last_client_tids; // table version version_t inotablev; diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index 28930cd9119b1..95c4ab9639f79 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -8667,7 +8667,7 @@ void MDCache::find_ino_peers(inodeno_t ino, Context *c, int hint) dout(5) << "find_ino_peers " << ino << " hint " << hint << dendl; assert(!have_inode(ino)); - tid_t tid = ++find_ino_peer_last_tid; + ceph_tid_t tid = ++find_ino_peer_last_tid; find_ino_peer_info_t& fip = find_ino_peer[tid]; fip.ino = ino; fip.tid = tid; @@ -8731,7 +8731,7 @@ void MDCache::handle_find_ino(MMDSFindIno *m) void MDCache::handle_find_ino_reply(MMDSFindInoReply *m) { - map::iterator p = find_ino_peer.find(m->tid); + map::iterator p = find_ino_peer.find(m->tid); if (p != find_ino_peer.end()) { dout(10) << "handle_find_ino_reply " << *m << dendl; find_ino_peer_info_t& fip = p->second; @@ -8773,7 +8773,7 @@ void MDCache::handle_find_ino_reply(MMDSFindInoReply *m) void MDCache::kick_find_ino_peers(int who) { // find_ino_peers requests we should move on from - for (map::iterator p = find_ino_peer.begin(); + for (map::iterator p = find_ino_peer.begin(); p != find_ino_peer.end(); ++p) { find_ino_peer_info_t& fip = p->second; @@ -10053,7 +10053,7 @@ void MDCache::discover_ino(CDir *base, void MDCache::kick_discovers(int who) { - for (map::iterator p = discovers.begin(); + for (map::iterator p = discovers.begin(); p != discovers.end(); ++p) { if (p->second.mds != who) @@ -10387,7 +10387,7 @@ void MDCache::handle_discover_reply(MDiscoverReply *m) // decrement discover counters if (m->get_tid()) { - map::iterator p = discovers.find(m->get_tid()); + map::iterator p = discovers.find(m->get_tid()); if (p != discovers.end()) { dout(10) << " found tid " << m->get_tid() << dendl; discovers.erase(p); diff --git a/src/mds/MDCache.h b/src/mds/MDCache.h index b3c5ad5535870..500c23fb582cc 100644 --- a/src/mds/MDCache.h +++ b/src/mds/MDCache.h @@ -131,7 +131,7 @@ public: // -- discover -- struct discover_info_t { - tid_t tid; + ceph_tid_t tid; int mds; inodeno_t ino; frag_t frag; @@ -144,12 +144,12 @@ public: discover_info_t() : tid(0), mds(-1), snap(CEPH_NOSNAP), want_base_dir(false), want_xlocked(false) {} }; - map discovers; - tid_t discover_last_tid; + map discovers; + ceph_tid_t discover_last_tid; void _send_discover(discover_info_t& dis); discover_info_t& _create_discover(int mds) { - tid_t t = ++discover_last_tid; + ceph_tid_t t = ++discover_last_tid; discover_info_t& d = discovers[t]; d.tid = t; d.mds = mds; @@ -802,7 +802,7 @@ protected: open_ino_info_t() : checking(-1), auth_hint(-1), check_peers(true), fetch_backtrace(true), discover(false) {} }; - tid_t open_ino_last_tid; + ceph_tid_t open_ino_last_tid; map opening_inodes; void _open_ino_backtrace_fetched(inodeno_t ino, bufferlist& bl, int err); @@ -830,7 +830,7 @@ public: // -- find_ino_peer -- struct find_ino_peer_info_t { inodeno_t ino; - tid_t tid; + ceph_tid_t tid; Context *fin; int hint; int checking; @@ -839,8 +839,8 @@ public: find_ino_peer_info_t() : tid(0), fin(NULL), hint(-1), checking(-1) {} }; - map find_ino_peer; - tid_t find_ino_peer_last_tid; + map find_ino_peer; + ceph_tid_t find_ino_peer_last_tid; void find_ino_peers(inodeno_t ino, Context *c, int hint=-1); void _do_find_ino_peer(find_ino_peer_info_t& fip); diff --git a/src/mds/MDS.h b/src/mds/MDS.h index ac68fea83f3a3..10acd34843d48 100644 --- a/src/mds/MDS.h +++ b/src/mds/MDS.h @@ -204,7 +204,7 @@ class MDS : public Dispatcher { map peer_mdsmap_epoch; - tid_t last_tid; // for mds-initiated requests (e.g. stray rename) + ceph_tid_t last_tid; // for mds-initiated requests (e.g. stray rename) public: void wait_for_active(Context *c) { @@ -251,7 +251,7 @@ class MDS : public Dispatcher { void request_state(int s); - tid_t issue_tid() { return ++last_tid; } + ceph_tid_t issue_tid() { return ++last_tid; } // -- waiters -- diff --git a/src/mds/SessionMap.h b/src/mds/SessionMap.h index 8ddbacc666039..e06a7b7dde3e9 100644 --- a/src/mds/SessionMap.h +++ b/src/mds/SessionMap.h @@ -181,17 +181,17 @@ private: public: - void add_completed_request(tid_t t, inodeno_t created) { + void add_completed_request(ceph_tid_t t, inodeno_t created) { info.completed_requests[t] = created; } - void trim_completed_requests(tid_t mintid) { + void trim_completed_requests(ceph_tid_t mintid) { // trim while (!info.completed_requests.empty() && (mintid == 0 || info.completed_requests.begin()->first < mintid)) info.completed_requests.erase(info.completed_requests.begin()); } - bool have_completed_request(tid_t tid, inodeno_t *pcreated) const { - map::const_iterator p = info.completed_requests.find(tid); + bool have_completed_request(ceph_tid_t tid, inodeno_t *pcreated) const { + map::const_iterator p = info.completed_requests.find(tid); if (p == info.completed_requests.end()) return false; if (pcreated) @@ -370,7 +370,7 @@ public: Session *session = get_session(rid.name); return session && session->have_completed_request(rid.tid, NULL); } - void trim_completed_requests(entity_name_t c, tid_t tid) { + void trim_completed_requests(entity_name_t c, ceph_tid_t tid) { Session *session = get_session(c); assert(session); session->trim_completed_requests(tid); diff --git a/src/mds/mdstypes.cc b/src/mds/mdstypes.cc index aadf123ccae06..113cce6b87015 100644 --- a/src/mds/mdstypes.cc +++ b/src/mds/mdstypes.cc @@ -555,7 +555,7 @@ void session_info_t::decode(bufferlist::iterator& p) DECODE_START_LEGACY_COMPAT_LEN(3, 2, 2, p); ::decode(inst, p); if (struct_v <= 2) { - set s; + set s; ::decode(s, p); while (!s.empty()) { completed_requests[*s.begin()] = inodeno_t(); @@ -576,7 +576,7 @@ void session_info_t::dump(Formatter *f) const f->dump_stream("inst") << inst; f->open_array_section("completed_requests"); - for (map::const_iterator p = completed_requests.begin(); + for (map::const_iterator p = completed_requests.begin(); p != completed_requests.end(); ++p) { f->open_object_section("request"); diff --git a/src/mds/mdstypes.h b/src/mds/mdstypes.h index 117a80a8dfc94..184cf70428773 100644 --- a/src/mds/mdstypes.h +++ b/src/mds/mdstypes.h @@ -513,7 +513,7 @@ inline ostream& operator<<(ostream& out, const old_rstat_t& o) { struct session_info_t { entity_inst_t inst; - map completed_requests; + map completed_requests; interval_set prealloc_inos; // preallocated, ready to use. interval_set used_inos; // journaling use @@ -651,7 +651,7 @@ struct metareqid_t { entity_name_t name; uint64_t tid; metareqid_t() : tid(0) {} - metareqid_t(entity_name_t n, tid_t t) : name(n), tid(t) {} + metareqid_t(entity_name_t n, ceph_tid_t t) : name(n), tid(t) {} void encode(bufferlist& bl) const { ::encode(name, bl); ::encode(tid, bl); diff --git a/src/messages/MClientRequest.h b/src/messages/MClientRequest.h index 0c17b16bfba45..c436368b9dc88 100644 --- a/src/messages/MClientRequest.h +++ b/src/messages/MClientRequest.h @@ -110,7 +110,7 @@ public: } // normal fields - void set_oldest_client_tid(tid_t t) { head.oldest_client_tid = t; } + void set_oldest_client_tid(ceph_tid_t t) { head.oldest_client_tid = t; } void inc_num_fwd() { head.num_fwd = head.num_fwd + 1; } void set_retry_attempt(int a) { head.num_retry = a; } void set_filepath(const filepath& fp) { path = fp; } @@ -125,7 +125,7 @@ public: head.flags = head.flags | CEPH_MDS_FLAG_REPLAY; } - tid_t get_oldest_client_tid() const { return head.oldest_client_tid; } + ceph_tid_t get_oldest_client_tid() const { return head.oldest_client_tid; } int get_num_fwd() const { return head.num_fwd; } int get_retry_attempt() const { return head.num_retry; } int get_op() const { return head.op; } diff --git a/src/messages/MClientRequestForward.h b/src/messages/MClientRequestForward.h index e174d83e8e964..976d9dcdd933b 100644 --- a/src/messages/MClientRequestForward.h +++ b/src/messages/MClientRequestForward.h @@ -25,7 +25,7 @@ class MClientRequestForward : public Message { MClientRequestForward() : Message(CEPH_MSG_CLIENT_REQUEST_FORWARD), dest_mds(-1), num_fwd(-1), client_must_resend(false) {} - MClientRequestForward(tid_t t, int dm, int nf, bool cmr) : + MClientRequestForward(ceph_tid_t t, int dm, int nf, bool cmr) : Message(CEPH_MSG_CLIENT_REQUEST_FORWARD), dest_mds(dm), num_fwd(nf), client_must_resend(cmr) { assert(client_must_resend); diff --git a/src/messages/MGetPoolStats.h b/src/messages/MGetPoolStats.h index acf9637e4c516..d004e2968aadc 100644 --- a/src/messages/MGetPoolStats.h +++ b/src/messages/MGetPoolStats.h @@ -26,7 +26,7 @@ public: list pools; MGetPoolStats() : PaxosServiceMessage(MSG_GETPOOLSTATS, 0) {} - MGetPoolStats(const uuid_d& f, tid_t t, list& ls, version_t l) : + MGetPoolStats(const uuid_d& f, ceph_tid_t t, list& ls, version_t l) : PaxosServiceMessage(MSG_GETPOOLSTATS, l), fsid(f), pools(ls) { set_tid(t); diff --git a/src/messages/MGetPoolStatsReply.h b/src/messages/MGetPoolStatsReply.h index 719d5b80e0e53..07b99cffd17b7 100644 --- a/src/messages/MGetPoolStatsReply.h +++ b/src/messages/MGetPoolStatsReply.h @@ -24,7 +24,7 @@ public: map pool_stats; MGetPoolStatsReply() : PaxosServiceMessage(MSG_GETPOOLSTATSREPLY, 0) {} - MGetPoolStatsReply(uuid_d& f, tid_t t, version_t v) : + MGetPoolStatsReply(uuid_d& f, ceph_tid_t t, version_t v) : PaxosServiceMessage(MSG_GETPOOLSTATSREPLY, v), fsid(f) { set_tid(t); diff --git a/src/messages/MMDSFindIno.h b/src/messages/MMDSFindIno.h index d8eddcb49b841..859a7c405f153 100644 --- a/src/messages/MMDSFindIno.h +++ b/src/messages/MMDSFindIno.h @@ -19,11 +19,11 @@ #include "include/filepath.h" struct MMDSFindIno : public Message { - tid_t tid; + ceph_tid_t tid; inodeno_t ino; MMDSFindIno() : Message(MSG_MDS_FINDINO) {} - MMDSFindIno(tid_t t, inodeno_t i) : Message(MSG_MDS_FINDINO), tid(t), ino(i) {} + MMDSFindIno(ceph_tid_t t, inodeno_t i) : Message(MSG_MDS_FINDINO), tid(t), ino(i) {} const char *get_type_name() const { return "findino"; } void print(ostream &out) const { diff --git a/src/messages/MMDSFindInoReply.h b/src/messages/MMDSFindInoReply.h index 3d6ec6c6ce6b5..aaf2a6e7446cc 100644 --- a/src/messages/MMDSFindInoReply.h +++ b/src/messages/MMDSFindInoReply.h @@ -19,11 +19,11 @@ #include "include/filepath.h" struct MMDSFindInoReply : public Message { - tid_t tid; + ceph_tid_t tid; filepath path; MMDSFindInoReply() : Message(MSG_MDS_FINDINOREPLY) {} - MMDSFindInoReply(tid_t t) : Message(MSG_MDS_FINDINOREPLY), tid(t) {} + MMDSFindInoReply(ceph_tid_t t) : Message(MSG_MDS_FINDINOREPLY), tid(t) {} const char *get_type_name() const { return "findinoreply"; } void print(ostream &out) const { diff --git a/src/messages/MMDSOpenIno.h b/src/messages/MMDSOpenIno.h index 0918e87e0d982..a169fd0e79d02 100644 --- a/src/messages/MMDSOpenIno.h +++ b/src/messages/MMDSOpenIno.h @@ -22,7 +22,7 @@ struct MMDSOpenIno : public Message { vector ancestors; MMDSOpenIno() : Message(MSG_MDS_OPENINO) {} - MMDSOpenIno(tid_t t, inodeno_t i, vector& a) : + MMDSOpenIno(ceph_tid_t t, inodeno_t i, vector& a) : Message(MSG_MDS_OPENINO), ino(i), ancestors(a) { header.tid = t; } diff --git a/src/messages/MMDSOpenInoReply.h b/src/messages/MMDSOpenInoReply.h index 245027f11f3a2..5204d3c792b7f 100644 --- a/src/messages/MMDSOpenInoReply.h +++ b/src/messages/MMDSOpenInoReply.h @@ -24,7 +24,7 @@ struct MMDSOpenInoReply : public Message { int32_t error; MMDSOpenInoReply() : Message(MSG_MDS_OPENINOREPLY) {} - MMDSOpenInoReply(tid_t t, inodeno_t i, int h=-1, int e=0) : + MMDSOpenInoReply(ceph_tid_t t, inodeno_t i, int h=-1, int e=0) : Message(MSG_MDS_OPENINOREPLY), ino(i), hint(h), error(e) { header.tid = t; } diff --git a/src/messages/MMonGetVersion.h b/src/messages/MMonGetVersion.h index 14c648184769d..e74daa6519cff 100644 --- a/src/messages/MMonGetVersion.h +++ b/src/messages/MMonGetVersion.h @@ -48,7 +48,7 @@ public: ::decode(what, p); } - tid_t handle; + ceph_tid_t handle; string what; private: diff --git a/src/messages/MMonGetVersionReply.h b/src/messages/MMonGetVersionReply.h index 95e384dbc62b4..b13b2f0098ae9 100644 --- a/src/messages/MMonGetVersionReply.h +++ b/src/messages/MMonGetVersionReply.h @@ -53,7 +53,7 @@ public: ::decode(oldest_version, p); } - tid_t handle; + ceph_tid_t handle; version_t version; version_t oldest_version; diff --git a/src/messages/MOSDOp.h b/src/messages/MOSDOp.h index 7a27838df624a..ed0a669d9195a 100644 --- a/src/messages/MOSDOp.h +++ b/src/messages/MOSDOp.h @@ -74,7 +74,7 @@ public: header.tid); } int get_client_inc() { return client_inc; } - tid_t get_client_tid() { return header.tid; } + ceph_tid_t get_client_tid() { return header.tid; } object_t& get_oid() { return oid; } diff --git a/src/messages/MOSDSubOp.h b/src/messages/MOSDSubOp.h index 9c405e60f3f8e..7c9c5048b2aab 100644 --- a/src/messages/MOSDSubOp.h +++ b/src/messages/MOSDSubOp.h @@ -223,7 +223,7 @@ public: : Message(MSG_OSD_SUBOP, HEAD_VERSION, COMPAT_VERSION) { } MOSDSubOp(osd_reqid_t r, pg_shard_t from, spg_t p, const hobject_t& po, bool noop_, int aw, - epoch_t mape, tid_t rtid, eversion_t v) + epoch_t mape, ceph_tid_t rtid, eversion_t v) : Message(MSG_OSD_SUBOP, HEAD_VERSION, COMPAT_VERSION), map_epoch(mape), reqid(r), diff --git a/src/messages/MPoolOp.h b/src/messages/MPoolOp.h index e6d31ee226b03..d864741204ba7 100644 --- a/src/messages/MPoolOp.h +++ b/src/messages/MPoolOp.h @@ -34,13 +34,13 @@ public: MPoolOp() : PaxosServiceMessage(CEPH_MSG_POOLOP, 0, HEAD_VERSION, COMPAT_VERSION) { } - MPoolOp(const uuid_d& f, tid_t t, int p, string& n, int o, version_t v) + MPoolOp(const uuid_d& f, ceph_tid_t t, int p, string& n, int o, version_t v) : PaxosServiceMessage(CEPH_MSG_POOLOP, v, HEAD_VERSION, COMPAT_VERSION), fsid(f), pool(p), name(n), op(o), auid(0), snapid(0), crush_rule(0) { set_tid(t); } - MPoolOp(const uuid_d& f, tid_t t, int p, string& n, + MPoolOp(const uuid_d& f, ceph_tid_t t, int p, string& n, int o, uint64_t uid, version_t v) : PaxosServiceMessage(CEPH_MSG_POOLOP, v, HEAD_VERSION, COMPAT_VERSION), fsid(f), pool(p), name(n), op(o), diff --git a/src/messages/MPoolOpReply.h b/src/messages/MPoolOpReply.h index 702fdf757d95f..d4fa50a6e023d 100644 --- a/src/messages/MPoolOpReply.h +++ b/src/messages/MPoolOpReply.h @@ -26,14 +26,14 @@ public: MPoolOpReply() : PaxosServiceMessage(CEPH_MSG_POOLOP_REPLY, 0) {} - MPoolOpReply( uuid_d& f, tid_t t, int rc, int e, version_t v) : + MPoolOpReply( uuid_d& f, ceph_tid_t t, int rc, int e, version_t v) : PaxosServiceMessage(CEPH_MSG_POOLOP_REPLY, v), fsid(f), replyCode(rc), epoch(e) { set_tid(t); } - MPoolOpReply( uuid_d& f, tid_t t, int rc, int e, version_t v, + MPoolOpReply( uuid_d& f, ceph_tid_t t, int rc, int e, version_t v, bufferlist *blp) : PaxosServiceMessage(CEPH_MSG_POOLOP_REPLY, v), fsid(f), diff --git a/src/messages/MStatfs.h b/src/messages/MStatfs.h index 61370a943442d..ec19f6ee58525 100644 --- a/src/messages/MStatfs.h +++ b/src/messages/MStatfs.h @@ -24,7 +24,7 @@ public: uuid_d fsid; MStatfs() : PaxosServiceMessage(CEPH_MSG_STATFS, 0) {} - MStatfs(const uuid_d& f, tid_t t, version_t v) : + MStatfs(const uuid_d& f, ceph_tid_t t, version_t v) : PaxosServiceMessage(CEPH_MSG_STATFS, v), fsid(f) { set_tid(t); } diff --git a/src/messages/MStatfsReply.h b/src/messages/MStatfsReply.h index 8ceec9c7b10ee..6bf42d894d73a 100644 --- a/src/messages/MStatfsReply.h +++ b/src/messages/MStatfsReply.h @@ -21,7 +21,7 @@ public: struct ceph_mon_statfs_reply h; MStatfsReply() : Message(CEPH_MSG_STATFS_REPLY) {} - MStatfsReply(uuid_d &f, tid_t t, epoch_t epoch) : Message(CEPH_MSG_STATFS_REPLY) { + MStatfsReply(uuid_d &f, ceph_tid_t t, epoch_t epoch) : Message(CEPH_MSG_STATFS_REPLY) { memcpy(&h.fsid, f.uuid, sizeof(h.fsid)); header.tid = t; h.version = epoch; diff --git a/src/mon/MonClient.cc b/src/mon/MonClient.cc index 25dd3cdfe3678..f494242e6df2d 100644 --- a/src/mon/MonClient.cc +++ b/src/mon/MonClient.cc @@ -914,7 +914,7 @@ int MonClient::_cancel_mon_command(uint64_t tid, int r) { assert(monc_lock.is_locked()); - map::iterator it = mon_commands.find(tid); + map::iterator it = mon_commands.find(tid); if (it == mon_commands.end()) { ldout(cct, 10) << __func__ << " tid " << tid << " dne" << dendl; return -ENOENT; @@ -1018,7 +1018,7 @@ void MonClient::get_version(string map, version_t *newest, version_t *oldest, Co void MonClient::handle_get_version_reply(MMonGetVersionReply* m) { assert(monc_lock.is_locked()); - map::iterator iter = version_requests.find(m->handle); + map::iterator iter = version_requests.find(m->handle); if (iter == version_requests.end()) { ldout(cct, 0) << __func__ << " version request with handle " << m->handle << " not found" << dendl; diff --git a/src/mon/MonClient.h b/src/mon/MonClient.h index a2998bb60c7a9..239d91b45872a 100644 --- a/src/mon/MonClient.h +++ b/src/mon/MonClient.h @@ -434,8 +434,8 @@ private: version_req_d(Context *con, version_t *n, version_t *o) : context(con),newest(n), oldest(o) {} }; - map version_requests; - tid_t version_req_id; + map version_requests; + ceph_tid_t version_req_id; void handle_get_version_reply(MMonGetVersionReply* m); diff --git a/src/msg/Message.h b/src/msg/Message.h index 740be7be716c3..3a833726ac322 100644 --- a/src/msg/Message.h +++ b/src/msg/Message.h @@ -184,7 +184,7 @@ public: bool failed; /// true if we are a lossy connection that has failed. int rx_buffers_version; - map > rx_buffers; + map > rx_buffers; friend class boost::intrusive_ptr; @@ -284,12 +284,12 @@ public: void set_features(uint64_t f) { features = f; } void set_feature(uint64_t f) { features |= f; } - void post_rx_buffer(tid_t tid, bufferlist& bl) { + void post_rx_buffer(ceph_tid_t tid, bufferlist& bl) { Mutex::Locker l(lock); ++rx_buffers_version; rx_buffers[tid] = pair(bl, rx_buffers_version); } - void revoke_rx_buffer(tid_t tid) { + void revoke_rx_buffer(ceph_tid_t tid) { Mutex::Locker l(lock); rx_buffers.erase(tid); } diff --git a/src/msg/Pipe.cc b/src/msg/Pipe.cc index 9020888a2ffd8..ea76cd712dea9 100644 --- a/src/msg/Pipe.cc +++ b/src/msg/Pipe.cc @@ -1827,7 +1827,7 @@ int Pipe::read_message(Message **pm) // get a buffer connection_state->lock.Lock(); - map >::iterator p = connection_state->rx_buffers.find(header.tid); + map >::iterator p = connection_state->rx_buffers.find(header.tid); if (p != connection_state->rx_buffers.end()) { if (rxbuf.length() == 0 || p->second.second != rxbuf_version) { ldout(msgr->cct,10) << "reader seleting rx buffer v " << p->second.second diff --git a/src/osd/ECBackend.cc b/src/osd/ECBackend.cc index 0751071bd5e8f..dc2a26fb61924 100644 --- a/src/osd/ECBackend.cc +++ b/src/osd/ECBackend.cc @@ -703,13 +703,13 @@ bool ECBackend::handle_message( struct SubWriteCommitted : public Context { ECBackend *pg; OpRequestRef msg; - tid_t tid; + ceph_tid_t tid; eversion_t version; eversion_t last_complete; SubWriteCommitted( ECBackend *pg, OpRequestRef msg, - tid_t tid, + ceph_tid_t tid, eversion_t version, eversion_t last_complete) : pg(pg), msg(msg), tid(tid), @@ -721,7 +721,7 @@ struct SubWriteCommitted : public Context { } }; void ECBackend::sub_write_committed( - tid_t tid, eversion_t version, eversion_t last_complete) { + ceph_tid_t tid, eversion_t version, eversion_t last_complete) { if (get_parent()->pgb_is_primary()) { ECSubWriteReply reply; reply.tid = tid; @@ -748,12 +748,12 @@ void ECBackend::sub_write_committed( struct SubWriteApplied : public Context { ECBackend *pg; OpRequestRef msg; - tid_t tid; + ceph_tid_t tid; eversion_t version; SubWriteApplied( ECBackend *pg, OpRequestRef msg, - tid_t tid, + ceph_tid_t tid, eversion_t version) : pg(pg), msg(msg), tid(tid), version(version) {} void finish(int) { @@ -763,7 +763,7 @@ struct SubWriteApplied : public Context { } }; void ECBackend::sub_write_applied( - tid_t tid, eversion_t version) { + ceph_tid_t tid, eversion_t version) { parent->op_applied(version); if (get_parent()->pgb_is_primary()) { ECSubWriteReply reply; @@ -901,7 +901,7 @@ void ECBackend::handle_sub_write_reply( pg_shard_t from, ECSubWriteReply &op) { - map::iterator i = tid_to_op_map.find(op.tid); + map::iterator i = tid_to_op_map.find(op.tid); assert(i != tid_to_op_map.end()); if (op.committed) { assert(i->second.pending_commit.count(from)); @@ -923,7 +923,7 @@ void ECBackend::handle_sub_read_reply( RecoveryMessages *m) { dout(10) << __func__ << ": reply " << op << dendl; - map::iterator iter = tid_to_read_map.find(op.tid); + map::iterator iter = tid_to_read_map.find(op.tid); if (iter == tid_to_read_map.end()) { //canceled return; @@ -978,7 +978,8 @@ void ECBackend::handle_sub_read_reply( rop.complete[i->first].r = i->second; } - map >::iterator siter = shard_to_read_map.find(from); + map >::iterator siter = +shard_to_read_map.find(from); assert(siter != shard_to_read_map.end()); assert(siter->second.count(op.tid)); siter->second.erase(op.tid); @@ -1013,8 +1014,8 @@ void ECBackend::complete_read_op(ReadOp &rop, RecoveryMessages *m) struct FinishReadOp : public GenContext { ECBackend *ec; - tid_t tid; - FinishReadOp(ECBackend *ec, tid_t tid) : ec(ec), tid(tid) {} + ceph_tid_t tid; + FinishReadOp(ECBackend *ec, ceph_tid_t tid) : ec(ec), tid(tid) {} void finish(ThreadPool::TPHandle &handle) { assert(ec->tid_to_read_map.count(tid)); int priority = ec->tid_to_read_map[tid].priority; @@ -1088,8 +1089,9 @@ void ECBackend::filter_read_op( void ECBackend::check_recovery_sources(const OSDMapRef osdmap) { - set tids_to_filter; - for (map >::iterator i = shard_to_read_map.begin(); + set tids_to_filter; + for (map >::iterator + i = shard_to_read_map.begin(); i != shard_to_read_map.end(); ) { if (osdmap->is_down(i->first.osd)) { @@ -1099,10 +1101,10 @@ void ECBackend::check_recovery_sources(const OSDMapRef osdmap) ++i; } } - for (set::iterator i = tids_to_filter.begin(); + for (set::iterator i = tids_to_filter.begin(); i != tids_to_filter.end(); ++i) { - map::iterator j = tid_to_read_map.find(*i); + map::iterator j = tid_to_read_map.find(*i); assert(j != tid_to_read_map.end()); filter_read_op(osdmap, j->second); } @@ -1112,7 +1114,7 @@ void ECBackend::_on_change(ObjectStore::Transaction *t) { writing.clear(); tid_to_op_map.clear(); - for (map::iterator i = tid_to_read_map.begin(); + for (map::iterator i = tid_to_read_map.begin(); i != tid_to_read_map.end(); ++i) { dout(10) << __func__ << ": cancelling " << i->second << dendl; @@ -1157,7 +1159,7 @@ void ECBackend::dump_recovery_info(Formatter *f) const } f->close_section(); f->open_array_section("read_ops"); - for (map::const_iterator i = tid_to_read_map.begin(); + for (map::const_iterator i = tid_to_read_map.begin(); i != tid_to_read_map.end(); ++i) { f->open_object_section("read_op"); @@ -1202,7 +1204,7 @@ void ECBackend::submit_transaction( Context *on_local_applied_sync, Context *on_all_applied, Context *on_all_commit, - tid_t tid, + ceph_tid_t tid, osd_reqid_t reqid, OpRequestRef client_op ) @@ -1343,7 +1345,7 @@ void ECBackend::start_read_op( map &to_read, OpRequestRef _op) { - tid_t tid = get_parent()->get_tid(); + ceph_tid_t tid = get_parent()->get_tid(); assert(!tid_to_read_map.count(tid)); ReadOp &op(tid_to_read_map[tid]); op.priority = priority; @@ -1467,7 +1469,7 @@ void ECBackend::check_op(Op *op) writing.pop_front(); tid_to_op_map.erase(op->tid); } - for (map::iterator i = tid_to_op_map.begin(); + for (map::iterator i = tid_to_op_map.begin(); i != tid_to_op_map.end(); ++i) { dout(20) << __func__ << " tid " << i->first <<": " << i->second << dendl; diff --git a/src/osd/ECBackend.h b/src/osd/ECBackend.h index 784456342ed52..0aa37c154fa30 100644 --- a/src/osd/ECBackend.h +++ b/src/osd/ECBackend.h @@ -55,9 +55,9 @@ public: friend struct SubWriteApplied; friend struct SubWriteCommitted; void sub_write_applied( - tid_t tid, eversion_t version); + ceph_tid_t tid, eversion_t version); void sub_write_committed( - tid_t tid, eversion_t version, eversion_t last_complete); + ceph_tid_t tid, eversion_t version, eversion_t last_complete); void handle_sub_write( pg_shard_t from, OpRequestRef msg, @@ -101,7 +101,7 @@ public: Context *on_local_applied_sync, Context *on_all_applied, Context *on_all_commit, - tid_t tid, + ceph_tid_t tid, osd_reqid_t reqid, OpRequestRef op ); @@ -281,7 +281,7 @@ public: struct ReadOp { int priority; - tid_t tid; + ceph_tid_t tid; OpRequestRef op; // may be null if not on behalf of a client map to_read; @@ -300,8 +300,8 @@ public: ReadOp &op); void complete_read_op(ReadOp &rop, RecoveryMessages *m); friend ostream &operator<<(ostream &lhs, const ReadOp &rhs); - map tid_to_read_map; - map > shard_to_read_map; + map tid_to_read_map; + map > shard_to_read_map; void start_read_op( int priority, map &to_read, @@ -329,7 +329,7 @@ public: Context *on_local_applied_sync; Context *on_all_applied; Context *on_all_commit; - tid_t tid; + ceph_tid_t tid; osd_reqid_t reqid; OpRequestRef client_op; @@ -370,7 +370,7 @@ public: pg_shard_t from, RecoveryMessages *m); - map tid_to_op_map; /// lists below point into here + map tid_to_op_map; /// lists below point into here list writing; CephContext *cct; diff --git a/src/osd/ECMsgTypes.h b/src/osd/ECMsgTypes.h index 2283dbba35b34..d1ad2cba8f3d5 100644 --- a/src/osd/ECMsgTypes.h +++ b/src/osd/ECMsgTypes.h @@ -21,7 +21,7 @@ struct ECSubWrite { pg_shard_t from; - tid_t tid; + ceph_tid_t tid; osd_reqid_t reqid; hobject_t soid; pg_stat_t stats; @@ -34,7 +34,7 @@ struct ECSubWrite { ECSubWrite() {} ECSubWrite( pg_shard_t from, - tid_t tid, + ceph_tid_t tid, osd_reqid_t reqid, hobject_t soid, const pg_stat_t &stats, @@ -59,7 +59,7 @@ WRITE_CLASS_ENCODER(ECSubWrite) struct ECSubWriteReply { pg_shard_t from; - tid_t tid; + ceph_tid_t tid; eversion_t last_complete; bool committed; bool applied; @@ -73,7 +73,7 @@ WRITE_CLASS_ENCODER(ECSubWriteReply) struct ECSubRead { pg_shard_t from; - tid_t tid; + ceph_tid_t tid; map > > to_read; set attrs_to_read; void encode(bufferlist &bl) const; @@ -85,7 +85,7 @@ WRITE_CLASS_ENCODER(ECSubRead) struct ECSubReadReply { pg_shard_t from; - tid_t tid; + ceph_tid_t tid; map > > buffers_read; map > attrs_read; map errors; diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 60a54a620b91a..e5d0449d74d70 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -4168,7 +4168,7 @@ COMMAND("reset_pg_recovery_stats", "reset pg recovery statistics", "osd", "rw", "cli,rest") }; -void OSD::do_command(Connection *con, tid_t tid, vector& cmd, bufferlist& data) +void OSD::do_command(Connection *con, ceph_tid_t tid, vector& cmd, bufferlist& data) { int r = 0; stringstream ss, ds; diff --git a/src/osd/OSD.h b/src/osd/OSD.h index 7ee3442793c7c..c753b931e6a91 100644 --- a/src/osd/OSD.h +++ b/src/osd/OSD.h @@ -580,10 +580,10 @@ public: // -- tids -- // for ops i issue - tid_t last_tid; + ceph_tid_t last_tid; Mutex tid_lock; - tid_t get_tid() { - tid_t t; + ceph_tid_t get_tid() { + ceph_tid_t t; tid_lock.Lock(); t = ++last_tid; tid_lock.Unlock(); @@ -1485,7 +1485,7 @@ protected: pg_stat_queue_lock.Unlock(); } - tid_t get_tid() { + ceph_tid_t get_tid() { return service.get_tid(); } @@ -1530,11 +1530,11 @@ protected: // -- commands -- struct Command { vector cmd; - tid_t tid; + ceph_tid_t tid; bufferlist indata; ConnectionRef con; - Command(vector& c, tid_t t, bufferlist& bl, Connection *co) + Command(vector& c, ceph_tid_t t, bufferlist& bl, Connection *co) : cmd(c), tid(t), indata(bl), con(co) {} }; list command_queue; @@ -1582,7 +1582,7 @@ protected: void handle_command(class MMonCommand *m); void handle_command(class MCommand *m); - void do_command(Connection *con, tid_t tid, vector& cmd, bufferlist& data); + void do_command(Connection *con, ceph_tid_t tid, vector& cmd, bufferlist& data); // -- pg recovery -- xlist recovery_queue; diff --git a/src/osd/OpRequest.h b/src/osd/OpRequest.h index 7e07340d0fa29..569b6fc581ea3 100644 --- a/src/osd/OpRequest.h +++ b/src/osd/OpRequest.h @@ -31,12 +31,12 @@ */ struct osd_reqid_t { entity_name_t name; // who - tid_t tid; + ceph_tid_t tid; int32_t inc; // incarnation osd_reqid_t() : tid(0), inc(0) {} - osd_reqid_t(const entity_name_t& a, int i, tid_t t) + osd_reqid_t(const entity_name_t& a, int i, ceph_tid_t t) : name(a), tid(t), inc(i) {} void encode(bufferlist &bl) const; diff --git a/src/osd/PGBackend.h b/src/osd/PGBackend.h index f3dc0ad970c5c..88ce4345797b5 100644 --- a/src/osd/PGBackend.h +++ b/src/osd/PGBackend.h @@ -213,7 +213,7 @@ virtual PerfCounters *get_logger() = 0; - virtual tid_t get_tid() = 0; + virtual ceph_tid_t get_tid() = 0; virtual LogClientTemp clog_error() = 0; @@ -492,9 +492,9 @@ const eversion_t &trim_to, ///< [in] trim log to here vector &log_entries, ///< [in] log entries for t Context *on_local_applied_sync, ///< [in] called when applied locally - Context *on_all_applied, ///< [in] called when all acked + Context *on_all_applied, ///< [in] called when all acked Context *on_all_commit, ///< [in] called when all commit - tid_t tid, ///< [in] tid + ceph_tid_t tid, ///< [in] tid osd_reqid_t reqid, ///< [in] reqid OpRequestRef op ///< [in] op ) = 0; diff --git a/src/osd/ReplicatedBackend.cc b/src/osd/ReplicatedBackend.cc index 5a9e8144328ef..8856461a8bc92 100644 --- a/src/osd/ReplicatedBackend.cc +++ b/src/osd/ReplicatedBackend.cc @@ -194,7 +194,7 @@ void ReplicatedBackend::clear_state() void ReplicatedBackend::_on_change(ObjectStore::Transaction *t) { - for (map::iterator i = in_progress_ops.begin(); + for (map::iterator i = in_progress_ops.begin(); i != in_progress_ops.end(); in_progress_ops.erase(i++)) { if (i->second.on_commit) @@ -497,7 +497,7 @@ void ReplicatedBackend::submit_transaction( Context *on_local_applied_sync, Context *on_all_acked, Context *on_all_commit, - tid_t tid, + ceph_tid_t tid, osd_reqid_t reqid, OpRequestRef orig_op) { @@ -611,11 +611,11 @@ void ReplicatedBackend::sub_op_modify_reply(OpRequestRef op) op->mark_started(); // must be replication. - tid_t rep_tid = r->get_tid(); + ceph_tid_t rep_tid = r->get_tid(); pg_shard_t from = r->from; if (in_progress_ops.count(rep_tid)) { - map::iterator iter = + map::iterator iter = in_progress_ops.find(rep_tid); InProgressOp &ip_op = iter->second; MOSDOp *m = NULL; diff --git a/src/osd/ReplicatedBackend.h b/src/osd/ReplicatedBackend.h index 64e91a69d2838..cfad2edae6a41 100644 --- a/src/osd/ReplicatedBackend.h +++ b/src/osd/ReplicatedBackend.h @@ -315,7 +315,7 @@ private: * Client IO */ struct InProgressOp { - tid_t tid; + ceph_tid_t tid; set waiting_for_commit; set waiting_for_applied; Context *on_commit; @@ -323,7 +323,7 @@ private: OpRequestRef op; eversion_t v; InProgressOp( - tid_t tid, Context *on_commit, Context *on_applied, + ceph_tid_t tid, Context *on_commit, Context *on_applied, OpRequestRef op, eversion_t v) : tid(tid), on_commit(on_commit), on_applied(on_applied), op(op), v(v) {} @@ -332,7 +332,7 @@ private: waiting_for_applied.empty(); } }; - map in_progress_ops; + map in_progress_ops; public: PGTransaction *get_transaction(); friend class C_OSD_OnOpCommit; @@ -346,7 +346,7 @@ public: Context *on_local_applied_sync, Context *on_all_applied, Context *on_all_commit, - tid_t tid, + ceph_tid_t tid, osd_reqid_t reqid, OpRequestRef op ); @@ -355,7 +355,7 @@ private: void issue_op( const hobject_t &soid, const eversion_t &at_version, - tid_t tid, + ceph_tid_t tid, osd_reqid_t reqid, eversion_t pg_trim_to, hobject_t new_temp_oid, diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index b957b3504947d..6d962a54e94ee 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -1776,10 +1776,10 @@ void ReplicatedPG::execute_ctx(OpContext *ctx) // verify that we are doing this in order? if (cct->_conf->osd_debug_op_order && m->get_source().is_client()) { - map& cm = debug_op_order[obc->obs.oi.soid]; - tid_t t = m->get_tid(); + map& cm = debug_op_order[obc->obs.oi.soid]; + ceph_tid_t t = m->get_tid(); client_t n = m->get_source().num(); - map::iterator p = cm.find(n); + map::iterator p = cm.find(n); if (p == cm.end()) { dout(20) << " op order client." << n << " tid " << t << " (first)" << dendl; cm[n] = t; @@ -1794,7 +1794,7 @@ void ReplicatedPG::execute_ctx(OpContext *ctx) } // issue replica writes - tid_t rep_tid = osd->get_tid(); + ceph_tid_t rep_tid = osd->get_tid(); RepGather *repop = new_repop(ctx, obc, rep_tid); // new repop claims our obc, src_obc refs // note: repop now owns ctx AND ctx->op @@ -5185,7 +5185,7 @@ struct C_Copyfrom : public Context { ReplicatedPGRef pg; hobject_t oid; epoch_t last_peering_reset; - tid_t tid; + ceph_tid_t tid; C_Copyfrom(ReplicatedPG *p, hobject_t o, epoch_t lpr) : pg(p), oid(o), last_peering_reset(lpr), tid(0) @@ -5403,7 +5403,7 @@ void ReplicatedPG::_copy_some(ObjectContextRef obc, CopyOpRef cop) ObjectOperation op; op.list_snaps(&cop->results.snapset, NULL); osd->objecter_lock.Lock(); - tid_t tid = osd->objecter->read(cop->src.oid, cop->oloc, op, + ceph_tid_t tid = osd->objecter->read(cop->src.oid, cop->oloc, op, CEPH_SNAPDIR, NULL, flags, gather.new_sub(), NULL); cop->objecter_tid2 = tid; @@ -5431,7 +5431,7 @@ void ReplicatedPG::_copy_some(ObjectContextRef obc, CopyOpRef cop) &osd->objecter_finisher)); osd->objecter_lock.Lock(); - tid_t tid = osd->objecter->read(cop->src.oid, cop->oloc, op, + ceph_tid_t tid = osd->objecter->read(cop->src.oid, cop->oloc, op, cop->src.snap, NULL, flags, gather.new_sub(), @@ -5443,7 +5443,7 @@ void ReplicatedPG::_copy_some(ObjectContextRef obc, CopyOpRef cop) osd->objecter_lock.Unlock(); } -void ReplicatedPG::process_copy_chunk(hobject_t oid, tid_t tid, int r) +void ReplicatedPG::process_copy_chunk(hobject_t oid, ceph_tid_t tid, int r) { dout(10) << __func__ << " " << oid << " tid " << tid << " " << cpp_strerror(r) << dendl; @@ -5855,7 +5855,7 @@ struct C_Flush : public Context { ReplicatedPGRef pg; hobject_t oid; epoch_t last_peering_reset; - tid_t tid; + ceph_tid_t tid; C_Flush(ReplicatedPG *p, hobject_t o, epoch_t lpr) : pg(p), oid(o), last_peering_reset(lpr), tid(0) @@ -5982,7 +5982,7 @@ int ReplicatedPG::start_flush(OpContext *ctx, bool blocking) } osd->objecter_lock.Lock(); - tid_t tid = osd->objecter->mutate(soid.oid, base_oloc, o, snapc, oi.mtime, + ceph_tid_t tid = osd->objecter->mutate(soid.oid, base_oloc, o, snapc, oi.mtime, CEPH_OSD_FLAG_IGNORE_OVERLAY, NULL, new C_OnFinisher(fin, @@ -5995,7 +5995,7 @@ int ReplicatedPG::start_flush(OpContext *ctx, bool blocking) return -EINPROGRESS; } -void ReplicatedPG::finish_flush(hobject_t oid, tid_t tid, int r) +void ReplicatedPG::finish_flush(hobject_t oid, ceph_tid_t tid, int r) { dout(10) << __func__ << " " << oid << " tid " << tid << " " << cpp_strerror(r) << dendl; @@ -6091,7 +6091,7 @@ int ReplicatedPG::try_flush_mark_clean(FlushOpRef fop) } dout(10) << __func__ << " clearing DIRTY flag for " << oid << dendl; - tid_t rep_tid = osd->get_tid(); + ceph_tid_t rep_tid = osd->get_tid(); RepGather *repop = new_repop(fop->ctx, obc, rep_tid); OpContext *ctx = fop->ctx; if (!fop->blocking) { @@ -6452,7 +6452,7 @@ void ReplicatedPG::issue_repop(RepGather *repop, utime_t now) void ReplicatedBackend::issue_op( const hobject_t &soid, const eversion_t &at_version, - tid_t tid, + ceph_tid_t tid, osd_reqid_t reqid, eversion_t pg_trim_to, hobject_t new_temp_oid, @@ -6519,7 +6519,7 @@ void ReplicatedBackend::issue_op( } ReplicatedPG::RepGather *ReplicatedPG::new_repop(OpContext *ctx, ObjectContextRef obc, - tid_t rep_tid) + ceph_tid_t rep_tid) { if (ctx->op) dout(10) << "new_repop rep_tid " << rep_tid << " on " << *ctx->op->get_req() << dendl; @@ -6554,7 +6554,7 @@ ReplicatedPG::RepGather *ReplicatedPG::simple_repop_create(ObjectContextRef obc) { dout(20) << __func__ << " " << obc->obs.oi.soid << dendl; vector ops; - tid_t rep_tid = osd->get_tid(); + ceph_tid_t rep_tid = osd->get_tid(); osd_reqid_t reqid(osd->get_cluster_msgr_name(), 0, rep_tid); OpContext *ctx = new OpContext(OpRequestRef(), reqid, ops, &obc->obs, obc->ssc, this); @@ -6698,7 +6698,7 @@ void ReplicatedPG::handle_watch_timeout(WatchRef watch) watch->remove(); vector ops; - tid_t rep_tid = osd->get_tid(); + ceph_tid_t rep_tid = osd->get_tid(); osd_reqid_t reqid(osd->get_cluster_msgr_name(), 0, rep_tid); OpContext *ctx = new OpContext(OpRequestRef(), reqid, ops, &obc->obs, obc->ssc, this); @@ -7609,7 +7609,7 @@ int ReplicatedPG::recover_missing( void ReplicatedPG::send_remove_op( const hobject_t& oid, eversion_t v, pg_shard_t peer) { - tid_t tid = osd->get_tid(); + ceph_tid_t tid = osd->get_tid(); osd_reqid_t rid(osd->get_cluster_msgr_name(), 0, tid); dout(10) << "send_remove_op " << oid << " from osd." << peer @@ -7742,7 +7742,7 @@ int ReplicatedBackend::send_pull_legacy(int prio, pg_shard_t peer, ObjectRecoveryProgress progress) { // send op - tid_t tid = get_parent()->get_tid(); + ceph_tid_t tid = get_parent()->get_tid(); osd_reqid_t rid(get_parent()->get_cluster_msgr_name(), 0, tid); dout(10) << "send_pull_op " << recovery_info.soid << " " @@ -8194,7 +8194,7 @@ int ReplicatedBackend::build_push_op(const ObjectRecoveryInfo &recovery_info, int ReplicatedBackend::send_push_op_legacy(int prio, pg_shard_t peer, PushOp &pop) { - tid_t tid = get_parent()->get_tid(); + ceph_tid_t tid = get_parent()->get_tid(); osd_reqid_t rid(get_parent()->get_cluster_msgr_name(), 0, tid); MOSDSubOp *subop = new MOSDSubOp( rid, parent->whoami_shard(), @@ -10750,7 +10750,7 @@ bool ReplicatedPG::agent_maybe_flush(ObjectContextRef& obc) // ages we expect. vector ops; - tid_t rep_tid = osd->get_tid(); + ceph_tid_t rep_tid = osd->get_tid(); osd_reqid_t reqid(osd->get_cluster_msgr_name(), 0, rep_tid); OpContext *ctx = new OpContext(OpRequestRef(), reqid, ops, &obc->obs, obc->ssc, this); diff --git a/src/osd/ReplicatedPG.h b/src/osd/ReplicatedPG.h index 52a77174c0feb..925d581054ee6 100644 --- a/src/osd/ReplicatedPG.h +++ b/src/osd/ReplicatedPG.h @@ -138,8 +138,8 @@ public: CopyResults results; - tid_t objecter_tid; - tid_t objecter_tid2; + ceph_tid_t objecter_tid; + ceph_tid_t objecter_tid2; object_copy_cursor_t cursor; map attrs; @@ -199,7 +199,7 @@ public: OpContext *ctx; ///< the parent OpContext list dup_ops; ///< dup flush requests version_t flushed_version; ///< user version we are flushing - tid_t objecter_tid; ///< copy-from request tid + ceph_tid_t objecter_tid; ///< copy-from request tid int rval; ///< copy-from result bool blocking; ///< whether we are blocking updates bool removal; ///< we are removing the backend object @@ -400,7 +400,7 @@ public: PerfCounters *get_logger(); - tid_t get_tid() { return osd->get_tid(); } + ceph_tid_t get_tid() { return osd->get_tid(); } LogClientTemp clog_error() { return osd->clog.error(); } @@ -585,7 +585,7 @@ public: ObjectContextRef obc; map src_obc; - tid_t rep_tid; + ceph_tid_t rep_tid; bool rep_aborted, rep_done; @@ -603,7 +603,7 @@ public: Context *on_applied; - RepGather(OpContext *c, ObjectContextRef pi, tid_t rt, + RepGather(OpContext *c, ObjectContextRef pi, ceph_tid_t rt, eversion_t lc) : queue_item(this), nref(1), @@ -710,7 +710,7 @@ protected: // replica ops // [primary|tail] xlist repop_queue; - map repop_map; + map repop_map; friend class C_OSD_RepopApplied; friend class C_OSD_RepopCommit; @@ -718,7 +718,7 @@ protected: void repop_all_committed(RepGather *repop); void eval_repop(RepGather*); void issue_repop(RepGather *repop, utime_t now); - RepGather *new_repop(OpContext *ctx, ObjectContextRef obc, tid_t rep_tid); + RepGather *new_repop(OpContext *ctx, ObjectContextRef obc, ceph_tid_t rep_tid); void remove_repop(RepGather *repop); RepGather *simple_repop_create(ObjectContextRef obc); @@ -809,7 +809,7 @@ protected: Mutex snapset_contexts_lock; // debug order that client ops are applied - map > debug_op_order; + map > debug_op_order; void populate_obc_watchers(ObjectContextRef obc); void check_blacklisted_obc_watchers(ObjectContextRef obc); @@ -1136,7 +1136,7 @@ protected: void start_copy(CopyCallback *cb, ObjectContextRef obc, hobject_t src, object_locator_t oloc, version_t version, unsigned flags, bool mirror_snapset); - void process_copy_chunk(hobject_t oid, tid_t tid, int r); + void process_copy_chunk(hobject_t oid, ceph_tid_t tid, int r); void _write_copy_chunk(CopyOpRef cop, PGBackend::PGTransaction *t); uint64_t get_copy_chunk_size() const { uint64_t size = cct->_conf->osd_copyfrom_max_chunk; @@ -1163,7 +1163,7 @@ protected: map flush_ops; int start_flush(OpContext *ctx, bool blocking); - void finish_flush(hobject_t oid, tid_t tid, int r); + void finish_flush(hobject_t oid, ceph_tid_t tid, int r); int try_flush_mark_clean(FlushOpRef fop); void cancel_flush(FlushOpRef fop, bool requeue); void cancel_flush_ops(bool requeue); diff --git a/src/osdc/ObjectCacher.cc b/src/osdc/ObjectCacher.cc index 29dcaaaba5fd0..eaa7c52e2c2d7 100644 --- a/src/osdc/ObjectCacher.cc +++ b/src/osdc/ObjectCacher.cc @@ -625,7 +625,7 @@ void ObjectCacher::bh_read(BufferHead *bh) ++reads_outstanding; } -void ObjectCacher::bh_read_finish(int64_t poolid, sobject_t oid, tid_t tid, +void ObjectCacher::bh_read_finish(int64_t poolid, sobject_t oid, ceph_tid_t tid, loff_t start, uint64_t length, bufferlist &bl, int r, bool trust_enoent) @@ -810,7 +810,7 @@ void ObjectCacher::bh_write(BufferHead *bh) C_WriteCommit *oncommit = new C_WriteCommit(this, bh->ob->oloc.pool, bh->ob->get_soid(), bh->start(), bh->length()); // go - tid_t tid = writeback_handler.write(bh->ob->get_oid(), bh->ob->get_oloc(), + ceph_tid_t tid = writeback_handler.write(bh->ob->get_oid(), bh->ob->get_oloc(), bh->start(), bh->length(), bh->snapc, bh->bl, bh->last_write, bh->ob->truncate_size, bh->ob->truncate_seq, @@ -830,7 +830,7 @@ void ObjectCacher::bh_write(BufferHead *bh) } void ObjectCacher::bh_write_commit(int64_t poolid, sobject_t oid, loff_t start, - uint64_t length, tid_t tid, int r) + uint64_t length, ceph_tid_t tid, int r) { assert(lock.is_locked()); ldout(cct, 7) << "bh_write_commit " diff --git a/src/osdc/ObjectCacher.h b/src/osdc/ObjectCacher.h index 54f028fdd7430..01d18cececc8f 100644 --- a/src/osdc/ObjectCacher.h +++ b/src/osdc/ObjectCacher.h @@ -103,8 +103,8 @@ class ObjectCacher { public: Object *ob; bufferlist bl; - tid_t last_write_tid; // version of bh (if non-zero) - tid_t last_read_tid; // tid of last read op (if any) + ceph_tid_t last_write_tid; // version of bh (if non-zero) + ceph_tid_t last_read_tid; // tid of last read op (if any) utime_t last_write; SnapContext snapc; int error; // holds return value for failed reads @@ -181,12 +181,12 @@ class ObjectCacher { public: map data; - tid_t last_write_tid; // version of bh (if non-zero) - tid_t last_commit_tid; // last update commited. + ceph_tid_t last_write_tid; // version of bh (if non-zero) + ceph_tid_t last_commit_tid; // last update commited. int dirty_or_tx; - map< tid_t, list > waitfor_commit; + map< ceph_tid_t, list > waitfor_commit; xlist reads; public: @@ -341,7 +341,7 @@ class ObjectCacher { vector > objects; // indexed by pool_id - tid_t last_read_tid; + ceph_tid_t last_read_tid; set dirty_bh; LRU bh_lru_dirty, bh_lru_rest; @@ -459,12 +459,12 @@ class ObjectCacher { bool external_call); public: - void bh_read_finish(int64_t poolid, sobject_t oid, tid_t tid, + void bh_read_finish(int64_t poolid, sobject_t oid, ceph_tid_t tid, loff_t offset, uint64_t length, bufferlist &bl, int r, bool trust_enoent); void bh_write_commit(int64_t poolid, sobject_t oid, loff_t offset, - uint64_t length, tid_t t, int r); + uint64_t length, ceph_tid_t t, int r); class C_ReadFinish : public Context { ObjectCacher *oc; @@ -474,11 +474,11 @@ class ObjectCacher { uint64_t length; xlist::item set_item; bool trust_enoent; - tid_t tid; + ceph_tid_t tid; public: bufferlist bl; - C_ReadFinish(ObjectCacher *c, Object *ob, tid_t t, loff_t s, uint64_t l) : + C_ReadFinish(ObjectCacher *c, Object *ob, ceph_tid_t t, loff_t s, uint64_t l) : oc(c), poolid(ob->oloc.pool), oid(ob->get_soid()), start(s), length(l), set_item(this), trust_enoent(true), tid(t) { @@ -505,7 +505,7 @@ class ObjectCacher { loff_t start; uint64_t length; public: - tid_t tid; + ceph_tid_t tid; C_WriteCommit(ObjectCacher *c, int64_t _poolid, sobject_t o, loff_t s, uint64_t l) : oc(c), poolid(_poolid), oid(o), start(s), length(l), tid(0) {} void finish(int r) { diff --git a/src/osdc/Objecter.cc b/src/osdc/Objecter.cc index a2954662605cf..6018f1102ad5f 100644 --- a/src/osdc/Objecter.cc +++ b/src/osdc/Objecter.cc @@ -383,7 +383,7 @@ void Objecter::unregister_linger(uint64_t linger_id) } } -tid_t Objecter::linger_mutate(const object_t& oid, const object_locator_t& oloc, +ceph_tid_t Objecter::linger_mutate(const object_t& oid, const object_locator_t& oloc, ObjectOperation& op, const SnapContext& snapc, utime_t mtime, bufferlist& inbl, int flags, @@ -415,7 +415,7 @@ tid_t Objecter::linger_mutate(const object_t& oid, const object_locator_t& oloc, return info->linger_id; } -tid_t Objecter::linger_read(const object_t& oid, const object_locator_t& oloc, +ceph_tid_t Objecter::linger_read(const object_t& oid, const object_locator_t& oloc, ObjectOperation& op, snapid_t snap, bufferlist& inbl, bufferlist *poutbl, int flags, Context *onfinish, @@ -479,12 +479,12 @@ void Objecter::dispatch(Message *m) void Objecter::scan_requests(bool force_resend, bool force_resend_writes, - map& need_resend, + map& need_resend, list& need_resend_linger, - map& need_resend_command) + map& need_resend_command) { // check for changed linger mappings (_before_ regular ops) - map::iterator lp = linger_ops.begin(); + map::iterator lp = linger_ops.begin(); while (lp != linger_ops.end()) { LingerOp *op = lp->second; ++lp; // check_linger_pool_dne() may touch linger_ops; prevent iterator invalidation @@ -506,7 +506,7 @@ void Objecter::scan_requests(bool force_resend, } // check for changed request mappings - map::iterator p = ops.begin(); + map::iterator p = ops.begin(); while (p != ops.end()) { Op *op = p->second; ++p; // check_op_pool_dne() may touch ops; prevent iterator invalidation @@ -529,7 +529,7 @@ void Objecter::scan_requests(bool force_resend, } // commands - map::iterator cp = command_ops.begin(); + map::iterator cp = command_ops.begin(); while (cp != command_ops.end()) { CommandOp *c = cp->second; ++cp; @@ -571,8 +571,8 @@ void Objecter::handle_osd_map(MOSDMap *m) bool was_pausewr = osdmap->test_flag(CEPH_OSDMAP_PAUSEWR) || was_full; list need_resend_linger; - map need_resend; - map need_resend_command; + map need_resend; + map need_resend_command; if (m->get_last() <= osdmap->get_epoch()) { ldout(cct, 3) << "handle_osd_map ignoring epochs [" @@ -662,7 +662,7 @@ void Objecter::handle_osd_map(MOSDMap *m) maybe_request_map(); // resend requests - for (map::iterator p = need_resend.begin(); p != need_resend.end(); ++p) { + for (map::iterator p = need_resend.begin(); p != need_resend.end(); ++p) { Op *op = p->second; if (op->should_resend) { if (op->session && !op->paused) { @@ -680,7 +680,7 @@ void Objecter::handle_osd_map(MOSDMap *m) send_linger(op); } } - for (map::iterator p = need_resend_command.begin(); p != need_resend_command.end(); ++p) { + for (map::iterator p = need_resend_command.begin(); p != need_resend_command.end(); ++p) { CommandOp *c = p->second; if (c->session) { _send_command(c); @@ -722,7 +722,7 @@ void Objecter::C_Op_Map_Latest::finish(int r) Mutex::Locker l(objecter->client_lock); - map::iterator iter = + map::iterator iter = objecter->check_latest_map_ops.find(tid); if (iter == objecter->check_latest_map_ops.end()) { lgeneric_subdout(objecter->cct, objecter, 10) << "op_map_latest op " << tid << " not found" << dendl; @@ -781,7 +781,7 @@ void Objecter::_send_op_map_check(Op *op) void Objecter::op_cancel_map_check(Op *op) { assert(client_lock.is_locked()); - map::iterator iter = + map::iterator iter = check_latest_map_ops.find(op->tid); if (iter != check_latest_map_ops.end()) { check_latest_map_ops.erase(iter); @@ -1043,7 +1043,7 @@ void Objecter::kick_requests(OSDSession *session) ldout(cct, 10) << "kick_requests for osd." << session->osd << dendl; // resend ops - map resend; // resend in tid order + map resend; // resend in tid order for (xlist::iterator p = session->ops.begin(); !p.end();) { Op *op = *p; ++p; @@ -1107,7 +1107,7 @@ void Objecter::tick() cutoff -= cct->_conf->objecter_timeout; // timeout unsigned laggy_ops = 0; - for (map::iterator p = ops.begin(); + for (map::iterator p = ops.begin(); p != ops.end(); ++p) { Op *op = p->second; @@ -1164,22 +1164,22 @@ void Objecter::resend_mon_ops() assert(client_lock.is_locked()); ldout(cct, 10) << "resend_mon_ops" << dendl; - for (map::iterator p = poolstat_ops.begin(); p!=poolstat_ops.end(); ++p) { + for (map::iterator p = poolstat_ops.begin(); p!=poolstat_ops.end(); ++p) { poolstat_submit(p->second); logger->inc(l_osdc_poolstat_resend); } - for (map::iterator p = statfs_ops.begin(); p!=statfs_ops.end(); ++p) { + for (map::iterator p = statfs_ops.begin(); p!=statfs_ops.end(); ++p) { fs_stats_submit(p->second); logger->inc(l_osdc_statfs_resend); } - for (map::iterator p = pool_ops.begin(); p!=pool_ops.end(); ++p) { + for (map::iterator p = pool_ops.begin(); p!=pool_ops.end(); ++p) { _pool_op_submit(p->second); logger->inc(l_osdc_poolop_resend); } - for (map::iterator p = check_latest_map_ops.begin(); + for (map::iterator p = check_latest_map_ops.begin(); p != check_latest_map_ops.end(); ++p) { C_Op_Map_Latest *c = new C_Op_Map_Latest(this, p->second->tid); @@ -1218,7 +1218,7 @@ public: } }; -tid_t Objecter::op_submit(Op *op) +ceph_tid_t Objecter::op_submit(Op *op) { assert(client_lock.is_locked()); assert(initialized); @@ -1239,10 +1239,10 @@ tid_t Objecter::op_submit(Op *op) return _op_submit(op); } -tid_t Objecter::_op_submit(Op *op) +ceph_tid_t Objecter::_op_submit(Op *op) { // pick tid - tid_t mytid = ++last_tid; + ceph_tid_t mytid = ++last_tid; op->tid = mytid; assert(client_inc >= 0); @@ -1348,12 +1348,12 @@ tid_t Objecter::_op_submit(Op *op) return op->tid; } -int Objecter::op_cancel(tid_t tid, int r) +int Objecter::op_cancel(ceph_tid_t tid, int r) { assert(client_lock.is_locked()); assert(initialized); - map::iterator p = ops.find(tid); + map::iterator p = ops.find(tid); if (p == ops.end()) { ldout(cct, 10) << __func__ << " tid " << tid << " dne" << dendl; return -ENOENT; @@ -1707,7 +1707,7 @@ void Objecter::handle_osd_op_reply(MOSDOpReply *m) ldout(cct, 10) << "in handle_osd_op_reply" << dendl; // get pio - tid_t tid = m->get_tid(); + ceph_tid_t tid = m->get_tid(); if (ops.count(tid) == 0) { ldout(cct, 7) << "handle_osd_op_reply " << tid @@ -2144,11 +2144,11 @@ int Objecter::change_pool_auid(int64_t pool, Context *onfinish, uint64_t auid) class C_CancelPoolOp : public Context { - tid_t tid; + ceph_tid_t tid; Objecter *objecter; public: - C_CancelPoolOp(tid_t tid, Objecter *objecter) : tid(tid), - objecter(objecter) {} + C_CancelPoolOp(ceph_tid_t tid, Objecter *objecter) : tid(tid), + objecter(objecter) {} void finish(int r) { // note that objecter lock == timer lock, and is already held objecter->pool_op_cancel(tid, -ETIMEDOUT); @@ -2190,7 +2190,7 @@ void Objecter::handle_pool_op_reply(MPoolOpReply *m) assert(client_lock.is_locked()); assert(initialized); ldout(cct, 10) << "handle_pool_op_reply " << *m << dendl; - tid_t tid = m->get_tid(); + ceph_tid_t tid = m->get_tid(); if (pool_ops.count(tid)) { PoolOp *op = pool_ops[tid]; ldout(cct, 10) << "have request " << tid << " at " << op << " Op: " << ceph_pool_op_name(op->pool_op) << dendl; @@ -2214,12 +2214,12 @@ void Objecter::handle_pool_op_reply(MPoolOpReply *m) m->put(); } -int Objecter::pool_op_cancel(tid_t tid, int r) +int Objecter::pool_op_cancel(ceph_tid_t tid, int r) { assert(client_lock.is_locked()); assert(initialized); - map::iterator it = pool_ops.find(tid); + map::iterator it = pool_ops.find(tid); if (it == pool_ops.end()) { ldout(cct, 10) << __func__ << " tid " << tid << " dne" << dendl; return -ENOENT; @@ -2249,11 +2249,11 @@ void Objecter::finish_pool_op(PoolOp *op) class C_CancelPoolStatOp : public Context { - tid_t tid; + ceph_tid_t tid; Objecter *objecter; public: - C_CancelPoolStatOp(tid_t tid, Objecter *objecter) : tid(tid), - objecter(objecter) {} + C_CancelPoolStatOp(ceph_tid_t tid, Objecter *objecter) : tid(tid), + objecter(objecter) {} void finish(int r) { // note that objecter lock == timer lock, and is already held objecter->pool_stat_op_cancel(tid, -ETIMEDOUT); @@ -2296,7 +2296,7 @@ void Objecter::handle_get_pool_stats_reply(MGetPoolStatsReply *m) assert(client_lock.is_locked()); assert(initialized); ldout(cct, 10) << "handle_get_pool_stats_reply " << *m << dendl; - tid_t tid = m->get_tid(); + ceph_tid_t tid = m->get_tid(); if (poolstat_ops.count(tid)) { PoolStatOp *op = poolstat_ops[tid]; @@ -2313,12 +2313,12 @@ void Objecter::handle_get_pool_stats_reply(MGetPoolStatsReply *m) m->put(); } -int Objecter::pool_stat_op_cancel(tid_t tid, int r) +int Objecter::pool_stat_op_cancel(ceph_tid_t tid, int r) { assert(client_lock.is_locked()); assert(initialized); - map::iterator it = poolstat_ops.find(tid); + map::iterator it = poolstat_ops.find(tid); if (it == poolstat_ops.end()) { ldout(cct, 10) << __func__ << " tid " << tid << " dne" << dendl; return -ENOENT; @@ -2346,11 +2346,11 @@ void Objecter::finish_pool_stat_op(PoolStatOp *op) class C_CancelStatfsOp : public Context { - tid_t tid; + ceph_tid_t tid; Objecter *objecter; public: - C_CancelStatfsOp(tid_t tid, Objecter *objecter) : tid(tid), - objecter(objecter) {} + C_CancelStatfsOp(ceph_tid_t tid, Objecter *objecter) : tid(tid), + objecter(objecter) {} void finish(int r) { // note that objecter lock == timer lock, and is already held objecter->statfs_op_cancel(tid, -ETIMEDOUT); @@ -2391,7 +2391,7 @@ void Objecter::handle_fs_stats_reply(MStatfsReply *m) assert(client_lock.is_locked()); assert(initialized); ldout(cct, 10) << "handle_fs_stats_reply " << *m << dendl; - tid_t tid = m->get_tid(); + ceph_tid_t tid = m->get_tid(); if (statfs_ops.count(tid)) { StatfsOp *op = statfs_ops[tid]; @@ -2408,12 +2408,12 @@ void Objecter::handle_fs_stats_reply(MStatfsReply *m) m->put(); } -int Objecter::statfs_op_cancel(tid_t tid, int r) +int Objecter::statfs_op_cancel(ceph_tid_t tid, int r) { assert(client_lock.is_locked()); assert(initialized); - map::iterator it = statfs_ops.find(tid); + map::iterator it = statfs_ops.find(tid); if (it == statfs_ops.end()) { ldout(cct, 10) << __func__ << " tid " << tid << " dne" << dendl; return -ENOENT; @@ -2511,7 +2511,7 @@ void Objecter::ms_handle_remote_reset(Connection *con) void Objecter::dump_active() { ldout(cct, 20) << "dump_active .. " << num_homeless_ops << " homeless" << dendl; - for (map::iterator p = ops.begin(); p != ops.end(); ++p) { + for (map::iterator p = ops.begin(); p != ops.end(); ++p) { Op *op = p->second; ldout(cct, 20) << op->tid << "\t" << op->pgid << "\tosd." << (op->session ? op->session->osd : -1) << "\t" << op->base_oid << "\t" << op->ops << dendl; @@ -2535,7 +2535,7 @@ void Objecter::dump_requests(Formatter *fmt) const void Objecter::dump_ops(Formatter *fmt) const { fmt->open_array_section("ops"); - for (map::const_iterator p = ops.begin(); + for (map::const_iterator p = ops.begin(); p != ops.end(); ++p) { Op *op = p->second; @@ -2611,7 +2611,7 @@ void Objecter::dump_command_ops(Formatter *fmt) const void Objecter::dump_pool_ops(Formatter *fmt) const { fmt->open_array_section("pool_ops"); - for (map::const_iterator p = pool_ops.begin(); + for (map::const_iterator p = pool_ops.begin(); p != pool_ops.end(); ++p) { PoolOp *op = p->second; @@ -2632,7 +2632,7 @@ void Objecter::dump_pool_ops(Formatter *fmt) const void Objecter::dump_pool_stat_ops(Formatter *fmt) const { fmt->open_array_section("pool_stat_ops"); - for (map::const_iterator p = poolstat_ops.begin(); + for (map::const_iterator p = poolstat_ops.begin(); p != poolstat_ops.end(); ++p) { PoolStatOp *op = p->second; @@ -2656,7 +2656,7 @@ void Objecter::dump_pool_stat_ops(Formatter *fmt) const void Objecter::dump_statfs_ops(Formatter *fmt) const { fmt->open_array_section("statfs_ops"); - for (map::const_iterator p = statfs_ops.begin(); + for (map::const_iterator p = statfs_ops.begin(); p != statfs_ops.end(); ++p) { StatfsOp *op = p->second; @@ -2711,7 +2711,7 @@ void Objecter::blacklist_self(bool set) void Objecter::handle_command_reply(MCommandReply *m) { - map::iterator p = command_ops.find(m->get_tid()); + map::iterator p = command_ops.find(m->get_tid()); if (p == command_ops.end()) { ldout(cct, 10) << "handle_command_reply tid " << m->get_tid() << " not found" << dendl; m->put(); @@ -2734,20 +2734,20 @@ void Objecter::handle_command_reply(MCommandReply *m) class C_CancelCommandOp : public Context { - tid_t tid; + ceph_tid_t tid; Objecter *objecter; public: - C_CancelCommandOp(tid_t tid, Objecter *objecter) : tid(tid), - objecter(objecter) {} + C_CancelCommandOp(ceph_tid_t tid, Objecter *objecter) : tid(tid), + objecter(objecter) {} void finish(int r) { // note that objecter lock == timer lock, and is already held objecter->command_op_cancel(tid, -ETIMEDOUT); } }; -int Objecter::_submit_command(CommandOp *c, tid_t *ptid) +int Objecter::_submit_command(CommandOp *c, ceph_tid_t *ptid) { - tid_t tid = ++last_tid; + ceph_tid_t tid = ++last_tid; ldout(cct, 10) << "_submit_command " << tid << " " << c->cmd << dendl; c->tid = tid; if (osd_timeout > 0) { @@ -2828,12 +2828,12 @@ void Objecter::_send_command(CommandOp *c) logger->inc(l_osdc_command_send); } -int Objecter::command_op_cancel(tid_t tid, int r) +int Objecter::command_op_cancel(ceph_tid_t tid, int r) { assert(client_lock.is_locked()); assert(initialized); - map::iterator it = command_ops.find(tid); + map::iterator it = command_ops.find(tid); if (it == command_ops.end()) { ldout(cct, 10) << __func__ << " tid " << tid << " dne" << dendl; return -ENOENT; diff --git a/src/osdc/Objecter.h b/src/osdc/Objecter.h index 2311f55ce3676..da8c430224a41 100644 --- a/src/osdc/Objecter.h +++ b/src/osdc/Objecter.h @@ -1013,7 +1013,7 @@ public: bool initialized; private: - tid_t last_tid; + ceph_tid_t last_tid; int client_inc; uint64_t max_linger_id; int num_unacked; @@ -1095,7 +1095,7 @@ public: int flags, priority; Context *onack, *oncommit, *ontimeout; - tid_t tid; + ceph_tid_t tid; eversion_t replay_version; // for op replay int attempts; @@ -1158,9 +1158,9 @@ public: struct C_Op_Map_Latest : public Context { Objecter *objecter; - tid_t tid; + ceph_tid_t tid; version_t latest; - C_Op_Map_Latest(Objecter *o, tid_t t) : objecter(o), tid(t), latest(0) {} + C_Op_Map_Latest(Objecter *o, ceph_tid_t t) : objecter(o), tid(t), latest(0) {} void finish(int r); }; @@ -1168,7 +1168,7 @@ public: Objecter *objecter; uint64_t tid; version_t latest; - C_Command_Map_Latest(Objecter *o, tid_t t) : objecter(o), tid(t), latest(0) {} + C_Command_Map_Latest(Objecter *o, ceph_tid_t t) : objecter(o), tid(t), latest(0) {} void finish(int r); }; @@ -1263,7 +1263,7 @@ public: }; struct PoolStatOp { - tid_t tid; + ceph_tid_t tid; list pools; map *pool_stats; @@ -1273,7 +1273,7 @@ public: }; struct StatfsOp { - tid_t tid; + ceph_tid_t tid; struct ceph_statfs *stats; Context *onfinish, *ontimeout; @@ -1281,7 +1281,7 @@ public: }; struct PoolOp { - tid_t tid; + ceph_tid_t tid; int64_t pool; string name; Context *onfinish, *ontimeout; @@ -1300,7 +1300,7 @@ public: struct CommandOp : public RefCountedObject { xlist::item session_item; OSDSession *session; - tid_t tid; + ceph_tid_t tid; vector cmd; bufferlist inbl; bufferlist *poutbl; @@ -1322,10 +1322,10 @@ public: onfinish(NULL), ontimeout(NULL) {} }; - int _submit_command(CommandOp *c, tid_t *ptid); + int _submit_command(CommandOp *c, ceph_tid_t *ptid); int recalc_command_target(CommandOp *c); void _send_command(CommandOp *c); - int command_op_cancel(tid_t tid, int r); + int command_op_cancel(ceph_tid_t tid, int r); void _finish_command(CommandOp *c, int r, string rs); void handle_command_reply(MCommandReply *m); @@ -1357,7 +1357,7 @@ public: OSDSession *session; xlist::item session_item; - tid_t register_tid; + ceph_tid_t register_tid; epoch_t map_dne_bound; LingerOp() : linger_id(0), primary(-1), @@ -1429,19 +1429,19 @@ public: private: // pending ops - map ops; + map ops; int num_homeless_ops; map linger_ops; - map poolstat_ops; - map statfs_ops; - map pool_ops; - map command_ops; + map poolstat_ops; + map statfs_ops; + map pool_ops; + map command_ops; // ops waiting for an osdmap with a new pool or confirmation that // the pool does not exist (may be expanded to other uses later) - map check_latest_map_lingers; - map check_latest_map_ops; - map check_latest_map_commands; + map check_latest_map_lingers; + map check_latest_map_ops; + map check_latest_map_commands; map > > waiting_for_map; @@ -1565,9 +1565,9 @@ public: void scan_requests(bool force_resend, bool force_resend_writes, - map& need_resend, + map& need_resend, list& need_resend_linger, - map& need_resend_command); + map& need_resend_command); int64_t get_object_hash_position(int64_t pool, const string& key, const string& ns); int64_t get_object_pg_hash_position(int64_t pool, const string& key, const string& ns); @@ -1581,12 +1581,12 @@ public: private: // low-level - tid_t _op_submit(Op *op); + ceph_tid_t _op_submit(Op *op); inline void unregister_op(Op *op); // public interface public: - tid_t op_submit(Op *op); + ceph_tid_t op_submit(Op *op); bool is_active() { return !(ops.empty() && linger_ops.empty() && poolstat_ops.empty() && statfs_ops.empty()); } @@ -1618,11 +1618,11 @@ public: void clear_global_op_flag(int flags) { global_op_flags &= ~flags; } /// cancel an in-progress request with the given return code - int op_cancel(tid_t tid, int r); + int op_cancel(ceph_tid_t tid, int r); // commands int osd_command(int osd, vector& cmd, - const bufferlist& inbl, tid_t *ptid, + const bufferlist& inbl, ceph_tid_t *ptid, bufferlist *poutbl, string *prs, Context *onfinish) { assert(osd >= 0); CommandOp *c = new CommandOp; @@ -1635,7 +1635,7 @@ public: return _submit_command(c, ptid); } int pg_command(pg_t pgid, vector& cmd, - const bufferlist& inbl, tid_t *ptid, + const bufferlist& inbl, ceph_tid_t *ptid, bufferlist *poutbl, string *prs, Context *onfinish) { CommandOp *c = new CommandOp; c->cmd = cmd; @@ -1648,7 +1648,7 @@ public: } // mid-level helpers - Op *prepare_mutate_op(const object_t& oid, const object_locator_t& oloc, + Op *prepare_mutate_op(const object_t& oid, const object_locator_t& oloc, ObjectOperation& op, const SnapContext& snapc, utime_t mtime, int flags, Context *onack, Context *oncommit, version_t *objver = NULL) { @@ -1659,7 +1659,7 @@ public: o->out_rval.swap(op.out_rval); return o; } - tid_t mutate(const object_t& oid, const object_locator_t& oloc, + ceph_tid_t mutate(const object_t& oid, const object_locator_t& oloc, ObjectOperation& op, const SnapContext& snapc, utime_t mtime, int flags, Context *onack, Context *oncommit, version_t *objver = NULL) { @@ -1679,14 +1679,14 @@ public: o->out_rval.swap(op.out_rval); return o; } - tid_t read(const object_t& oid, const object_locator_t& oloc, + ceph_tid_t read(const object_t& oid, const object_locator_t& oloc, ObjectOperation& op, snapid_t snapid, bufferlist *pbl, int flags, Context *onack, version_t *objver = NULL) { Op *o = prepare_read_op(oid, oloc, op, snapid, pbl, flags, onack, objver); return op_submit(o); } - tid_t pg_read(uint32_t hash, object_locator_t oloc, + ceph_tid_t pg_read(uint32_t hash, object_locator_t oloc, ObjectOperation& op, bufferlist *pbl, int flags, Context *onack, @@ -1705,13 +1705,13 @@ public: o->reply_epoch = reply_epoch; return op_submit(o); } - tid_t linger_mutate(const object_t& oid, const object_locator_t& oloc, + ceph_tid_t linger_mutate(const object_t& oid, const object_locator_t& oloc, ObjectOperation& op, const SnapContext& snapc, utime_t mtime, bufferlist& inbl, int flags, Context *onack, Context *onfinish, version_t *objver); - tid_t linger_read(const object_t& oid, const object_locator_t& oloc, + ceph_tid_t linger_read(const object_t& oid, const object_locator_t& oloc, ObjectOperation& op, snapid_t snap, bufferlist& inbl, bufferlist *poutbl, int flags, Context *onack, @@ -1746,7 +1746,7 @@ public: // high-level helpers - tid_t stat(const object_t& oid, const object_locator_t& oloc, snapid_t snap, + ceph_tid_t stat(const object_t& oid, const object_locator_t& oloc, snapid_t snap, uint64_t *psize, utime_t *pmtime, int flags, Context *onfinish, version_t *objver = NULL, ObjectOperation *extra_ops = NULL) { @@ -1760,7 +1760,7 @@ public: return op_submit(o); } - tid_t read(const object_t& oid, const object_locator_t& oloc, + ceph_tid_t read(const object_t& oid, const object_locator_t& oloc, uint64_t off, uint64_t len, snapid_t snap, bufferlist *pbl, int flags, Context *onfinish, version_t *objver = NULL, ObjectOperation *extra_ops = NULL) { @@ -1777,7 +1777,7 @@ public: return op_submit(o); } - tid_t read_trunc(const object_t& oid, const object_locator_t& oloc, + ceph_tid_t read_trunc(const object_t& oid, const object_locator_t& oloc, uint64_t off, uint64_t len, snapid_t snap, bufferlist *pbl, int flags, uint64_t trunc_size, __u32 trunc_seq, Context *onfinish, @@ -1794,7 +1794,7 @@ public: o->outbl = pbl; return op_submit(o); } - tid_t mapext(const object_t& oid, const object_locator_t& oloc, + ceph_tid_t mapext(const object_t& oid, const object_locator_t& oloc, uint64_t off, uint64_t len, snapid_t snap, bufferlist *pbl, int flags, Context *onfinish, version_t *objver = NULL, ObjectOperation *extra_ops = NULL) { @@ -1810,7 +1810,7 @@ public: o->outbl = pbl; return op_submit(o); } - tid_t getxattr(const object_t& oid, const object_locator_t& oloc, + ceph_tid_t getxattr(const object_t& oid, const object_locator_t& oloc, const char *name, snapid_t snap, bufferlist *pbl, int flags, Context *onfinish, version_t *objver = NULL, ObjectOperation *extra_ops = NULL) { @@ -1827,7 +1827,7 @@ public: return op_submit(o); } - tid_t getxattrs(const object_t& oid, const object_locator_t& oloc, snapid_t snap, + ceph_tid_t getxattrs(const object_t& oid, const object_locator_t& oloc, snapid_t snap, map& attrset, int flags, Context *onfinish, version_t *objver = NULL, ObjectOperation *extra_ops = NULL) { @@ -1841,7 +1841,7 @@ public: return op_submit(o); } - tid_t read_full(const object_t& oid, const object_locator_t& oloc, + ceph_tid_t read_full(const object_t& oid, const object_locator_t& oloc, snapid_t snap, bufferlist *pbl, int flags, Context *onfinish, version_t *objver = NULL, ObjectOperation *extra_ops = NULL) { @@ -1850,7 +1850,7 @@ public: // writes - tid_t _modify(const object_t& oid, const object_locator_t& oloc, + ceph_tid_t _modify(const object_t& oid, const object_locator_t& oloc, vector& ops, utime_t mtime, const SnapContext& snapc, int flags, Context *onack, Context *oncommit, @@ -1860,7 +1860,7 @@ public: o->snapc = snapc; return op_submit(o); } - tid_t write(const object_t& oid, const object_locator_t& oloc, + ceph_tid_t write(const object_t& oid, const object_locator_t& oloc, uint64_t off, uint64_t len, const SnapContext& snapc, const bufferlist &bl, utime_t mtime, int flags, Context *onack, Context *oncommit, @@ -1878,7 +1878,7 @@ public: o->snapc = snapc; return op_submit(o); } - tid_t append(const object_t& oid, const object_locator_t& oloc, + ceph_tid_t append(const object_t& oid, const object_locator_t& oloc, uint64_t len, const SnapContext& snapc, const bufferlist &bl, utime_t mtime, int flags, Context *onack, Context *oncommit, @@ -1896,7 +1896,7 @@ public: o->snapc = snapc; return op_submit(o); } - tid_t write_trunc(const object_t& oid, const object_locator_t& oloc, + ceph_tid_t write_trunc(const object_t& oid, const object_locator_t& oloc, uint64_t off, uint64_t len, const SnapContext& snapc, const bufferlist &bl, utime_t mtime, int flags, uint64_t trunc_size, __u32 trunc_seq, @@ -1915,7 +1915,7 @@ public: o->snapc = snapc; return op_submit(o); } - tid_t write_full(const object_t& oid, const object_locator_t& oloc, + ceph_tid_t write_full(const object_t& oid, const object_locator_t& oloc, const SnapContext& snapc, const bufferlist &bl, utime_t mtime, int flags, Context *onack, Context *oncommit, version_t *objver = NULL, ObjectOperation *extra_ops = NULL) { @@ -1930,7 +1930,7 @@ public: o->snapc = snapc; return op_submit(o); } - tid_t trunc(const object_t& oid, const object_locator_t& oloc, + ceph_tid_t trunc(const object_t& oid, const object_locator_t& oloc, const SnapContext& snapc, utime_t mtime, int flags, uint64_t trunc_size, __u32 trunc_seq, @@ -1947,7 +1947,7 @@ public: o->snapc = snapc; return op_submit(o); } - tid_t zero(const object_t& oid, const object_locator_t& oloc, + ceph_tid_t zero(const object_t& oid, const object_locator_t& oloc, uint64_t off, uint64_t len, const SnapContext& snapc, utime_t mtime, int flags, Context *onack, Context *oncommit, version_t *objver = NULL, ObjectOperation *extra_ops = NULL) { @@ -1961,7 +1961,7 @@ public: o->snapc = snapc; return op_submit(o); } - tid_t rollback_object(const object_t& oid, const object_locator_t& oloc, + ceph_tid_t rollback_object(const object_t& oid, const object_locator_t& oloc, const SnapContext& snapc, snapid_t snapid, utime_t mtime, Context *onack, Context *oncommit, version_t *objver = NULL, ObjectOperation *extra_ops = NULL) { @@ -1974,7 +1974,7 @@ public: o->snapc = snapc; return op_submit(o); } - tid_t create(const object_t& oid, const object_locator_t& oloc, + ceph_tid_t create(const object_t& oid, const object_locator_t& oloc, const SnapContext& snapc, utime_t mtime, int global_flags, int create_flags, Context *onack, Context *oncommit, @@ -1988,7 +1988,7 @@ public: o->snapc = snapc; return op_submit(o); } - tid_t remove(const object_t& oid, const object_locator_t& oloc, + ceph_tid_t remove(const object_t& oid, const object_locator_t& oloc, const SnapContext& snapc, utime_t mtime, int flags, Context *onack, Context *oncommit, version_t *objver = NULL, ObjectOperation *extra_ops = NULL) { @@ -2001,7 +2001,7 @@ public: return op_submit(o); } - tid_t lock(const object_t& oid, const object_locator_t& oloc, int op, int flags, + ceph_tid_t lock(const object_t& oid, const object_locator_t& oloc, int op, int flags, Context *onack, Context *oncommit, version_t *objver = NULL, ObjectOperation *extra_ops = NULL) { SnapContext snapc; // no snapc for lock ops vector ops; @@ -2011,7 +2011,7 @@ public: o->snapc = snapc; return op_submit(o); } - tid_t setxattr(const object_t& oid, const object_locator_t& oloc, + ceph_tid_t setxattr(const object_t& oid, const object_locator_t& oloc, const char *name, const SnapContext& snapc, const bufferlist &bl, utime_t mtime, int flags, Context *onack, Context *oncommit, @@ -2029,7 +2029,7 @@ public: o->snapc = snapc; return op_submit(o); } - tid_t removexattr(const object_t& oid, const object_locator_t& oloc, + ceph_tid_t removexattr(const object_t& oid, const object_locator_t& oloc, const char *name, const SnapContext& snapc, utime_t mtime, int flags, Context *onack, Context *oncommit, @@ -2067,7 +2067,7 @@ public: int change_pool_auid(int64_t pool, Context *onfinish, uint64_t auid); void handle_pool_op_reply(MPoolOpReply *m); - int pool_op_cancel(tid_t tid, int r); + int pool_op_cancel(ceph_tid_t tid, int r); void finish_pool_op(PoolOp *op); // -------------------------- @@ -2078,7 +2078,7 @@ public: void handle_get_pool_stats_reply(MGetPoolStatsReply *m); void get_pool_stats(list& pools, map *result, Context *onfinish); - int pool_stat_op_cancel(tid_t tid, int r); + int pool_stat_op_cancel(ceph_tid_t tid, int r); void finish_pool_stat_op(PoolStatOp *op); // --------------------------- @@ -2088,7 +2088,7 @@ private: public: void handle_fs_stats_reply(MStatfsReply *m); void get_fs_stats(struct ceph_statfs& result, Context *onfinish); - int statfs_op_cancel(tid_t tid, int r); + int statfs_op_cancel(ceph_tid_t tid, int r); void finish_statfs_op(StatfsOp *op); // --------------------------- diff --git a/src/osdc/WritebackHandler.h b/src/osdc/WritebackHandler.h index 17e1f683bec0b..4869837306858 100644 --- a/src/osdc/WritebackHandler.h +++ b/src/osdc/WritebackHandler.h @@ -28,12 +28,13 @@ class WritebackHandler { * @param snapid read snapid */ virtual bool may_copy_on_write(const object_t& oid, uint64_t read_off, uint64_t read_len, snapid_t snapid) = 0; - virtual tid_t write(const object_t& oid, const object_locator_t& oloc, - uint64_t off, uint64_t len, const SnapContext& snapc, - const bufferlist &bl, utime_t mtime, uint64_t trunc_size, - __u32 trunc_seq, Context *oncommit) = 0; - virtual tid_t lock(const object_t& oid, const object_locator_t& oloc, int op, - int flags, Context *onack, Context *oncommit) { + virtual ceph_tid_t write(const object_t& oid, const object_locator_t& oloc, + uint64_t off, uint64_t len, const SnapContext& snapc, + const bufferlist &bl, utime_t mtime, + uint64_t trunc_size, __u32 trunc_seq, + Context *oncommit) = 0; + virtual ceph_tid_t lock(const object_t& oid, const object_locator_t& oloc, + int op, int flags, Context *onack, Context *oncommit) { assert(0 == "this WritebackHandler does not support the lock operation"); } }; diff --git a/src/test/osdc/FakeWriteback.cc b/src/test/osdc/FakeWriteback.cc index b4cd35ea9790e..7c678cf43d8b6 100644 --- a/src/test/osdc/FakeWriteback.cc +++ b/src/test/osdc/FakeWriteback.cc @@ -68,7 +68,7 @@ void FakeWriteback::read(const object_t& oid, m_finisher->queue(wrapper, len); } -tid_t FakeWriteback::write(const object_t& oid, +ceph_tid_t FakeWriteback::write(const object_t& oid, const object_locator_t& oloc, uint64_t off, uint64_t len, const SnapContext& snapc, diff --git a/src/test/osdc/FakeWriteback.h b/src/test/osdc/FakeWriteback.h index e7d6dc16bb469..2b7fbd679116d 100644 --- a/src/test/osdc/FakeWriteback.h +++ b/src/test/osdc/FakeWriteback.h @@ -22,10 +22,11 @@ public: bufferlist *pbl, uint64_t trunc_size, __u32 trunc_seq, Context *onfinish); - virtual tid_t write(const object_t& oid, const object_locator_t& oloc, - uint64_t off, uint64_t len, const SnapContext& snapc, - const bufferlist &bl, utime_t mtime, uint64_t trunc_size, - __u32 trunc_seq, Context *oncommit); + virtual ceph_tid_t write(const object_t& oid, const object_locator_t& oloc, + uint64_t off, uint64_t len, + const SnapContext& snapc, const bufferlist &bl, + utime_t mtime, uint64_t trunc_size, + __u32 trunc_seq, Context *oncommit); virtual bool may_copy_on_write(const object_t&, uint64_t, uint64_t, snapid_t); private: -- 2.39.5