#include "crypto/CryptoLib.h"
using namespace CryptoLib;
-#include "common/Clock.h"
class ExtCap {
private:
#include <iomanip>
using namespace std;
-#include "crypto/ExtCap.h"
-
typedef __uint32_t objectrev_t;
// 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
left -= glen;
continue; // more?
}
-s }
+ }
}
// set versoin
}
-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);
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;
// 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);
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);
}