1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 #ifndef CEPH_LIBRBD_API_DIFF_ITERATE_H
5 #define CEPH_LIBRBD_API_DIFF_ITERATE_H
7 #include "include/int_types.h"
8 #include "common/bit_vector.hpp"
9 #include "cls/rbd/cls_rbd_types.h"
17 template <typename ImageCtxT = librbd::ImageCtx>
20 typedef int (*Callback)(uint64_t, size_t, int, void *);
22 static int diff_iterate(ImageCtxT *ictx,
23 const cls::rbd::SnapshotNamespace& from_snap_namespace,
24 const char *fromsnapname,
25 uint64_t off, uint64_t len, bool include_parent,
27 int (*cb)(uint64_t, size_t, int, void *),
31 ImageCtxT &m_image_ctx;
32 cls::rbd::SnapshotNamespace m_from_snap_namespace;
33 const char* m_from_snap_name;
36 bool m_include_parent;
41 DiffIterate(ImageCtxT &image_ctx,
42 const cls::rbd::SnapshotNamespace& from_snap_namespace,
43 const char *from_snap_name, uint64_t off, uint64_t len,
44 bool include_parent, bool whole_object, Callback callback,
46 : m_image_ctx(image_ctx), m_from_snap_namespace(from_snap_namespace),
47 m_from_snap_name(from_snap_name), m_offset(off),
48 m_length(len), m_include_parent(include_parent),
49 m_whole_object(whole_object), m_callback(callback),
50 m_callback_arg(callback_arg)
56 int diff_object_map(uint64_t from_snap_id, uint64_t to_snap_id,
57 BitVector<2>* object_diff_state);
64 extern template class librbd::api::DiffIterate<librbd::ImageCtx>;
66 #endif // CEPH_LIBRBD_API_DIFF_ITERATE_H