From 11632e9bf6b65d9a36394e2de8e834598f95e6e5 Mon Sep 17 00:00:00 2001 From: anwleung Date: Thu, 1 Mar 2007 03:55:38 +0000 Subject: [PATCH] More normal state...not that everything works yet but better git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1145 29311d96-e01e-0410-9327-a35deaab8ce9 --- branches/aleung/security1/ceph/crypto/ExtCap.h | 1 - branches/aleung/security1/ceph/include/object.h | 2 -- branches/aleung/security1/ceph/osd/OSD.cc | 2 +- branches/aleung/security1/ceph/osdc/ObjectCacher.cc | 12 ++++++------ branches/aleung/security1/ceph/osdc/ObjectCacher.h | 8 +++++--- 5 files changed, 12 insertions(+), 13 deletions(-) diff --git a/branches/aleung/security1/ceph/crypto/ExtCap.h b/branches/aleung/security1/ceph/crypto/ExtCap.h index 1d53dbc3e2927..78355dc08d22d 100644 --- a/branches/aleung/security1/ceph/crypto/ExtCap.h +++ b/branches/aleung/security1/ceph/crypto/ExtCap.h @@ -23,7 +23,6 @@ using namespace std; #include "crypto/CryptoLib.h" using namespace CryptoLib; -#include "common/Clock.h" class ExtCap { private: diff --git a/branches/aleung/security1/ceph/include/object.h b/branches/aleung/security1/ceph/include/object.h index 4221ee81a66e6..3a66c4ab83d54 100644 --- a/branches/aleung/security1/ceph/include/object.h +++ b/branches/aleung/security1/ceph/include/object.h @@ -18,8 +18,6 @@ #include using namespace std; -#include "crypto/ExtCap.h" - typedef __uint32_t objectrev_t; diff --git a/branches/aleung/security1/ceph/osd/OSD.cc b/branches/aleung/security1/ceph/osd/OSD.cc index d9058101b13d0..89236f30769bf 100644 --- a/branches/aleung/security1/ceph/osd/OSD.cc +++ b/branches/aleung/security1/ceph/osd/OSD.cc @@ -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 diff --git a/branches/aleung/security1/ceph/osdc/ObjectCacher.cc b/branches/aleung/security1/ceph/osdc/ObjectCacher.cc index 8e1f0c0176a45..32d6f31a4773a 100644 --- a/branches/aleung/security1/ceph/osdc/ObjectCacher.cc +++ b/branches/aleung/security1/ceph/osdc/ObjectCacher.cc @@ -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; diff --git a/branches/aleung/security1/ceph/osdc/ObjectCacher.h b/branches/aleung/security1/ceph/osdc/ObjectCacher.h index aa45b1ac206aa..641dc44a311e9 100644 --- a/branches/aleung/security1/ceph/osdc/ObjectCacher.h +++ b/branches/aleung/security1/ceph/osdc/ObjectCacher.h @@ -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); } -- 2.39.5