]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
More normal state...not that everything works yet but better
authoranwleung <anwleung@29311d96-e01e-0410-9327-a35deaab8ce9>
Thu, 1 Mar 2007 03:55:38 +0000 (03:55 +0000)
committeranwleung <anwleung@29311d96-e01e-0410-9327-a35deaab8ce9>
Thu, 1 Mar 2007 03:55:38 +0000 (03:55 +0000)
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1145 29311d96-e01e-0410-9327-a35deaab8ce9

branches/aleung/security1/ceph/crypto/ExtCap.h
branches/aleung/security1/ceph/include/object.h
branches/aleung/security1/ceph/osd/OSD.cc
branches/aleung/security1/ceph/osdc/ObjectCacher.cc
branches/aleung/security1/ceph/osdc/ObjectCacher.h

index 1d53dbc3e2927be7fd436e2381c4e797b824c295..78355dc08d22dccf1501d5a830c09e34cfd103a0 100644 (file)
@@ -23,7 +23,6 @@ using namespace std;
 #include "crypto/CryptoLib.h"
 using namespace CryptoLib;
 
-#include "common/Clock.h"
 
 class ExtCap {
 private:
index 4221ee81a66e6e4f169d89c4ec7aeb5325eaca8c..3a66c4ab83d540440a6a21a6e353c1ec2bf31299 100644 (file)
@@ -18,8 +18,6 @@
 #include <iomanip>
 using namespace std;
 
-#include "crypto/ExtCap.h"
-
 
 typedef __uint32_t objectrev_t;
 
index d9058101b13d0a650425851dce0cc3aaa6194a67..89236f30769bf2444e86da09e9cc146a910cf277 100644 (file)
@@ -2861,7 +2861,7 @@ void OSD::op_read(MOSDOp *op)//, PG *pg)
   // verify the capability
   ExtCap *op_capability = op->get_capability();
   if (op_capability) {
-    cout << "OSD recieved a capability" << endl;
+    cout << "OSD recieved a read capability" << endl;
     if (op_capability->verif_extcap(monmap->get_key()))
       cout << "OSD successfully verified capability" << endl;
     else
index 8e1f0c0176a4501f2770f9890699341b91067e7d..32d6f31a4773af134fcdaa2685ed7444cecec456 100644 (file)
@@ -356,7 +356,7 @@ ObjectCacher::BufferHead *ObjectCacher::Object::map_write(Objecter::OSDWrite *wr
         left -= glen;
         continue;    // more?
       }
-s    }
+    }
   }
   
   // set versoin
@@ -454,14 +454,16 @@ void ObjectCacher::bh_read_finish(object_t oid, off_t start, size_t length, buff
 }
 
 
-void ObjectCacher::bh_write(BufferHead *bh, ExtCap *write_cap)
+void ObjectCacher::bh_write(BufferHead *bh)
 {
   dout(7) << "bh_write " << *bh << endl;
   
   // finishers
   C_WriteAck *onack = new C_WriteAck(this, bh->ob->get_oid(), bh->start(), bh->length());
   C_WriteCommit *oncommit = new C_WriteCommit(this, bh->ob->get_oid(), bh->start(), bh->length());
-
+  
+  // get security cap
+  ExtCap *write_cap = bh->bh_cap;
   // go
   tid_t tid = objecter->write(bh->ob->get_oid(), bh->start(), bh->length(), bh->bl,
                               onack, oncommit, write_cap);
@@ -1274,9 +1276,7 @@ bool ObjectCacher::flush(Object *ob)
       continue;
     }
     if (!bh->is_dirty()) continue;
-    // get capability for write back
-    ExtCap *write_cap = ob->ocap;
-    bh_write(bh, write_cap);
+    bh_write(bh);
     clean = false;
   }
   return clean;
index aa45b1ac206aa92e09d01ba8a5152f2c411a915d..641dc44a311e9e5069f44a9cd6692a75c8086cca 100644 (file)
@@ -351,7 +351,8 @@ class ObjectCacher {
 
   // io
   void bh_read(BufferHead *bh, ExtCap* read_ext_cap=0);
-  void bh_write(BufferHead *bh, ExtCap *write_cap=0);
+  // doesn't need a cap (cap is in bh)
+  void bh_write(BufferHead *bh);
 
   void trim(off_t max=-1);
   void flush(off_t amount=0);
@@ -536,10 +537,11 @@ class ObjectCacher {
                              Mutex &lock, ExtCap *write_ext_cap=0,
                                                         objectrev_t rev=0) {
     // we really should always have a cap
+    Objecter::OSDWrite *wr;
     if (write_ext_cap != 0)
-      Objecter::OSDWrite *wr = new Objecter::OSDWrite(bl, write_exp_cap);
+      wr = new Objecter::OSDWrite(bl, write_ext_cap);
     else
-      Objecter::OSDWrite *wr = new Objecter::OSDWrite(bl);
+      wr = new Objecter::OSDWrite(bl);
     filer.file_to_extents(inode, offset, len, wr->extents);
     return atomic_sync_writex(wr, inode.ino, lock);
   }