]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
filestore: queue_transaction and generic C_DeleteTransaction
authorSage Weil <sage@newdream.net>
Wed, 27 Jan 2010 18:49:30 +0000 (10:49 -0800)
committerSage Weil <sage@newdream.net>
Wed, 27 Jan 2010 18:49:30 +0000 (10:49 -0800)
src/TODO
src/os/FileStore.cc
src/os/ObjectStore.h

index 1ed636879763274586a3abfad8e3eb8eb7be6241..4250f448052e9795b61c9b7c79c7895e2a176e6a 100644 (file)
--- a/src/TODO
+++ b/src/TODO
@@ -53,6 +53,9 @@ v0.19
 filestore
 - need to check per-object state for conflicting reads and unapplied writes
 - use want_delayed(), want_rmw() to toggle delayed/rmw mode?  or just for rmw->delayed transition?
+- audit queue_transaction calls for dependencies
+- convert apply_transaction calls in handle_map to queue?
+  - need an osdmap cache layer?
 
 pending wire format changes
 /- include a __u64 tid in ceph_msg_header
index 99b88ceaf9114fd53279e52ec76286912dec6bb1..48872e097aa52c83dc8d73dffeb22cad2b707368 100644 (file)
@@ -592,19 +592,11 @@ struct C_JournaledAhead : public Context {
   }
 };
 
-struct C_DeleteTrans : public Context {
-  ObjectStore::Transaction *t;
-  C_DeleteTrans(ObjectStore::Transaction *tt) : t(tt) {}
-  void finish(int r) {
-    delete t;
-  }
-};
-
 int FileStore::queue_transaction(Transaction *t)
 {
   list<Transaction*> tls;
   tls.push_back(t);
-  return queue_transactions(tls, new C_DeleteTrans(t));
+  return queue_transactions(tls, new C_DeleteTransaction(t));
 }
 
 int FileStore::queue_transactions(list<Transaction*> &tls,
index 9bc6af22214580d1b0d16ac7286d8f39f814186d..b29f3c52add3a293479da9d45e8fa0eab1bb0f32 100644 (file)
@@ -416,10 +416,24 @@ public:
     }
   };
 
+  struct C_DeleteTransaction : public Context {
+    ObjectStore::Transaction *t;
+    C_DeleteTransaction(ObjectStore::Transaction *tt) : t(tt) {}
+    void finish(int r) {
+      delete t;
+    }
+  };
+
+
   virtual unsigned apply_transaction(Transaction& t, Context *onjournal=0, Context *ondisk=0) = 0;
   virtual unsigned apply_transactions(list<Transaction*>& tls, Context *onjournal=0, Context *ondisk=0) = 0;
 
   virtual int queue_transaction(Transaction* t) = 0;
+  virtual int queue_transaction(Transaction *t, Context *onreadable, Context *onjournal=0, Context *ondisk=0) {
+    list<Transaction*> tls;
+    tls.push_back(t);
+    return queue_transactions(tls, onreadable, onjournal, ondisk);
+  }
   virtual int queue_transactions(list<Transaction*>& tls, Context *onreadable,
                                 Context *onjournal=0, Context *ondisk=0) = 0;