summaryrefslogtreecommitdiffstats
path: root/src/librbd/object_map/DiffRequest.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/librbd/object_map/DiffRequest.h29
1 files changed, 16 insertions, 13 deletions
diff --git a/src/librbd/object_map/DiffRequest.h b/src/librbd/object_map/DiffRequest.h
index e83a1629e..740f4e02a 100644
--- a/src/librbd/object_map/DiffRequest.h
+++ b/src/librbd/object_map/DiffRequest.h
@@ -21,21 +21,20 @@ namespace object_map {
template <typename ImageCtxT>
class DiffRequest {
public:
- static DiffRequest* create(ImageCtxT* image_ctx, uint64_t snap_id_start,
- uint64_t snap_id_end,
+ static DiffRequest* create(ImageCtxT* image_ctx,
+ uint64_t snap_id_start, uint64_t snap_id_end,
+ uint64_t start_object_no, uint64_t end_object_no,
BitVector<2>* object_diff_state,
Context* on_finish) {
return new DiffRequest(image_ctx, snap_id_start, snap_id_end,
- object_diff_state, on_finish);
+ start_object_no, end_object_no, object_diff_state,
+ on_finish);
}
- DiffRequest(ImageCtxT* image_ctx, uint64_t snap_id_start,
- uint64_t snap_id_end, BitVector<2>* object_diff_state,
- Context* on_finish)
- : m_image_ctx(image_ctx), m_snap_id_start(snap_id_start),
- m_snap_id_end(snap_id_end), m_object_diff_state(object_diff_state),
- m_on_finish(on_finish) {
- }
+ DiffRequest(ImageCtxT* image_ctx,
+ uint64_t snap_id_start, uint64_t snap_id_end,
+ uint64_t start_object_no, uint64_t end_object_no,
+ BitVector<2>* object_diff_state, Context* on_finish);
void send();
@@ -58,6 +57,8 @@ private:
ImageCtxT* m_image_ctx;
uint64_t m_snap_id_start;
uint64_t m_snap_id_end;
+ uint64_t m_start_object_no;
+ uint64_t m_end_object_no;
BitVector<2>* m_object_diff_state;
Context* m_on_finish;
@@ -67,11 +68,13 @@ private:
uint64_t m_current_size = 0;
- BitVector<2> m_object_map;
- bool m_object_diff_state_valid = false;
-
bufferlist m_out_bl;
+ bool is_diff_iterate() const;
+
+ int prepare_for_object_map();
+ int process_object_map(const BitVector<2>& object_map);
+
void load_object_map(std::shared_lock<ceph::shared_mutex>* image_locker);
void handle_load_object_map(int r);