]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds/MDSMap: drop trailing else in favor of early return
authorSage Weil <sage@redhat.com>
Wed, 13 Aug 2014 22:03:03 +0000 (15:03 -0700)
committerSage Weil <sage@redhat.com>
Wed, 13 Aug 2014 22:03:03 +0000 (15:03 -0700)
This keeps the old-version special cases in one place and make it obvious
what the current/forward-looking path is.

Signed-off-by: Sage Weil <sage@redhat.com>
src/mds/MDSMap.cc

index c015370fa7ffeea3c2d5300a47b42786310b0548..8a25d55cde1d8a8a13c7bfda09b5db386b43c23c 100644 (file)
@@ -477,41 +477,42 @@ void MDSMap::encode(bufferlist& bl, uint64_t features) const
     ::encode(failed, bl);
     ::encode(stopped, bl);
     ::encode(last_failure_osd_epoch, bl);
-  } else {// have MDS encoding feature!
-    ENCODE_START(5, 5, bl);
-    ::encode(epoch, bl);
-    ::encode(flags, bl);
-    ::encode(last_failure, bl);
-    ::encode(root, bl);
-    ::encode(session_timeout, bl);
-    ::encode(session_autoclose, bl);
-    ::encode(max_file_size, bl);
-    ::encode(max_mds, bl);
-    ::encode(mds_info, bl, features);
-    ::encode(data_pools, bl);
-    ::encode(cas_pool, bl);
-    ::encode(enabled, bl);
-    ::encode(fs_name, bl);
-
-    // kclient ignores everything from here
-    __u16 ev = 7;
-    ::encode(ev, bl);
-    ::encode(compat, bl);
-    ::encode(metadata_pool, bl);
-    ::encode(created, bl);
-    ::encode(modified, bl);
-    ::encode(tableserver, bl);
-    ::encode(in, bl);
-    ::encode(inc, bl);
-    ::encode(up, bl);
-    ::encode(failed, bl);
-    ::encode(stopped, bl);
-    ::encode(last_failure_osd_epoch, bl);
-    ::encode(ever_allowed_snaps, bl);
-    ::encode(explicitly_allowed_snaps, bl);
-    ::encode(inline_data_enabled, bl);
-    ENCODE_FINISH(bl);
+    return;
   }
+
+  ENCODE_START(5, 5, bl);
+  ::encode(epoch, bl);
+  ::encode(flags, bl);
+  ::encode(last_failure, bl);
+  ::encode(root, bl);
+  ::encode(session_timeout, bl);
+  ::encode(session_autoclose, bl);
+  ::encode(max_file_size, bl);
+  ::encode(max_mds, bl);
+  ::encode(mds_info, bl, features);
+  ::encode(data_pools, bl);
+  ::encode(cas_pool, bl);
+  ::encode(enabled, bl);
+  ::encode(fs_name, bl);
+
+  // kclient ignores everything from here
+  __u16 ev = 7;
+  ::encode(ev, bl);
+  ::encode(compat, bl);
+  ::encode(metadata_pool, bl);
+  ::encode(created, bl);
+  ::encode(modified, bl);
+  ::encode(tableserver, bl);
+  ::encode(in, bl);
+  ::encode(inc, bl);
+  ::encode(up, bl);
+  ::encode(failed, bl);
+  ::encode(stopped, bl);
+  ::encode(last_failure_osd_epoch, bl);
+  ::encode(ever_allowed_snaps, bl);
+  ::encode(explicitly_allowed_snaps, bl);
+  ::encode(inline_data_enabled, bl);
+  ENCODE_FINISH(bl);
 }
 
 void MDSMap::decode(bufferlist::iterator& p)