From: Josh Durgin Date: Fri, 7 Feb 2014 03:40:11 +0000 (-0800) Subject: Objecter: add a context argument to ObjectOperation::read() X-Git-Tag: v0.78~154^2~14 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6503f21a2612a6998cdf68ca278173ccfe438ebb;p=ceph.git Objecter: add a context argument to ObjectOperation::read() 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 --- diff --git a/src/librados/IoCtxImpl.cc b/src/librados/IoCtxImpl.cc index db56c7e50c628..4e350872019dc 100644 --- a/src/librados/IoCtxImpl.cc +++ b/src/librados/IoCtxImpl.cc @@ -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; diff --git a/src/librados/librados.cc b/src/librados/librados.cc index 52f4815f80b02..90fe2927f80ba 100644 --- a/src/librados/librados.cc +++ b/src/librados/librados.cc @@ -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, diff --git a/src/osdc/Objecter.h b/src/osdc/Objecter.h index 24eeeb086410d..3640b4266c2f1 100644 --- a/src/osdc/Objecter.h +++ b/src/osdc/Objecter.h @@ -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 {