From: Jianpeng Ma Date: Thu, 11 Dec 2014 06:06:19 +0000 (+0800) Subject: librbd: Add m_op_flags in AioRead to track op flags for rbd read. X-Git-Tag: v0.91~55^2~3^2~20 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=7b11c47bcfeaa3dd3208607be1eca1e2d5acb922;p=ceph.git librbd: Add m_op_flags in AioRead to track op flags for rbd read. Signed-off-by: Jianpeng Ma --- diff --git a/src/librbd/AioRequest.cc b/src/librbd/AioRequest.cc index e03f67d52eeff..ab54a65810ba2 100644 --- a/src/librbd/AioRequest.cc +++ b/src/librbd/AioRequest.cc @@ -99,6 +99,8 @@ namespace librbd { } else { op.read(m_object_off, m_object_len, &m_read_data, NULL); } + op.set_op_flags2(m_op_flags); + r = m_ioctx->aio_operate(m_oid, rados_completion, &op, flags, NULL); rados_completion->release(); diff --git a/src/librbd/AioRequest.h b/src/librbd/AioRequest.h index d6103f9a195cf..31cfee9a29654 100644 --- a/src/librbd/AioRequest.h +++ b/src/librbd/AioRequest.h @@ -65,11 +65,11 @@ namespace librbd { uint64_t objectno, uint64_t offset, uint64_t len, vector >& be, librados::snap_t snap_id, bool sparse, - Context *completion) + Context *completion, int op_flags) : AioRequest(ictx, oid, objectno, offset, len, snap_id, completion, false), - m_buffer_extents(be), - m_tried_parent(false), m_sparse(sparse) { + m_buffer_extents(be), m_tried_parent(false), + m_sparse(sparse), m_op_flags(op_flags) { } virtual ~AioRead() {} virtual bool should_complete(int r); @@ -86,6 +86,7 @@ namespace librbd { vector > m_buffer_extents; bool m_tried_parent; bool m_sparse; + int m_op_flags; }; class AbstractWrite : public AioRequest { diff --git a/src/librbd/internal.cc b/src/librbd/internal.cc index 093ef0c86a4dd..2e63941714910 100644 --- a/src/librbd/internal.cc +++ b/src/librbd/internal.cc @@ -3256,7 +3256,7 @@ reprotect_and_return_err: AioRead *req = new AioRead(ictx, q->oid.name, q->objectno, q->offset, q->length, q->buffer_extents, - snap_id, true, req_comp); + snap_id, true, req_comp, op_flags); req_comp->set_req(req); c->add_request();