librados: need prval for tmap_get

Signed-off-by: Sage Weil <sage@newdream.net>
This commit is contained in:
Sage Weil 2012-02-14 13:39:46 -08:00
parent 7842bf1246
commit dd32285816
3 changed files with 7 additions and 6 deletions

View File

@ -191,7 +191,7 @@ namespace librados
void getxattr(const char *name, bufferlist *pbl, int *prval);
void getxattrs(std::map<std::string, bufferlist> *pattrs, int *prval);
void read(size_t off, uint64_t len, bufferlist *pbl, int *prval);
void tmap_get(bufferlist *pbl);
void tmap_get(bufferlist *pbl, int *prval);
};

View File

@ -200,10 +200,10 @@ void librados::ObjectReadOperation::read(size_t off, uint64_t len, bufferlist *p
o->read(off, len, pbl, prval);
}
void librados::ObjectReadOperation::tmap_get(bufferlist *pbl)
void librados::ObjectReadOperation::tmap_get(bufferlist *pbl, int *prval)
{
::ObjectOperation *o = (::ObjectOperation *)impl;
o->tmap_get(pbl);
o->tmap_get(pbl, prval);
}
void librados::ObjectReadOperation::getxattr(const char *name, bufferlist *pbl, int *prval)
@ -2091,7 +2091,7 @@ int librados::RadosClient::tmap_get(IoCtxImpl& io, const object_t& oid, bufferli
Mutex mylock("RadosClient::tmap_put::mylock");
Cond cond;
bool done;
int r;
int r = 0;
Context *onack = new C_SafeCond(&mylock, &cond, &done, &r);
eversion_t ver;
@ -2100,7 +2100,7 @@ int librados::RadosClient::tmap_get(IoCtxImpl& io, const object_t& oid, bufferli
lock.Lock();
::ObjectOperation rd;
prepare_assert_ops(&io, &rd);
rd.tmap_get(&bl);
rd.tmap_get(&bl, NULL);
objecter->read(oid, io.oloc, rd, io.snap_seq, 0, 0, onack, &ver);
lock.Unlock();

View File

@ -330,10 +330,11 @@ struct ObjectOperation {
void tmap_put(bufferlist& bl) {
add_data(CEPH_OSD_OP_TMAPPUT, 0, bl.length(), bl);
}
void tmap_get(bufferlist *pbl) {
void tmap_get(bufferlist *pbl, int *prval) {
add_op(CEPH_OSD_OP_TMAPGET);
unsigned p = ops.size() - 1;
out_bl[p] = pbl;
out_rval[p] = prval;
}
void tmap_get() {
add_op(CEPH_OSD_OP_TMAPGET);