diff --git a/src/include/rados/librados.hpp b/src/include/rados/librados.hpp index 54baadfe198..251324b139c 100644 --- a/src/include/rados/librados.hpp +++ b/src/include/rados/librados.hpp @@ -191,7 +191,7 @@ namespace librados void getxattr(const char *name, bufferlist *pbl, int *prval); void getxattrs(std::map *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); }; diff --git a/src/librados.cc b/src/librados.cc index e7db7779fce..e8e8bbadb0d 100644 --- a/src/librados.cc +++ b/src/librados.cc @@ -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(); diff --git a/src/osdc/Objecter.h b/src/osdc/Objecter.h index 4995f995444..023bb1472e1 100644 --- a/src/osdc/Objecter.h +++ b/src/osdc/Objecter.h @@ -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);