]>
git.proxmox.com Git - ceph.git/blob - ceph/src/librbd/operation/SparsifyRequest.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
3 #ifndef CEPH_LIBRBD_OPERATION_SPARSIFY_REQUEST_H
4 #define CEPH_LIBRBD_OPERATION_SPARSIFY_REQUEST_H
6 #include "librbd/operation/Request.h"
7 #include "common/snap_types.h"
12 class ProgressContext
;
16 template <typename ImageCtxT
= ImageCtx
>
17 class SparsifyRequest
: public Request
<ImageCtxT
>
20 SparsifyRequest(ImageCtxT
&image_ctx
, size_t sparse_size
, Context
*on_finish
,
21 ProgressContext
&prog_ctx
)
22 : Request
<ImageCtxT
>(image_ctx
, on_finish
), m_sparse_size(sparse_size
),
23 m_prog_ctx(prog_ctx
) {
27 void send_op() override
;
28 bool should_complete(int r
) override
;
29 bool can_affect_io() const override
{
32 journal::Event
create_event(uint64_t op_tid
) const override
{
34 return journal::UnknownEvent();
53 ProgressContext
&m_prog_ctx
;
55 void sparsify_objects();
56 void handle_sparsify_objects(int r
);
59 } // namespace operation
62 extern template class librbd::operation::SparsifyRequest
<librbd::ImageCtx
>;
64 #endif // CEPH_LIBRBD_OPERATION_SPARSIFY_REQUEST_H