From: John Spray Date: Tue, 31 Mar 2015 12:20:24 +0000 (+0100) Subject: osdc/Objecter: op_cancel_writes return whether anything cancelled X-Git-Tag: v9.0.2~156^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=dbf697d2460ef1febcc31707aa6851646ceecdb2;p=ceph.git osdc/Objecter: op_cancel_writes return whether anything cancelled ...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 --- diff --git a/src/osdc/Objecter.cc b/src/osdc/Objecter.cc index c7910a992d33..93768c0e74b1 100644 --- a/src/osdc/Objecter.cc +++ b/src/osdc/Objecter.cc @@ -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( diff --git a/src/osdc/Objecter.h b/src/osdc/Objecter.h index 050f2f3dd872..baf902f4ccca 100644 --- a/src/osdc/Objecter.h +++ b/src/osdc/Objecter.h @@ -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