]>
git.proxmox.com Git - ceph.git/blob - ceph/src/librbd/image/ValidatePoolRequest.h
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_IMAGE_VALIDATE_POOL_REQUEST_H
5 #define CEPH_LIBRBD_IMAGE_VALIDATE_POOL_REQUEST_H
7 #include "include/common_fwd.h"
8 #include "include/rados/librados.hpp"
9 #include "include/buffer.h"
20 template <typename ImageCtxT
>
21 class ValidatePoolRequest
{
23 static ValidatePoolRequest
* create(librados::IoCtx
& io_ctx
,
24 ContextWQ
*op_work_queue
,
26 return new ValidatePoolRequest(io_ctx
, op_work_queue
, on_finish
);
29 ValidatePoolRequest(librados::IoCtx
& io_ctx
, ContextWQ
*op_work_queue
,
40 * v (overwrites validated)
41 * READ RBD INFO . . . . . . . . .
43 * | . (snapshots validated) .
44 * | . . . . . . . . . . .
55 * OVERWRITE RBD INFO < . . . .
58 * <finish> < . . . . . . . . . .`
63 librados::IoCtx m_io_ctx
;
65 ContextWQ
* m_op_work_queue
;
70 uint64_t m_snap_id
= 0;
73 void handle_read_rbd_info(int r
);
75 void create_snapshot();
76 void handle_create_snapshot(int r
);
78 void write_rbd_info();
79 void handle_write_rbd_info(int r
);
81 void remove_snapshot();
82 void handle_remove_snapshot(int r
);
84 void overwrite_rbd_info();
85 void handle_overwrite_rbd_info(int r
);
94 extern template class librbd::image::ValidatePoolRequest
<librbd::ImageCtx
>;
96 #endif // CEPH_LIBRBD_IMAGE_VALIDATE_POOL_REQUEST_H