From: John Spray Date: Tue, 31 Mar 2015 12:00:41 +0000 (+0100) Subject: osdc/Objecter: allow per-pool calls to op_cancel_writes X-Git-Tag: v9.0.2~156^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1d2290ea74020df067d2112aff961de785205c8d;p=ceph.git osdc/Objecter: allow per-pool calls to op_cancel_writes For when CephFS client needs to handle a particular pool being full. Signed-off-by: John Spray --- diff --git a/src/osdc/Objecter.cc b/src/osdc/Objecter.cc index 4987a92d75c5..c7910a992d33 100644 --- a/src/osdc/Objecter.cc +++ b/src/osdc/Objecter.cc @@ -2304,7 +2304,7 @@ start: * * @return the latest possible epoch in which a cancelled op could have existed */ -epoch_t Objecter::op_cancel_writes(int r) +epoch_t Objecter::op_cancel_writes(int r, int64_t pool) { rwlock.get_write(); @@ -2314,7 +2314,8 @@ epoch_t Objecter::op_cancel_writes(int r) OSDSession *s = siter->second; s->lock.get_read(); for (map::iterator op_i = s->ops.begin(); op_i != s->ops.end(); ++op_i) { - if (op_i->second->target.flags & CEPH_OSD_FLAG_WRITE) { + if (op_i->second->target.flags & CEPH_OSD_FLAG_WRITE + && (pool == -1 || op_i->second->target.target_oloc.pool == pool)) { to_cancel.push_back(op_i->first); } } diff --git a/src/osdc/Objecter.h b/src/osdc/Objecter.h index 478c16661b45..050f2f3dd872 100644 --- a/src/osdc/Objecter.h +++ b/src/osdc/Objecter.h @@ -1993,7 +1993,7 @@ private: friend class C_CancelOp; public: int op_cancel(ceph_tid_t tid, int r); - epoch_t op_cancel_writes(int r); + epoch_t op_cancel_writes(int r, int64_t pool=-1); // commands int osd_command(int osd, vector& cmd,