]>
Commit | Line | Data |
---|---|---|
f67539c2 TL |
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_PWL_RWL_LOG_OPERATION_H | |
5 | #define CEPH_LIBRBD_CACHE_PWL_RWL_LOG_OPERATION_H | |
6 | ||
7 | #include "librbd/cache/pwl/LogOperation.h" | |
8 | ||
9 | ||
10 | namespace librbd { | |
11 | namespace cache { | |
12 | namespace pwl { | |
13 | namespace rwl { | |
14 | ||
15 | class WriteLogOperation : public pwl::WriteLogOperation { | |
16 | public: | |
17 | WriteLogOperation( | |
18 | WriteLogOperationSet &set, uint64_t image_offset_bytes, | |
19 | uint64_t write_bytes, CephContext *cct, | |
20 | std::shared_ptr<pwl::WriteLogEntry> write_log_entry) | |
21 | : pwl::WriteLogOperation(set, image_offset_bytes, write_bytes, cct, | |
22 | write_log_entry) {} | |
23 | ||
24 | WriteLogOperation( | |
25 | WriteLogOperationSet &set, uint64_t image_offset_bytes, | |
26 | uint64_t write_bytes, uint32_t data_len, CephContext *cct, | |
27 | std::shared_ptr<pwl::WriteLogEntry> writesame_log_entry) | |
28 | : pwl::WriteLogOperation(set, image_offset_bytes, write_bytes, cct, | |
29 | writesame_log_entry) {} | |
30 | ||
31 | void copy_bl_to_cache_buffer( | |
32 | std::vector<WriteBufferAllocation>::iterator allocation) override; | |
33 | }; | |
34 | ||
35 | class DiscardLogOperation : public pwl::DiscardLogOperation { | |
36 | public: | |
37 | DiscardLogOperation( | |
38 | std::shared_ptr<SyncPoint> sync_point, uint64_t image_offset_bytes, | |
39 | uint64_t write_bytes, uint32_t discard_granularity_bytes, | |
40 | utime_t dispatch_time, PerfCounters *perfcounter, CephContext *cct) | |
41 | : pwl::DiscardLogOperation(sync_point, image_offset_bytes, write_bytes, | |
42 | discard_granularity_bytes, dispatch_time, | |
43 | perfcounter, cct) {} | |
44 | void init_op( | |
45 | uint64_t current_sync_gen, bool persist_on_flush, | |
46 | uint64_t last_op_sequence_num, Context *write_persist, | |
47 | Context *write_append) override; | |
48 | }; | |
49 | ||
50 | } // namespace rwl | |
51 | } // namespace pwl | |
52 | } // namespace cache | |
53 | } // namespace librbd | |
54 | ||
55 | #endif // CEPH_LIBRBD_CACHE_PWL_RWL_LOG_OPERATION_H |