]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osdc/Objecter: allow per-pool calls to op_cancel_writes
authorJohn Spray <john.spray@redhat.com>
Tue, 31 Mar 2015 12:00:41 +0000 (13:00 +0100)
committerJohn Spray <john.spray@redhat.com>
Tue, 12 May 2015 09:20:13 +0000 (10:20 +0100)
For when CephFS client needs to handle a particular pool
being full.

Signed-off-by: John Spray <john.spray@redhat.com>
src/osdc/Objecter.cc
src/osdc/Objecter.h

index 4987a92d75c5bb52f97264ba159503a5823ac12a..c7910a992d33913b29b4e571f6adcc8b1291b6ad 100644 (file)
@@ -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<ceph_tid_t, Op*>::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);
       }
     }
index 478c16661b45a994444ee628d303a4253e9a62e9..050f2f3dd8721658c5fe134e39a6e9d94b87ab30 100644 (file)
@@ -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<string>& cmd,