]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Objecter: add a context argument to ObjectOperation::read()
authorJosh Durgin <josh.durgin@inktank.com>
Fri, 7 Feb 2014 03:40:11 +0000 (19:40 -0800)
committerJosh Durgin <josh.durgin@inktank.com>
Tue, 18 Feb 2014 20:34:32 +0000 (12:34 -0800)
The c api will need this to be able to set the output buffer length
and potentially copy from bufferlist to buffer.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
src/librados/IoCtxImpl.cc
src/librados/librados.cc
src/osdc/Objecter.h

index db56c7e50c628b482fb77098068cd62a942ed839..4e350872019dc9727fee1f26ab03db2736ce480b 100644 (file)
@@ -926,7 +926,7 @@ int librados::IoCtxImpl::read(const object_t& oid,
 
   ::ObjectOperation rd;
   prepare_assert_ops(&rd);
-  rd.read(off, len, &bl, NULL);
+  rd.read(off, len, &bl, NULL, NULL);
   int r = operate_read(oid, &rd, &bl);
   if (r < 0)
     return r;
index 52f4815f80b02e8cd2e789c4fdf507831142bc45..90fe2927f80ba8e70bd9c37891daf92481de5790 100644 (file)
@@ -180,7 +180,7 @@ void librados::ObjectReadOperation::stat(uint64_t *psize, time_t *pmtime, int *p
 void librados::ObjectReadOperation::read(size_t off, uint64_t len, bufferlist *pbl, int *prval)
 {
   ::ObjectOperation *o = (::ObjectOperation *)impl;
-  o->read(off, len, pbl, prval);
+  o->read(off, len, pbl, prval, NULL);
 }
 
 void librados::ObjectReadOperation::sparse_read(uint64_t off, uint64_t len,
index 24eeeb086410d2fd32c670ba1b3fa8d91fa89fe7..3640b4266c2f172c1b81b7019a2237b815f7246f 100644 (file)
@@ -237,12 +237,14 @@ struct ObjectOperation {
   }
 
   // object data
-  void read(uint64_t off, uint64_t len, bufferlist *pbl, int *prval) {
+  void read(uint64_t off, uint64_t len, bufferlist *pbl, int *prval,
+           Context* ctx) {
     bufferlist bl;
     add_data(CEPH_OSD_OP_READ, off, len, bl);
     unsigned p = ops.size() - 1;
     out_bl[p] = pbl;
     out_rval[p] = prval;
+    out_handler[p] = ctx;
   }
 
   struct C_ObjectOperation_sparse_read : public Context {