]>
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_ENTRY_H | |
5 | #define CEPH_LIBRBD_CACHE_PWL_RWL_LOG_ENTRY_H | |
6 | ||
7 | #include "librbd/cache/pwl/LogEntry.h" | |
8 | ||
9 | namespace librbd { | |
10 | namespace cache { | |
11 | class ImageWritebackInterface; | |
12 | namespace pwl { | |
13 | namespace rwl { | |
14 | ||
15 | class WriteLogEntry : public pwl::WriteLogEntry { | |
16 | public: | |
17 | WriteLogEntry(std::shared_ptr<SyncPointLogEntry> sync_point_entry, | |
18 | uint64_t image_offset_bytes, uint64_t write_bytes) | |
19 | : pwl::WriteLogEntry(sync_point_entry, image_offset_bytes, write_bytes) {} | |
20 | WriteLogEntry(uint64_t image_offset_bytes, uint64_t write_bytes) | |
21 | : pwl::WriteLogEntry(image_offset_bytes, write_bytes) {} | |
22 | WriteLogEntry(std::shared_ptr<SyncPointLogEntry> sync_point_entry, | |
23 | uint64_t image_offset_bytes, uint64_t write_bytes, | |
24 | uint32_t data_length) | |
25 | : pwl::WriteLogEntry(sync_point_entry, image_offset_bytes, write_bytes, | |
26 | data_length) {} | |
27 | WriteLogEntry(uint64_t image_offset_bytes, uint64_t write_bytes, | |
28 | uint32_t data_length) | |
29 | : pwl::WriteLogEntry(image_offset_bytes, write_bytes, data_length) {} | |
30 | ~WriteLogEntry() {} | |
31 | WriteLogEntry(const WriteLogEntry&) = delete; | |
32 | WriteLogEntry &operator=(const WriteLogEntry&) = delete; | |
33 | ||
34 | void writeback(librbd::cache::ImageWritebackInterface &image_writeback, | |
35 | Context *ctx) override; | |
36 | void init_cache_bp() override; | |
37 | void init_bl(buffer::ptr &bp, buffer::list &bl) override; | |
38 | void init_cache_buffer( | |
39 | std::vector<WriteBufferAllocation>::iterator allocation) override; | |
40 | buffer::list &get_cache_bl() override; | |
41 | void copy_cache_bl(bufferlist *out_bl) override; | |
a4b75251 | 42 | unsigned int reader_count() const override; |
f67539c2 TL |
43 | }; |
44 | ||
45 | class WriteSameLogEntry : public WriteLogEntry { | |
46 | public: | |
47 | WriteSameLogEntry(std::shared_ptr<SyncPointLogEntry> sync_point_entry, | |
48 | uint64_t image_offset_bytes, uint64_t write_bytes, | |
49 | uint32_t data_length) | |
50 | : WriteLogEntry(sync_point_entry, image_offset_bytes, write_bytes, | |
51 | data_length) {} | |
52 | WriteSameLogEntry(uint64_t image_offset_bytes, uint64_t write_bytes, | |
53 | uint32_t data_length) | |
54 | : WriteLogEntry(image_offset_bytes, write_bytes, data_length) {} | |
55 | ~WriteSameLogEntry() {} | |
56 | WriteSameLogEntry(const WriteSameLogEntry&) = delete; | |
57 | WriteSameLogEntry &operator=(const WriteSameLogEntry&) = delete; | |
58 | ||
59 | void writeback(librbd::cache::ImageWritebackInterface &image_writeback, | |
60 | Context *ctx) override; | |
61 | }; | |
62 | ||
63 | } // namespace rwl | |
64 | } // namespace pwl | |
65 | } // namespace cache | |
66 | } // namespace librbd | |
67 | ||
68 | #endif // CEPH_LIBRBD_CACHE_PWL_RWL_LOG_ENTRY_H |