]> git.proxmox.com Git - ceph.git/blob - ceph/src/librbd/cache/pwl/ReadRequest.h
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / librbd / cache / pwl / ReadRequest.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
3
4 #ifndef CEPH_LIBRBD_CACHE_RWL_READ_REQUEST_H
5 #define CEPH_LIBRBD_CACHE_RWL_READ_REQUEST_H
6
7 #include "include/Context.h"
8 #include "librbd/cache/pwl/Types.h"
9
10 namespace librbd {
11 namespace cache {
12 namespace pwl {
13
14 typedef std::vector<std::shared_ptr<pwl::ImageExtentBuf>> ImageExtentBufs;
15
16 class C_ReadRequest : public Context {
17 public:
18 io::Extents miss_extents; // move back to caller
19 ImageExtentBufs read_extents;
20 bufferlist miss_bl;
21
22 C_ReadRequest(
23 CephContext *cct, utime_t arrived, PerfCounters *perfcounter,
24 bufferlist *out_bl, Context *on_finish)
25 : m_cct(cct), m_on_finish(on_finish), m_out_bl(out_bl),
26 m_arrived_time(arrived), m_perfcounter(perfcounter) {}
27 ~C_ReadRequest() {}
28
29 const char *get_name() const {
30 return "C_ReadRequest";
31 }
32
33 protected:
34 CephContext *m_cct;
35 Context *m_on_finish;
36 bufferlist *m_out_bl;
37 utime_t m_arrived_time;
38 PerfCounters *m_perfcounter;
39 };
40
41 } // namespace pwl
42 } // namespace cache
43 } // namespace librbd
44
45 #endif // CEPH_LIBRBD_CACHE_RWL_READ_REQUEST_H