]>
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_SSD_LOG_ENTRY_H | |
5 | #define CEPH_LIBRBD_CACHE_PWL_SSD_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 ssd { | |
14 | ||
15 | class WriteLogEntry : public pwl::WriteLogEntry { | |
16 | public: | |
17 | WriteLogEntry( | |
18 | std::shared_ptr<SyncPointLogEntry> sync_point_entry, | |
19 | uint64_t image_offset_bytes, uint64_t write_bytes) | |
20 | : pwl::WriteLogEntry(sync_point_entry, image_offset_bytes, write_bytes) {} | |
21 | WriteLogEntry( | |
22 | uint64_t image_offset_bytes, uint64_t write_bytes) | |
23 | : pwl::WriteLogEntry(image_offset_bytes, write_bytes) {} | |
24 | WriteLogEntry( | |
25 | std::shared_ptr<SyncPointLogEntry> sync_point_entry, | |
26 | uint64_t image_offset_bytes, uint64_t write_bytes, | |
27 | uint32_t data_length) | |
28 | : pwl::WriteLogEntry(sync_point_entry, image_offset_bytes, | |
29 | write_bytes, data_length) {} | |
30 | WriteLogEntry( | |
31 | uint64_t image_offset_bytes, uint64_t write_bytes, | |
32 | uint32_t data_length) | |
33 | : pwl::WriteLogEntry(image_offset_bytes, write_bytes, data_length) {} | |
34 | ~WriteLogEntry() {} | |
35 | WriteLogEntry(const WriteLogEntry&) = delete; | |
36 | WriteLogEntry &operator=(const WriteLogEntry&) = delete; | |
37 | void writeback_bl(librbd::cache::ImageWritebackInterface &image_writeback, | |
38 | Context *ctx, ceph::bufferlist &&bl) override; | |
39 | void init_cache_bl(bufferlist &src_bl, uint64_t off, uint64_t len) override; | |
40 | buffer::list &get_cache_bl() override; | |
41 | void remove_cache_bl() override; | |
42 | unsigned int get_aligned_data_size() const override; | |
43 | }; | |
44 | ||
45 | class WriteSameLogEntry : public WriteLogEntry { | |
46 | public: | |
47 | WriteSameLogEntry( | |
48 | std::shared_ptr<SyncPointLogEntry> sync_point_entry, | |
49 | uint64_t image_offset_bytes, uint64_t write_bytes, | |
50 | uint32_t data_length) | |
51 | : WriteLogEntry(sync_point_entry, image_offset_bytes, | |
52 | write_bytes, data_length) {} | |
53 | WriteSameLogEntry( | |
54 | uint64_t image_offset_bytes, uint64_t write_bytes, | |
55 | uint32_t data_length) | |
56 | : WriteLogEntry(image_offset_bytes, write_bytes, data_length) {} | |
57 | ~WriteSameLogEntry() {} | |
58 | WriteSameLogEntry(const WriteSameLogEntry&) = delete; | |
59 | WriteSameLogEntry &operator=(const WriteSameLogEntry&) = delete; | |
60 | void writeback_bl(librbd::cache::ImageWritebackInterface &image_writeback, | |
61 | Context *ctx, ceph::bufferlist &&bl) override; | |
62 | }; | |
63 | ||
64 | } // namespace ssd | |
65 | } // namespace pwl | |
66 | } // namespace cache | |
67 | } // namespace librbd | |
68 | ||
69 | #endif // CEPH_LIBRBD_CACHE_PWL_SSD_LOG_ENTRY_H |