From b696021856cf31f9ab34998c7869b222c8461173 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 19 Feb 2018 08:43:11 -0600 Subject: [PATCH] osdc/Objecter: allow multiple ops to be canceled atomically This allows multiple cancellations without worrying about a race with an (objecter) osdmap update. Signed-off-by: Sage Weil (cherry picked from commit 7459d4a4794eb092cdc3ee06af12b782c892193d) --- src/osdc/Objecter.cc | 10 ++++++++++ src/osdc/Objecter.h | 1 + 2 files changed, 11 insertions(+) diff --git a/src/osdc/Objecter.cc b/src/osdc/Objecter.cc index 16c5b325bde04..e7326eda42f20 100644 --- a/src/osdc/Objecter.cc +++ b/src/osdc/Objecter.cc @@ -2532,6 +2532,16 @@ int Objecter::op_cancel(ceph_tid_t tid, int r) return ret; } +int Objecter::op_cancel(const vector& 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; diff --git a/src/osdc/Objecter.h b/src/osdc/Objecter.h index 87ace75699ace..7709607ef1734 100644 --- a/src/osdc/Objecter.h +++ b/src/osdc/Objecter.h @@ -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& tidls, int r); /** * Any write op which is in progress at the start of this call shall no -- 2.39.5