rgw: Aio reads return bufferlist in result

Signed-off-by: Casey Bodley <cbodley@redhat.com>
This commit is contained in:
Casey Bodley 2018-11-16 23:57:45 -05:00
parent 85fb04416e
commit 81e79fe7a7
3 changed files with 5 additions and 4 deletions

View File

@ -27,6 +27,7 @@ namespace rgw {
struct AioResult {
rgw_raw_obj obj;
bufferlist data; // result buffer for reads
int result = 0;
};
struct AioResultEntry : AioResult, boost::intrusive::list_base_hook<> {
@ -63,7 +64,7 @@ class Aio {
virtual AioResultList submit(RGWSI_RADOS::Obj& obj,
const rgw_raw_obj& raw_obj,
librados::ObjectReadOperation *op,
bufferlist *data, uint64_t cost) = 0;
uint64_t cost) = 0;
virtual AioResultList submit(RGWSI_RADOS::Obj& obj,
const rgw_raw_obj& raw_obj,

View File

@ -62,7 +62,7 @@ AioResultList AioThrottle::submit(RGWSI_RADOS::Obj& obj,
AioResultList AioThrottle::submit(RGWSI_RADOS::Obj& obj,
const rgw_raw_obj& raw_obj,
librados::ObjectReadOperation *op,
bufferlist *data, uint64_t cost)
uint64_t cost)
{
auto p = std::make_unique<Pending>();
p->obj = raw_obj;
@ -73,7 +73,7 @@ AioResultList AioThrottle::submit(RGWSI_RADOS::Obj& obj,
completed.push_back(*p);
} else {
get(*p);
p->result = obj.aio_operate(p->completion, op, data);
p->result = obj.aio_operate(p->completion, op, &p->data);
if (p->result < 0) {
put(*p);
}

View File

@ -69,7 +69,7 @@ class AioThrottle : public Aio {
AioResultList submit(RGWSI_RADOS::Obj& obj, const rgw_raw_obj& raw_obj,
librados::ObjectReadOperation *op,
bufferlist *data, uint64_t cost) override;
uint64_t cost) override;
AioResultList submit(RGWSI_RADOS::Obj& obj, const rgw_raw_obj& raw_obj,
librados::ObjectWriteOperation *op,