]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
objecter: add hook to get notification on new osdmap
authorSage Weil <sage@newdream.net>
Fri, 12 Jun 2009 19:58:24 +0000 (12:58 -0700)
committerSage Weil <sage@newdream.net>
Fri, 12 Jun 2009 19:58:24 +0000 (12:58 -0700)
src/osdc/Objecter.cc
src/osdc/Objecter.h

index baaf349b388e8b470c5e3a40032c0ca7f4f2dd53..a91603ae13bba2dbf0cece3976b19a9f76f698c0 100644 (file)
@@ -177,6 +177,8 @@ void Objecter::handle_osd_map(MOSDMap *m)
       kick_requests(changed_pgs);
   }
   
+  finish_contexts(waiting_for_map);
+
   delete m;
 }
 
index 9a26d5d1ed303935d053eb562c38ce2dd923ea28..3b729eef8d794e4cb090d491e5e3173031c92c50 100644 (file)
@@ -265,6 +265,8 @@ class Objecter {
   map<tid_t,PoolStatOp*>    op_poolstat;
   map<tid_t,StatfsOp*>      op_statfs;
 
+  list<Context*> waiting_for_map;
+
   /**
    * track pending ops by pg
    *  ...so we can cope with failures, map changes
@@ -336,6 +338,10 @@ private:
   int get_client_incarnation() const { return client_inc; }
   void set_client_incarnation(int inc) { client_inc = inc; }
 
+  void wait_for_new_map(Context *c) {
+    waiting_for_map.push_back(c);
+  }
+
   // mid-level helpers
   tid_t mutate(const object_t& oid, ceph_object_layout ol, 
               ObjectOperation& op,