]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Objecter.cc: make op resend logic more readable 25718/head
authorSong Shun <song.shun3@zte.com.cn>
Wed, 19 Dec 2018 02:55:43 +0000 (10:55 +0800)
committerAshish Singh <assingh@redhat.com>
Fri, 28 Dec 2018 16:49:58 +0000 (22:19 +0530)
  make op resend logic more readable
  according to discussion at https://github.com/ceph/ceph/pull/25243

Signed-off-by: Song Shun <song.shun3@zte.com.cn>
(cherry picked from commit 2428f50ee8289769e1d89d89269803152f0ebc57)

src/osdc/Objecter.cc

index 485e96d99bd2a4d27dbe38acd23a6df3f947140a..f4ff6760cffc54e9dcc7fa8d70582f523df757dd 100644 (file)
@@ -2893,13 +2893,12 @@ int Objecter::_calc_target(op_target_t *t, Connection *con, bool any_change)
     force_resend = true;
   }
 
-  bool unpaused = !target_should_be_paused(t);
-  if (t->paused && unpaused) {
-    t->paused = false;
-  } else {
-    t->paused = !unpaused;
-    unpaused = false;
+  bool unpaused = false;
+  bool should_be_paused = target_should_be_paused(t);
+  if (t->paused && !should_be_paused) {
+    unpaused = true;
   }
+  t->paused = should_be_paused;
 
   bool legacy_change =
     t->pgid != pgid ||