]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osdc/Objecter: allow multiple ops to be canceled atomically
authorSage Weil <sage@redhat.com>
Mon, 19 Feb 2018 14:43:11 +0000 (08:43 -0600)
committerPrashant D <pdhange@redhat.com>
Tue, 27 Feb 2018 05:55:49 +0000 (00:55 -0500)
This allows multiple cancellations without worrying about a race with an
(objecter) osdmap update.

Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit 7459d4a4794eb092cdc3ee06af12b782c892193d)

src/osdc/Objecter.cc
src/osdc/Objecter.h

index 16c5b325bde041813cd1e4600a48762de0999f9b..e7326eda42f206008c101860754f196fb15158e1 100644 (file)
@@ -2532,6 +2532,16 @@ int Objecter::op_cancel(ceph_tid_t tid, int r)
   return ret;
 }
 
+int Objecter::op_cancel(const vector<ceph_tid_t>& tids, int r)
+{
+  unique_lock wl(rwlock);
+  ldout(cct,10) << __func__ << " " << tids << dendl;
+  for (auto tid : tids) {
+    _op_cancel(tid, r);
+  }
+  return 0;
+}
+
 int Objecter::_op_cancel(ceph_tid_t tid, int r)
 {
   int ret = 0;
index 87ace75699acee5b19b06140c57d5bb3dd07bbc3..7709607ef17349b42332b73495c9a5ec76aac6d8 100644 (file)
@@ -2187,6 +2187,7 @@ private:
   int _op_cancel(ceph_tid_t tid, int r);
 public:
   int op_cancel(ceph_tid_t tid, int r);
+  int op_cancel(const vector<ceph_tid_t>& tidls, int r);
 
   /**
    * Any write op which is in progress at the start of this call shall no