]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
client: cleanup the handle_mds_map() code 38326/head
authorXiubo Li <xiubli@redhat.com>
Fri, 27 Nov 2020 03:19:28 +0000 (11:19 +0800)
committerXiubo Li <xiubli@redhat.com>
Mon, 30 Nov 2020 03:01:00 +0000 (11:01 +0800)
Signed-off-by: Xiubo Li <xiubli@redhat.com>
src/client/Client.cc

index 00eb11789f1ec656ac7c1066c145d867dba0fafd..4320aebbc8e29739ad9599f619a6d4be077f3c09 100644 (file)
@@ -2776,8 +2776,6 @@ void Client::cancel_commands(const MDSMap& newmap)
 
 void Client::handle_mds_map(const MConstRef<MMDSMap>& m)
 {
-  mds_gid_t old_inc, new_inc;
-
   std::unique_lock cl(client_lock);
   if (m->get_epoch() <= mdsmap->get_epoch()) {
     ldout(cct, 1) << __func__ << " epoch " << m->get_epoch()
@@ -2806,8 +2804,8 @@ void Client::handle_mds_map(const MConstRef<MMDSMap>& m)
     if (!mdsmap->is_up(mds)) {
       session->con->mark_down();
     } else if (mdsmap->get_addrs(mds) != session->addrs) {
-      old_inc = _mdsmap->get_incarnation(mds);
-      new_inc = mdsmap->get_incarnation(mds);
+      auto old_inc = _mdsmap->get_incarnation(mds);
+      auto new_inc = mdsmap->get_incarnation(mds);
       if (old_inc != new_inc) {
         ldout(cct, 1) << "mds incarnation changed from "
                      << old_inc << " to " << new_inc << dendl;
@@ -15149,7 +15147,7 @@ void intrusive_ptr_add_ref(Inode *in)
 {
   in->get();
 }
-               
+
 void intrusive_ptr_release(Inode *in)
 {
   in->client->put_inode(in);