]> git.proxmox.com Git - ceph.git/blob - ceph/src/librbd/mirror/snapshot/Utils.h
import 15.2.0 Octopus source
[ceph.git] / ceph / src / librbd / mirror / snapshot / Utils.h
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_MIRROR_SNAPSHOT_UTILS_H
5 #define CEPH_LIBRBD_MIRROR_SNAPSHOT_UTILS_H
6
7 #include "include/int_types.h"
8 #include "include/stringify.h"
9 #include <string>
10
11 namespace librbd {
12
13 struct ImageCtx;
14
15 namespace mirror {
16 namespace snapshot {
17 namespace util {
18
19 std::string get_image_meta_key(const std::string& mirror_uuid);
20
21 template <typename ImageCtxT = librbd::ImageCtx>
22 bool can_create_primary_snapshot(ImageCtxT *image_ctx, bool demoted, bool force,
23 bool* requires_orphan,
24 uint64_t *rollback_snap_id);
25
26 template <typename ImageCtxT = librbd::ImageCtx>
27 bool can_create_non_primary_snapshot(ImageCtxT *image_ctx);
28
29 template <typename ImageCtxT = librbd::ImageCtx>
30 std::string image_state_object_name(ImageCtxT *image_ctx, uint64_t snap_id,
31 uint64_t index);
32
33 } // namespace util
34 } // namespace snapshot
35 } // namespace mirror
36 } // namespace librbd
37
38 #endif // CEPH_LIBRBD_MIRROR_SNAPSHOT_UTILS_H