]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
transaction start/end stubs
authorSage Weil <sage@newdream.net>
Tue, 22 Apr 2008 00:17:22 +0000 (17:17 -0700)
committerSage Weil <sage@newdream.net>
Tue, 22 Apr 2008 18:08:16 +0000 (11:08 -0700)
src/osd/FakeStore.h
src/osd/ObjectStore.h

index b5747f1a4bad0aac9eba8c7bffafb0b929e31fcd..f9e02db29eeb699680035cb33187a24198e44234 100644 (file)
@@ -38,6 +38,8 @@ class FakeStore : public JournalingObjectStore {
   string basedir;
   __u64 fsid;
   
+  bool btrfs;
+
   // fake attrs?
   FakeStoreAttrs attrs;
   bool fake_attrs;
@@ -72,6 +74,7 @@ class FakeStore : public JournalingObjectStore {
  public:
   FakeStore(const char *base) : 
     basedir(base),
+    btrfs(false),
     attrs(this), fake_attrs(false), 
     collections(this), fake_collections(false),
     stop(false), sync_thread(this) { }
index 94a9b87cf7481075a372439df609d6b0f13c0163..68fa306d1b35a16bd10365001762a07bb99f6732 100644 (file)
@@ -318,13 +318,15 @@ public:
     }
   };
 
-
-
-  /* this implementation is here only for naive ObjectStores that
-   * do not do atomic transactions natively.  it is not atomic.
+  /*
+   * these stubs should be implemented if we want to use the
+   * apply_transaction() below and we want atomic transactions.
    */
+  virtual int transaction_start() { return 0; }
+  virtual void transaction_end(int id) { }
   virtual unsigned apply_transaction(Transaction& t, Context *onsafe=0) {
     // non-atomic implementation
+    int id = transaction_start();
     while (t.have_op()) {
       int op = t.get_op();
       switch (op) {
@@ -528,6 +530,7 @@ public:
         assert(0);
       }
     }
+    transaction_end(id);
 
     if (onsafe) sync(onsafe);