From: Sage Weil Date: Mon, 19 Feb 2018 14:43:11 +0000 (-0600) Subject: osdc/Objecter: allow multiple ops to be canceled atomically X-Git-Tag: v12.2.5~87^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b696021856cf31f9ab34998c7869b222c8461173;p=ceph.git 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) --- diff --git a/src/osdc/Objecter.cc b/src/osdc/Objecter.cc index 16c5b325bde0..e7326eda42f2 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 87ace75699ac..7709607ef173 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