]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osdc/Objecter: op_cancel_writes return whether anything cancelled
authorJohn Spray <john.spray@redhat.com>
Tue, 31 Mar 2015 12:20:24 +0000 (13:20 +0100)
committerJohn Spray <john.spray@redhat.com>
Tue, 12 May 2015 09:20:14 +0000 (10:20 +0100)
...so that caller knows whether it's really necessary for
them to barrier subsequent operations on the OSD map epoch.

Signed-off-by: John Spray <john.spray@redhat.com>
src/osdc/Objecter.cc
src/osdc/Objecter.h

index c7910a992d33913b29b4e571f6adcc8b1291b6ad..93768c0e74b101985b1f73d40b3c7e5f15d6fdcf 100644 (file)
@@ -2332,7 +2332,11 @@ epoch_t Objecter::op_cancel_writes(int r, int64_t pool)
 
   rwlock.unlock();
 
-  return epoch;
+  if (to_cancel.size()) {
+    return epoch;
+  } else {
+    return -1;
+  }
 }
 
 bool Objecter::is_pg_changed(
index 050f2f3dd8721658c5fe134e39a6e9d94b87ab30..baf902f4cccad18484541c2f34288cd417c9db1f 100644 (file)
@@ -1993,6 +1993,15 @@ private:
   friend class C_CancelOp;
 public:
   int op_cancel(ceph_tid_t tid, int r);
+
+  /**
+   * Any write op which is in progress at the start of this call shall no
+   * longer be in progress when this call ends.  Operations started after the
+   * start of this call may still be in progress when this call ends.
+   *
+   * @return the latest possible epoch in which a cancelled op could have
+   *         existed, or -1 if nothing was cancelled.
+   */
   epoch_t op_cancel_writes(int r, int64_t pool=-1);
 
   // commands