]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
src/: use ref_t<Message> instead of Message::ref
authorKefu Chai <kchai@redhat.com>
Sun, 14 Apr 2019 05:18:00 +0000 (13:18 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 17 Apr 2019 22:59:41 +0000 (06:59 +0800)
Signed-off-by: Kefu Chai <kchai@redhat.com>
22 files changed:
src/client/Client.cc
src/client/MetaSession.h
src/mds/Beacon.cc
src/mds/Beacon.h
src/mds/CInode.cc
src/mds/CInode.h
src/mds/Locker.cc
src/mds/Locker.h
src/mds/MDCache.cc
src/mds/MDCache.h
src/mds/MDSDaemon.cc
src/mds/MDSDaemon.h
src/mds/MDSTableServer.cc
src/mds/MDSTableServer.h
src/mds/Server.cc
src/mds/Server.h
src/mds/SessionMap.h
src/mds/journal.cc
src/msg/DispatchQueue.cc
src/msg/Message.cc
src/msg/Messenger.h
src/tools/ceph-dencoder/ceph_dencoder.cc

index 96f683bcc46213f00d44d418acc37ec2669149d4..4499cb194878d2c3e5da3487d694553d076e81a5 100644 (file)
@@ -2249,7 +2249,7 @@ void Client::send_request(MetaRequest *request, MetaSession *session,
   session->con->send_message2(std::move(r));
 }
 
-MClientRequest::ref Client::build_client_request(MetaRequest *request)
+ref_t<MClientRequest> Client::build_client_request(MetaRequest *request)
 {
   auto req = MClientRequest::create(request->get_op());
   req->set_tid(request->tid);
index af2d7acd76415dfa9dec2f093b0bc0dafdef1485..958d0bd96c19d1ee3b29df65ce30662657fa6b46 100644 (file)
@@ -54,7 +54,7 @@ struct MetaSession {
   std::set<ceph_tid_t> flushing_caps_tids;
   std::set<Inode*> early_flushing_caps;
 
-  MClientCapRelease::ref release;
+  ceph::ref_t<MClientCapRelease> release;
 
   MetaSession(mds_rank_t mds_num, ConnectionRef con,
              const entity_addrvec_t& addrs)
index 285ca5b3b60c59d9e19ebf11d0305e3c65f742f8..e08bf3ee4d0fb4f77850ac478ca61b20ff00123d 100644 (file)
@@ -92,13 +92,13 @@ bool Beacon::ms_can_fast_dispatch2(const cref_t<Message>& m) const
   return m->get_type() == MSG_MDS_BEACON;
 }
 
-void Beacon::ms_fast_dispatch2(const Message::ref& m)
+void Beacon::ms_fast_dispatch2(const ref_t<Message>& m)
 {
   bool handled = ms_dispatch2(m);
   ceph_assert(handled);
 }
 
-bool Beacon::ms_dispatch2(const Message::ref& m)
+bool Beacon::ms_dispatch2(const ref_t<Message>& m)
 {
   if (m->get_type() == MSG_MDS_BEACON) {
     if (m->get_connection()->get_peer_type() == CEPH_ENTITY_TYPE_MON) {
index 18353c6c693b1a97cc7ebfa862d677653691d07d..a7382783f45a96c6bd244ce7a6cff9b895659691 100644 (file)
@@ -53,8 +53,8 @@ public:
 
   bool ms_can_fast_dispatch_any() const override { return true; }
   bool ms_can_fast_dispatch2(const cref_t<Message>& m) const override;
-  void ms_fast_dispatch2(const Message::ref& m) override;
-  bool ms_dispatch2(const Message::ref &m) override;
+  void ms_fast_dispatch2(const ref_t<Message>& m) override;
+  bool ms_dispatch2(const ref_t<Message> &m) override;
   void ms_handle_connect(Connection *c) override {}
   bool ms_handle_reset(Connection *c) override {return false;}
   void ms_handle_remote_reset(Connection *c) override {}
index c0f812a766c8ba949907c1c86afea331d0225aeb..d16d29f334473cb843dc9eff2e4e52bb65bbc77e 100644 (file)
@@ -3686,7 +3686,7 @@ int CInode::encode_inodestat(bufferlist& bl, Session *session,
   return valid;
 }
 
-void CInode::encode_cap_message(const MClientCaps::ref &m, Capability *cap)
+void CInode::encode_cap_message(const ref_t<MClientCaps> &m, Capability *cap)
 {
   ceph_assert(cap);
 
index 31c71e5ef9ee165f4708f66209dc879ea413c414..fd092d68225e6f132bc3b6c37e7666a3570f6b0d 100644 (file)
@@ -891,7 +891,7 @@ public:
   int encode_inodestat(bufferlist& bl, Session *session, SnapRealm *realm,
                       snapid_t snapid=CEPH_NOSNAP, unsigned max_bytes=0,
                       int getattr_wants=0);
-  void encode_cap_message(const MClientCaps::ref &m, Capability *cap);
+  void encode_cap_message(const ref_t<MClientCaps> &m, Capability *cap);
 
 
   // -- locks --
index db86ee0d2e94b82d3d213b9444612ffc857595b0..00a8e317165f168870d230ac37725bec64346824 100644 (file)
@@ -1805,10 +1805,10 @@ class C_Locker_FileUpdate_finish : public LockerLogContext {
   MutationRef mut;
   unsigned flags;
   client_t client;
-  MClientCaps::ref ack;
+  ref_t<MClientCaps> ack;
 public:
   C_Locker_FileUpdate_finish(Locker *l, CInode *i, MutationRef& m, unsigned f,
-                             const MClientCaps::ref &ack, client_t c=-1)
+                             const ref_t<MClientCaps> &ack, client_t c=-1)
     : LockerLogContext(l), in(i), mut(m), flags(f), client(c), ack(ack) {
     in->get(CInode::PIN_PTRWAITER);
   }
@@ -1825,7 +1825,7 @@ enum {
 };
 
 void Locker::file_update_finish(CInode *in, MutationRef& mut, unsigned flags,
-                               client_t client, const MClientCaps::ref &ack)
+                               client_t client, const ref_t<MClientCaps> &ack)
 {
   dout(10) << "file_update_finish on " << *in << dendl;
   in->pop_and_dirty_projected_inode(mut->ls);
@@ -2466,7 +2466,7 @@ bool Locker::check_inode_max_size(CInode *in, bool force_wrlock,
     mdcache->journal_dirty_inode(mut.get(), metablob, in);
   }
   mds->mdlog->submit_entry(le, new C_Locker_FileUpdate_finish(this, in, mut,
-      UPDATE_SHAREMAX, MClientCaps::ref()));
+      UPDATE_SHAREMAX, ref_t<MClientCaps>()));
   wrlock_force(&in->filelock, mut);  // wrlock for duration of journal
   mut->auth_pin(in);
 
@@ -2634,7 +2634,7 @@ void Locker::_do_null_snapflush(CInode *head_in, client_t client, snapid_t last)
       CInode *sin = mdcache->pick_inode_snap(head_in, snapid - 1);
       ceph_assert(sin);
       ceph_assert(sin->first <= snapid);
-      _do_snap_update(sin, snapid, 0, sin->first - 1, client, MClientCaps::ref(), MClientCaps::ref());
+      _do_snap_update(sin, snapid, 0, sin->first - 1, client, ref_t<MClientCaps>(), ref_t<MClientCaps>());
       head_in->remove_need_snapflush(sin, snapid, client);
     }
   }
@@ -2697,7 +2697,7 @@ void Locker::handle_client_caps(const cref_t<MClientCaps> &m)
       session->have_completed_flush(m->get_client_tid())) {
     dout(7) << "handle_client_caps already flushed tid " << m->get_client_tid()
            << " for client." << client << dendl;
-    MClientCaps::ref ack;
+    ref_t<MClientCaps> ack;
     if (op == CEPH_CAP_OP_FLUSHSNAP) {
       ack = MClientCaps::create(CEPH_CAP_OP_FLUSHSNAP_ACK, m->get_ino(), 0, 0, 0, 0, 0, dirty, 0, mds->get_osd_epoch_barrier());
     } else {
@@ -2821,7 +2821,7 @@ void Locker::handle_client_caps(const cref_t<MClientCaps> &m)
     // we can prepare the ack now, since this FLUSHEDSNAP is independent of any
     // other cap ops.  (except possibly duplicate FLUSHSNAP requests, but worst
     // case we get a dup response, so whatever.)
-    MClientCaps::ref ack;
+    ref_t<MClientCaps> ack;
     if (dirty) {
       ack = MClientCaps::create(CEPH_CAP_OP_FLUSHSNAP_ACK, in->ino(), 0, 0, 0, 0, 0, dirty, 0, mds->get_osd_epoch_barrier());
       ack->set_snap_follows(follows);
@@ -2862,14 +2862,14 @@ void Locker::handle_client_caps(const cref_t<MClientCaps> &m)
        ceph_assert(in->last != CEPH_NOSNAP);
        if (in->is_auth() && dirty) {
          dout(10) << " updating intermediate snapped inode " << *in << dendl;
-         _do_cap_update(in, NULL, dirty, follows, m, MClientCaps::ref());
+         _do_cap_update(in, NULL, dirty, follows, m, ref_t<MClientCaps>());
        }
        in = mdcache->pick_inode_snap(head_in, in->last);
       }
     }
  
     // head inode, and cap
-    MClientCaps::ref ack;
+    ref_t<MClientCaps> ack;
 
     int caps = m->get_caps();
     if (caps & ~cap->issued()) {
@@ -3110,7 +3110,7 @@ void Locker::kick_cap_releases(MDRequestRef& mdr)
 /**
  * m and ack might be NULL, so don't dereference them unless dirty != 0
  */
-void Locker::_do_snap_update(CInode *in, snapid_t snap, int dirty, snapid_t follows, client_t client, const cref_t<MClientCaps> &m, const MClientCaps::ref &ack)
+void Locker::_do_snap_update(CInode *in, snapid_t snap, int dirty, snapid_t follows, client_t client, const cref_t<MClientCaps> &m, const ref_t<MClientCaps> &ack)
 {
   dout(10) << "_do_snap_update dirty " << ccap_string(dirty)
           << " follows " << follows << " snap " << snap
@@ -3301,7 +3301,7 @@ void Locker::_update_cap_fields(CInode *in, int dirty, const cref_t<MClientCaps>
  */
 bool Locker::_do_cap_update(CInode *in, Capability *cap,
                            int dirty, snapid_t follows,
-                           const cref_t<MClientCaps> &m, const MClientCaps::ref &ack,
+                           const cref_t<MClientCaps> &m, const ref_t<MClientCaps> &ack,
                            bool *need_flush)
 {
   dout(10) << "_do_cap_update dirty " << ccap_string(dirty)
index 4252f4d1b57ae9c28c2b27ea519dc275a9b135d4..de45423b53f99222798746846ea6355028e9bfc8 100644 (file)
@@ -191,10 +191,10 @@ protected:
   void adjust_cap_wanted(Capability *cap, int wanted, int issue_seq);
   void handle_client_caps(const cref_t<MClientCaps> &m);
   void _update_cap_fields(CInode *in, int dirty, const cref_t<MClientCaps> &m, CInode::mempool_inode *pi);
-  void _do_snap_update(CInode *in, snapid_t snap, int dirty, snapid_t follows, client_t client, const cref_t<MClientCaps> &m, const MClientCaps::ref &ack);
+  void _do_snap_update(CInode *in, snapid_t snap, int dirty, snapid_t follows, client_t client, const cref_t<MClientCaps> &m, const ref_t<MClientCaps> &ack);
   void _do_null_snapflush(CInode *head_in, client_t client, snapid_t last=CEPH_NOSNAP);
   bool _do_cap_update(CInode *in, Capability *cap, int dirty, snapid_t follows, const cref_t<MClientCaps> &m,
-                     const MClientCaps::ref &ack, bool *need_flush=NULL);
+                     const ref_t<MClientCaps> &ack, bool *need_flush=NULL);
   void handle_client_cap_release(const cref_t<MClientCapRelease> &m);
   void _do_cap_release(client_t client, inodeno_t ino, uint64_t cap_id, ceph_seq_t mseq, ceph_seq_t seq);
   void caps_tick();
@@ -253,7 +253,7 @@ protected:
   void handle_inode_file_caps(const cref_t<MInodeFileCaps> &m);
 
   void file_update_finish(CInode *in, MutationRef& mut, unsigned flags,
-                         client_t client, const MClientCaps::ref &ack);
+                         client_t client, const ref_t<MClientCaps> &ack);
 private:
   uint64_t calc_new_max_size(CInode::mempool_inode *pi, uint64_t size);
 public:
index 70fcf64fb6f57577ce3ab2a26566a348c0dadc7f..464e25d67b918a7457c244d41475963ea6f57490 100644 (file)
@@ -2660,7 +2660,7 @@ void MDCache::send_slave_resolves()
 {
   dout(10) << "send_slave_resolves" << dendl;
 
-  map<mds_rank_t, MMDSResolve::ref> resolves;
+  map<mds_rank_t, ref_t<MMDSResolve>> resolves;
 
   if (mds->is_resolve()) {
     for (map<mds_rank_t, map<metareqid_t, MDSlaveUpdate*> >::iterator p = uncommitted_slave_updates.begin();
@@ -2727,7 +2727,7 @@ void MDCache::send_subtree_resolves()
     return;  // not now
   }
 
-  map<mds_rank_t, MMDSResolve::ref> resolves;
+  map<mds_rank_t, ref_t<MMDSResolve>> resolves;
   for (set<mds_rank_t>::iterator p = recovery_set.begin();
        p != recovery_set.end();
        ++p) {
@@ -2810,7 +2810,7 @@ void MDCache::send_subtree_resolves()
 
   // send
   for (auto &p : resolves) {
-    const MMDSResolve::ref &m = p.second;
+    const ref_t<MMDSResolve> &m = p.second;
     if (mds->is_resolve()) {
       m->add_table_commits(TABLE_SNAP, resolve_snapclient_commits);
     } else {
@@ -3911,7 +3911,7 @@ void MDCache::rejoin_send_rejoins()
     disambiguate_other_imports();
   }
 
-  map<mds_rank_t, MMDSCacheRejoin::ref> rejoins;
+  map<mds_rank_t, ref_t<MMDSCacheRejoin>> rejoins;
 
 
   // if i am rejoining, send a rejoin to everyone.
@@ -4049,7 +4049,7 @@ void MDCache::rejoin_send_rejoins()
        if (!q.first->is_auth()) {
          ceph_assert(q.second == q.first->authority().first);
          if (rejoins.count(q.second) == 0) continue;
-         const MMDSCacheRejoin::ref &rejoin = rejoins[q.second];
+         const ref_t<MMDSCacheRejoin> &rejoin = rejoins[q.second];
          
          dout(15) << " " << *mdr << " authpin on " << *q.first << dendl;
          MDSCacheObjectInfo i;
@@ -4072,7 +4072,7 @@ void MDCache::rejoin_send_rejoins()
        if (q.is_xlock() && !obj->is_auth()) {
          mds_rank_t who = obj->authority().first;
          if (rejoins.count(who) == 0) continue;
-         const MMDSCacheRejoin::ref &rejoin = rejoins[who];
+         const ref_t<MMDSCacheRejoin> &rejoin = rejoins[who];
          
          dout(15) << " " << *mdr << " xlock on " << *lock << " " << *obj << dendl;
          MDSCacheObjectInfo i;
@@ -4086,7 +4086,7 @@ void MDCache::rejoin_send_rejoins()
        } else if (q.is_remote_wrlock()) {
          mds_rank_t who = q.wrlock_target;
          if (rejoins.count(who) == 0) continue;
-         const MMDSCacheRejoin::ref &rejoin = rejoins[who];
+         const ref_t<MMDSCacheRejoin> &rejoin = rejoins[who];
 
          dout(15) << " " << *mdr << " wrlock on " << *lock << " " << *obj << dendl;
          MDSCacheObjectInfo i;
@@ -4133,7 +4133,7 @@ void MDCache::rejoin_send_rejoins()
  *  strong dentries (no connectivity!)
  *  strong inodes
  */
-void MDCache::rejoin_walk(CDir *dir, const MMDSCacheRejoin::ref &rejoin)
+void MDCache::rejoin_walk(CDir *dir, const ref_t<MMDSCacheRejoin> &rejoin)
 {
   dout(10) << "rejoin_walk " << *dir << dendl;
 
@@ -4283,7 +4283,7 @@ void MDCache::handle_cache_rejoin_weak(const cref_t<MMDSCacheRejoin> &weak)
   mds_rank_t from = mds_rank_t(weak->get_source().num());
 
   // possible response(s)
-  MMDSCacheRejoin::ref ack;      // if survivor
+  ref_t<MMDSCacheRejoin> ack;      // if survivor
   set<vinodeno_t> acked_inodes;  // if survivor
   set<SimpleLock *> gather_locks;  // if survivor
   bool survivor = false;  // am i a survivor?
@@ -5494,9 +5494,9 @@ void MDCache::choose_lock_states_and_reconnect_caps()
 }
 
 void MDCache::prepare_realm_split(SnapRealm *realm, client_t client, inodeno_t ino,
-                                 map<client_t,MClientSnap::ref>& splits)
+                                 map<client_t,ref_t<MClientSnap>>& splits)
 {
-  MClientSnap::ref snap;
+  ref_t<MClientSnap> snap;
   auto it = splits.find(client);
   if (it != splits.end()) {
     snap = it->second;
@@ -5514,7 +5514,7 @@ void MDCache::prepare_realm_split(SnapRealm *realm, client_t client, inodeno_t i
 }
 
 void MDCache::prepare_realm_merge(SnapRealm *realm, SnapRealm *parent_realm,
-                                 map<client_t,MClientSnap::ref>& splits)
+                                 map<client_t,ref_t<MClientSnap>>& splits)
 {
   ceph_assert(parent_realm);
 
@@ -5544,7 +5544,7 @@ void MDCache::prepare_realm_merge(SnapRealm *realm, SnapRealm *parent_realm,
   }
 }
 
-void MDCache::send_snaps(map<client_t,MClientSnap::ref>& splits)
+void MDCache::send_snaps(map<client_t,ref_t<MClientSnap>>& splits)
 {
   dout(10) << "send_snaps" << dendl;
   
@@ -5766,7 +5766,7 @@ void MDCache::open_snaprealms()
        realm->open_parents(gather.new_sub())) {
       dout(10) << " past parents now open on " << *in << dendl;
 
-      map<client_t,MClientSnap::ref> splits;
+      map<client_t,ref_t<MClientSnap>> splits;
       // finish off client snaprealm reconnects?
       map<inodeno_t,map<client_t,snapid_t> >::iterator q = reconnected_snaprealms.find(in->ino());
       if (q != reconnected_snaprealms.end()) {
@@ -5919,7 +5919,7 @@ void MDCache::opened_undef_inode(CInode *in) {
 }
 
 void MDCache::finish_snaprealm_reconnect(client_t client, SnapRealm *realm, snapid_t seq,
-                                        map<client_t,MClientSnap::ref>& updates)
+                                        map<client_t,ref_t<MClientSnap>>& updates)
 {
   if (seq < realm->get_newest_seq()) {
     dout(10) << "finish_snaprealm_reconnect client." << client << " has old seq " << seq << " < " 
@@ -5974,7 +5974,7 @@ void MDCache::rejoin_send_acks()
   rejoin_unlinked_inodes.clear();
   
   // send acks to everyone in the recovery set
-  map<mds_rank_t,MMDSCacheRejoin::ref> acks;
+  map<mds_rank_t,ref_t<MMDSCacheRejoin>> acks;
   for (set<mds_rank_t>::iterator p = recovery_set.begin();
        p != recovery_set.end();
        ++p) {
@@ -8818,7 +8818,7 @@ void MDCache::handle_open_ino(const cref_t<MMDSOpenIno> &m, int err)
 
   auto from = mds_rank_t(m->get_source().num());
   inodeno_t ino = m->ino;
-  MMDSOpenInoReply::ref reply;
+  ref_t<MMDSOpenInoReply> reply;
   CInode *in = get_inode(ino);
   if (in) {
     dout(10) << " have " << *in << dendl;
@@ -9465,7 +9465,7 @@ void MDCache::do_realm_invalidate_and_update_notify(CInode *in, int snapop, bool
   }
 
   set<SnapRealm*> past_children;
-  map<client_t, MClientSnap::ref> updates;
+  map<client_t, ref_t<MClientSnap>> updates;
   list<SnapRealm*> q;
   q.push_back(in->snaprealm);
   while (!q.empty()) {
index 88a985f42e25775edbbd2068a8b5c7f955654b7b..29a1af01c6e144c2ca736f609c45224d4476344b 100644 (file)
@@ -124,7 +124,7 @@ class MDCache {
   using clock = ceph::coarse_mono_clock;
   using time = ceph::coarse_mono_time;
 
-  typedef std::map<mds_rank_t, MCacheExpire::ref> expiremap;
+  typedef std::map<mds_rank_t, ref_t<MCacheExpire>> expiremap;
 
   // my master
   MDSRank *mds;
@@ -622,7 +622,7 @@ protected:
   list<SimpleLock*> rejoin_eval_locks;
   MDSContext::vec rejoin_waiters;
 
-  void rejoin_walk(CDir *dir, const MMDSCacheRejoin::ref &rejoin);
+  void rejoin_walk(CDir *dir, const ref_t<MMDSCacheRejoin> &rejoin);
   void handle_cache_rejoin(const cref_t<MMDSCacheRejoin> &m);
   void handle_cache_rejoin_weak(const cref_t<MMDSCacheRejoin> &m);
   CInode* rejoin_invent_inode(inodeno_t ino, snapid_t last);
@@ -719,12 +719,12 @@ public:
   bool process_imported_caps();
   void choose_lock_states_and_reconnect_caps();
   void prepare_realm_split(SnapRealm *realm, client_t client, inodeno_t ino,
-                          map<client_t,MClientSnap::ref>& splits);
-  void prepare_realm_merge(SnapRealm *realm, SnapRealm *parent_realm, map<client_t,MClientSnap::ref>& splits);
-  void send_snaps(map<client_t,MClientSnap::ref>& splits);
+                          map<client_t,ref_t<MClientSnap>>& splits);
+  void prepare_realm_merge(SnapRealm *realm, SnapRealm *parent_realm, map<client_t,ref_t<MClientSnap>>& splits);
+  void send_snaps(map<client_t,ref_t<MClientSnap>>& splits);
   Capability* rejoin_import_cap(CInode *in, client_t client, const cap_reconnect_t& icr, mds_rank_t frommds);
   void finish_snaprealm_reconnect(client_t client, SnapRealm *realm, snapid_t seq,
-                                 map<client_t,MClientSnap::ref>& updates);
+                                 map<client_t,ref_t<MClientSnap>>& updates);
   Capability* try_reconnect_cap(CInode *in, Session *session);
   void export_remaining_imported_caps();
 
index 7b530e0cb1bf9f385aa9b92252b5999a2025a14d..4f31316009630a3825737253f93b4e6525308d98 100644 (file)
@@ -1136,7 +1136,7 @@ void MDSDaemon::respawn()
 
 
 
-bool MDSDaemon::ms_dispatch2(const Message::ref &m)
+bool MDSDaemon::ms_dispatch2(const ref_t<Message> &m)
 {
   std::lock_guard l(mds_lock);
   if (stopping) {
index c21c89cf03de316a5e35f261dac0678a91f82f8f..5f12dd14333a652031b4c882d05e0ea1b97cb04a 100644 (file)
@@ -105,7 +105,7 @@ class MDSDaemon : public Dispatcher, public md_config_obs_t {
   void wait_for_omap_osds();
 
  private:
-  bool ms_dispatch2(const Message::ref &m) override;
+  bool ms_dispatch2(const ref_t<Message> &m) override;
   bool ms_get_authorizer(int dest_type, AuthAuthorizer **authorizer) override;
   int ms_handle_authentication(Connection *con) override;
   KeyStore *ms_get_auth1_authorizer_keystore() override;
index 493b82127ba64d1da1e911bad336a5e0a0719f19..04677c9b957cfa6d90553222e911c9d3846fcd12 100644 (file)
@@ -346,7 +346,7 @@ void MDSTableServer::handle_mds_failure_or_stop(mds_rank_t who)
 
   active_clients.erase(who);
 
-  list<MMDSTableRequest::ref> rollback;
+  list<ref_t<MMDSTableRequest>> rollback;
   for (auto p = pending_notifies.begin(); p != pending_notifies.end(); ) {
     auto q = p++;
     if (q->second.mds == who) {
index 5851326f5dd10fd9493364c2798bb5b619d0ca6c..dfd88ae3034d161c42568b51b831c4d2753f75fa 100644 (file)
@@ -32,7 +32,7 @@ private:
   struct notify_info_t {
     set<mds_rank_t> notify_ack_gather;
     mds_rank_t mds;
-    MMDSTableRequest::ref reply;
+    ref_t<MMDSTableRequest> reply;
     MDSContext *onfinish;
     notify_info_t() : reply(NULL), onfinish(NULL) {}
   };
index 9c99076a8620714e858473517bc3fe699367cf22..56b87b26ac13a46cc766c5d1fa6a73f274348d4b 100644 (file)
@@ -371,7 +371,7 @@ void Server::reclaim_session(Session *session, const cref_t<MClientReclaim> &m)
   ceph_abort();
 }
 
-void Server::finish_reclaim_session(Session *session, const MClientReclaimReply::ref &reply)
+void Server::finish_reclaim_session(Session *session, const ref_t<MClientReclaimReply> &reply)
 {
   Session *target = session->reclaiming_from;
   if (target) {
@@ -1900,7 +1900,7 @@ void Server::early_reply(MDRequestRef& mdr, CInode *tracei, CDentry *tracedn)
  * include a trace to tracei
  * Clean up mdr
  */
-void Server::reply_client_request(MDRequestRef& mdr, const MClientReply::ref &reply)
+void Server::reply_client_request(MDRequestRef& mdr, const ref_t<MClientReply> &reply)
 {
   ceph_assert(mdr.get());
   const cref_t<MClientRequest> &req = mdr->client_request;
@@ -2012,7 +2012,7 @@ void Server::reply_client_request(MDRequestRef& mdr, const MClientReply::ref &re
  *
  * trace is in reverse order (i.e. root inode comes last)
  */
-void Server::set_trace_dist(Session *session, const MClientReply::ref &reply,
+void Server::set_trace_dist(Session *session, const ref_t<MClientReply> &reply,
                            CInode *in, CDentry *dn,
                            snapid_t snapid,
                            int dentry_wanted,
@@ -6390,9 +6390,9 @@ void Server::_committed_slave(MDRequestRef& mdr)
 
 struct C_MDS_LoggedLinkRollback : public ServerLogContext {
   MutationRef mut;
-  map<client_t,MClientSnap::ref> splits;
+  map<client_t,ref_t<MClientSnap>> splits;
   C_MDS_LoggedLinkRollback(Server *s, MutationRef& m, MDRequestRef& r,
-                          map<client_t,MClientSnap::ref>&& _splits) :
+                          map<client_t,ref_t<MClientSnap>>&& _splits) :
     ServerLogContext(s, r), mut(m), splits(std::move(_splits)) {
   }
   void finish(int r) override {
@@ -6448,7 +6448,7 @@ void Server::do_link_rollback(bufferlist &rbl, mds_rank_t master, MDRequestRef&
   else
     pi.inode.nlink++;
 
-  map<client_t,MClientSnap::ref> splits;
+  map<client_t,ref_t<MClientSnap>> splits;
   if (rollback.snapbl.length() && in->snaprealm) {
     bool hadrealm;
     auto p = rollback.snapbl.cbegin();
@@ -6483,7 +6483,7 @@ void Server::do_link_rollback(bufferlist &rbl, mds_rank_t master, MDRequestRef&
 }
 
 void Server::_link_rollback_finish(MutationRef& mut, MDRequestRef& mdr,
-                                  map<client_t,MClientSnap::ref>& splits)
+                                  map<client_t,ref_t<MClientSnap>>& splits)
 {
   dout(10) << "_link_rollback_finish" << dendl;
 
@@ -8722,7 +8722,7 @@ void Server::_logged_slave_rename(MDRequestRef& mdr,
   dout(10) << "_logged_slave_rename " << *mdr << dendl;
 
   // prepare ack
-  MMDSSlaveRequest::ref reply;
+  ref_t<MMDSSlaveRequest> reply;
   if (!mdr->aborted) {
     reply = MMDSSlaveRequest::create(mdr->reqid, mdr->attempt, MMDSSlaveRequest::OP_RENAMEPREPACK);
     if (!mdr->more()->slave_update_journaled)
@@ -8934,11 +8934,11 @@ struct C_MDS_LoggedRenameRollback : public ServerLogContext {
   version_t srcdnpv;
   CDentry *destdn;
   CDentry *straydn;
-  map<client_t,MClientSnap::ref> splits[2];
+  map<client_t,ref_t<MClientSnap>> splits[2];
   bool finish_mdr;
   C_MDS_LoggedRenameRollback(Server *s, MutationRef& m, MDRequestRef& r,
                             CDentry *sd, version_t pv, CDentry *dd, CDentry *st,
-                            map<client_t,MClientSnap::ref> _splits[2], bool f) :
+                            map<client_t,ref_t<MClientSnap>> _splits[2], bool f) :
     ServerLogContext(s, r), mut(m), srcdn(sd), srcdnpv(pv), destdn(dd),
     straydn(st), finish_mdr(f) {
       splits[0].swap(_splits[0]);
@@ -9051,7 +9051,7 @@ void Server::do_rename_rollback(bufferlist &rbl, mds_rank_t master, MDRequestRef
                                    rollback.orig_src.remote_d_type);
   }
 
-  map<client_t,MClientSnap::ref> splits[2];
+  map<client_t,ref_t<MClientSnap>> splits[2];
 
   CInode::mempool_inode *pip = nullptr;
   if (in) {
@@ -9262,7 +9262,7 @@ void Server::do_rename_rollback(bufferlist &rbl, mds_rank_t master, MDRequestRef
 
 void Server::_rename_rollback_finish(MutationRef& mut, MDRequestRef& mdr, CDentry *srcdn,
                                     version_t srcdnpv, CDentry *destdn, CDentry *straydn,
-                                    map<client_t,MClientSnap::ref> splits[2], bool finish_mdr)
+                                    map<client_t,ref_t<MClientSnap>> splits[2], bool finish_mdr)
 {
   dout(10) << "_rename_rollback_finish " << mut->reqid << dendl;
 
index b95676f1f769280b6b9b8622fc12dd1867a70823..c7f159adcf307e599c9baa165381078ba7ae0637 100644 (file)
@@ -156,7 +156,7 @@ public:
   size_t get_num_pending_reclaim() const { return client_reclaim_gather.size(); }
   Session *find_session_by_uuid(std::string_view uuid);
   void reclaim_session(Session *session, const cref_t<MClientReclaim> &m);
-  void finish_reclaim_session(Session *session, const MClientReclaimReply::ref &reply=nullptr);
+  void finish_reclaim_session(Session *session, const ref_t<MClientReclaimReply> &reply=nullptr);
   void handle_client_reclaim(const cref_t<MClientReclaim> &m);
 
   void reconnect_clients(MDSContext *reconnect_done_);
@@ -188,7 +188,7 @@ public:
   void perf_gather_op_latency(const cref_t<MClientRequest> &req, utime_t lat);
   void early_reply(MDRequestRef& mdr, CInode *tracei, CDentry *tracedn);
   void respond_to_request(MDRequestRef& mdr, int r = 0);
-  void set_trace_dist(Session *session, const MClientReply::ref &reply, CInode *in, CDentry *dn,
+  void set_trace_dist(Session *session, const ref_t<MClientReply> &reply, CInode *in, CDentry *dn,
                      snapid_t snapid,
                      int num_dentries_wanted,
                      MDRequestRef& mdr);
@@ -285,7 +285,7 @@ public:
   void handle_slave_link_prep_ack(MDRequestRef& mdr, const cref_t<MMDSSlaveRequest> &m);
   void do_link_rollback(bufferlist &rbl, mds_rank_t master, MDRequestRef& mdr);
   void _link_rollback_finish(MutationRef& mut, MDRequestRef& mdr,
-                            map<client_t,MClientSnap::ref>& split);
+                            map<client_t,ref_t<MClientSnap>>& split);
 
   // unlink
   void handle_client_unlink(MDRequestRef& mdr);
@@ -339,7 +339,7 @@ public:
   void _commit_slave_rename(MDRequestRef& mdr, int r, CDentry *srcdn, CDentry *destdn, CDentry *straydn);
   void do_rename_rollback(bufferlist &rbl, mds_rank_t master, MDRequestRef& mdr, bool finish_mdr=false);
   void _rename_rollback_finish(MutationRef& mut, MDRequestRef& mdr, CDentry *srcdn, version_t srcdnpv,
-                              CDentry *destdn, CDentry *staydn, map<client_t,MClientSnap::ref> splits[2],
+                              CDentry *destdn, CDentry *staydn, map<client_t,ref_t<MClientSnap>> splits[2],
                               bool finish_mdr);
 
   void evict_cap_revoke_non_responders();
@@ -347,7 +347,7 @@ public:
                           const std::set <std::string> &changed);
 
 private:
-  void reply_client_request(MDRequestRef& mdr, const MClientReply::ref &reply);
+  void reply_client_request(MDRequestRef& mdr, const ref_t<MClientReply> &reply);
   void flush_session(Session *session, MDSGatherBuilder *gather);
 
   DecayCounter recall_throttle;
index 84c21ceb587f6c2574381c1bf8964169257edb26..abcaab679d04562a801b5183a1e8156f564c0a2c 100644 (file)
@@ -175,7 +175,7 @@ public:
   entity_addr_t socket_addr;
   xlist<Session*>::item item_session_list;
 
-  list<Message::ref> preopen_out_queue;  ///< messages for client, queued before they connect
+  list<ref_t<Message>> preopen_out_queue;  ///< messages for client, queued before they connect
 
   elist<MDRequestImpl*> requests;
   size_t get_request_count();
index 2893d7e598131829c3418ae50602d0cf5046eba9..d44c4ab1949c5ac9549f302b3b6c7e059eeec919 100644 (file)
@@ -1866,7 +1866,7 @@ void ETableServer::replay(MDSRank *mds)
     break;
   }
   case TABLESERVER_OP_COMMIT:
-    server->_commit(tid, MMDSTableRequest::ref());
+    server->_commit(tid, ref_t<MMDSTableRequest>());
     server->_note_commit(tid, true);
     break;
   case TABLESERVER_OP_ROLLBACK:
index f3d4936a529fc2472230b04959bc8ec139f05f7c..3de1f00a503a47c784c9a5ab882054bfd73c9c97 100644 (file)
@@ -36,7 +36,7 @@ double DispatchQueue::get_max_age(utime_t now) const {
     return (now - marrival.begin()->first);
 }
 
-uint64_t DispatchQueue::pre_dispatch(const Message::ref& m)
+uint64_t DispatchQueue::pre_dispatch(const ref_t<Message>& m)
 {
   ldout(cct,1) << "<== " << m->get_source_inst()
               << " " << m->get_seq()
@@ -55,7 +55,7 @@ uint64_t DispatchQueue::pre_dispatch(const Message::ref& m)
   return msize;
 }
 
-void DispatchQueue::post_dispatch(const Message::ref& m, uint64_t msize)
+void DispatchQueue::post_dispatch(const ref_t<Message>& m, uint64_t msize)
 {
   dispatch_throttle_release(msize);
   ldout(cct,20) << "done calling dispatch on " << m << dendl;
@@ -66,19 +66,19 @@ bool DispatchQueue::can_fast_dispatch(const cref_t<Message> &m) const
   return msgr->ms_can_fast_dispatch(m);
 }
 
-void DispatchQueue::fast_dispatch(const Message::ref& m)
+void DispatchQueue::fast_dispatch(const ref_t<Message>& m)
 {
   uint64_t msize = pre_dispatch(m);
   msgr->ms_fast_dispatch(m);
   post_dispatch(m, msize);
 }
 
-void DispatchQueue::fast_preprocess(const Message::ref& m)
+void DispatchQueue::fast_preprocess(const ref_t<Message>& m)
 {
   msgr->ms_fast_preprocess(m);
 }
 
-void DispatchQueue::enqueue(const Message::ref& m, int priority, uint64_t id)
+void DispatchQueue::enqueue(const ref_t<Message>& m, int priority, uint64_t id)
 {
   Mutex::Locker l(lock);
   if (stop) {
@@ -94,7 +94,7 @@ void DispatchQueue::enqueue(const Message::ref& m, int priority, uint64_t id)
   cond.Signal();
 }
 
-void DispatchQueue::local_delivery(const Message::ref& m, int priority)
+void DispatchQueue::local_delivery(const ref_t<Message>& m, int priority)
 {
   m->set_recv_stamp(ceph_clock_now());
   Mutex::Locker l(local_delivery_lock);
@@ -117,7 +117,7 @@ void DispatchQueue::run_local_delivery()
     auto p = std::move(local_messages.front());
     local_messages.pop();
     local_delivery_lock.Unlock();
-    const Message::ref& m = p.first;
+    const ref_t<Message>& m = p.first;
     int priority = p.second;
     fast_preprocess(m);
     if (can_fast_dispatch(m)) {
@@ -189,7 +189,7 @@ void DispatchQueue::entry()
          ceph_abort();
        }
       } else {
-       const Message::ref& m = qitem.get_message();
+       const ref_t<Message>& m = qitem.get_message();
        if (stop) {
          ldout(cct,10) << " stop flag set, discarding " << m << " " << *m << dendl;
        } else {
@@ -218,7 +218,7 @@ void DispatchQueue::discard_queue(uint64_t id) {
        i != removed.end();
        ++i) {
     ceph_assert(!(i->is_code())); // We don't discard id 0, ever!
-    const Message::ref& m = i->get_message();
+    const ref_t<Message>& m = i->get_message();
     remove_arrival(m);
     dispatch_throttle_release(m->get_dispatch_throttle_size());
   }
index 89cbd690fb39b556910a64215460d14481f0405e..77a65f005ae205b7c2bbd2f37bdde8c1830276bb 100644 (file)
@@ -331,7 +331,7 @@ Message *decode_message(CephContext *cct, int crcflags,
   }
 
   // make message
-  Message::ref m;
+  ref_t<Message> m;
   int type = header.type;
   switch (type) {
 
index 6763716c945d75ff2b7aeabc4bff3926fb21f9d8..77aa76136bfb33c4d17b5c950d9fee0ad7fabdc5 100644 (file)
@@ -656,7 +656,7 @@ public:
    * @param m The Message we are fast dispatching.
    * If none of our Dispatchers can handle it, ceph_abort().
    */
-  void ms_fast_dispatch(const Message::ref &m) {
+  void ms_fast_dispatch(const ref_t<Message> &m) {
     m->set_dispatch_stamp(ceph_clock_now());
     for (const auto &dispatcher : fast_dispatchers) {
       if (dispatcher->ms_can_fast_dispatch2(m)) {
@@ -667,12 +667,12 @@ public:
     ceph_abort();
   }
   void ms_fast_dispatch(Message *m) {
-    return ms_fast_dispatch(Message::ref(m, false)); /* consume ref */
+    return ms_fast_dispatch(ref_t<Message>(m, false)); /* consume ref */
   }
   /**
    *
    */
-  void ms_fast_preprocess(const Message::ref &m) {
+  void ms_fast_preprocess(const ref_t<Message> &m) {
     for (const auto &dispatcher : fast_dispatchers) {
       dispatcher->ms_fast_preprocess2(m);
     }
@@ -684,7 +684,7 @@ public:
    *
    *  @param m The Message to deliver.
    */
-  void ms_deliver_dispatch(const Message::ref &m) {
+  void ms_deliver_dispatch(const ref_t<Message> &m) {
     m->set_dispatch_stamp(ceph_clock_now());
     for (const auto &dispatcher : dispatchers) {
       if (dispatcher->ms_dispatch2(m))
@@ -695,7 +695,7 @@ public:
     ceph_assert(!cct->_conf->ms_die_on_unhandled_msg);
   }
   void ms_deliver_dispatch(Message *m) {
-    return ms_deliver_dispatch(Message::ref(m, false)); /* consume ref */
+    return ms_deliver_dispatch(ref_t<Message>(m, false)); /* consume ref */
   }
   /**
    * Notify each Dispatcher of a new Connection. Call
index 1f201ea78d09800e817176606358f40de713f9d6..18f9262b96eb51860558315846f2e3f52e93d9ec 100644 (file)
@@ -214,8 +214,8 @@ public:
 
 template<class T>
 class MessageDencoderImpl : public Dencoder {
-  typename T::ref m_object;
-  list<typename T::ref> m_list;
+  ref_t<T> m_object;
+  list<ref_t<T>> m_list;
 
 public:
   MessageDencoderImpl() : m_object(T::create()) {}
@@ -225,7 +225,7 @@ public:
     auto p = bl.cbegin();
     p.seek(seek);
     try {
-      Message::ref n(decode_message(g_ceph_context, 0, p), false);
+      ref_t<Message> n(decode_message(g_ceph_context, 0, p), false);
       if (!n)
        throw std::runtime_error("failed to decode");
       if (n->get_type() != m_object->get_type()) {