]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: reduce variable scope
authorPatrick Donnelly <pdonnell@redhat.com>
Tue, 3 Oct 2017 19:23:03 +0000 (12:23 -0700)
committerPatrick Donnelly <pdonnell@redhat.com>
Tue, 3 Oct 2017 19:23:03 +0000 (12:23 -0700)
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
src/mds/FSMap.cc

index 95e78b23425734faa591dd765eb74147f3c60e71..cf72ce040ec9319f487704a73f056ea45d2c8abc 100644 (file)
@@ -431,17 +431,17 @@ void FSMap::encode(bufferlist& bl, uint64_t features) const
 
 void FSMap::decode(bufferlist::iterator& p)
 {
-  // Because the mon used to store an MDSMap where we now
-  // store an FSMap, FSMap knows how to decode the legacy
-  // MDSMap format (it never needs to encode it though).
-  MDSMap legacy_mds_map;
-  
   // The highest MDSMap encoding version before we changed the
   // MDSMonitor to store an FSMap instead of an MDSMap was
   // 5, so anything older than 6 is decoded as an MDSMap,
   // and anything newer is decoded as an FSMap.
   DECODE_START_LEGACY_COMPAT_LEN_16(7, 4, 4, p);
   if (struct_v < 6) {
+    // Because the mon used to store an MDSMap where we now
+    // store an FSMap, FSMap knows how to decode the legacy
+    // MDSMap format (it never needs to encode it though).
+    MDSMap legacy_mds_map;
+
     // Decoding an MDSMap (upgrade)
     ::decode(epoch, p);
     ::decode(legacy_mds_map.flags, p);