mirror of
https://github.com/ceph/ceph
synced 2025-01-04 02:02:36 +00:00
rgw: Aio reads return bufferlist in result
Signed-off-by: Casey Bodley <cbodley@redhat.com>
This commit is contained in:
parent
85fb04416e
commit
81e79fe7a7
@ -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,
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user