]>
git.proxmox.com Git - ceph.git/blob - ceph/src/librbd/api/Snapshot.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_API_SNAPSHOT_H
5 #define CEPH_LIBRBD_API_SNAPSHOT_H
7 #include "include/rbd/librbd.hpp"
8 #include "cls/rbd/cls_rbd_types.h"
17 template <typename ImageCtxT
= librbd::ImageCtx
>
20 static int get_group_namespace(ImageCtxT
*ictx
, uint64_t snap_id
,
21 snap_group_namespace_t
*group_snap
);
23 static int get_trash_namespace(ImageCtxT
*ictx
, uint64_t snap_id
,
24 std::string
*original_name
);
26 static int get_mirror_namespace(
27 ImageCtxT
*ictx
, uint64_t snap_id
,
28 snap_mirror_namespace_t
*mirror_snap
);
30 static int get_namespace_type(ImageCtxT
*ictx
, uint64_t snap_id
,
31 snap_namespace_type_t
*namespace_type
);
33 static int remove(ImageCtxT
*ictx
, uint64_t snap_id
);
35 static int get_name(ImageCtxT
*ictx
, uint64_t snap_id
, std::string
*snap_name
);
37 static int get_id(ImageCtxT
*ictx
, const std::string
& snap_name
, uint64_t *snap_id
);
39 static int list(ImageCtxT
*ictx
, std::vector
<snap_info_t
>& snaps
);
41 static int exists(ImageCtxT
*ictx
, const cls::rbd::SnapshotNamespace
& snap_namespace
,
42 const char *snap_name
, bool *exists
);
44 static int remove(ImageCtxT
*ictx
, const char *snap_name
, uint32_t flags
, ProgressContext
& pctx
);
46 static int get_limit(ImageCtxT
*ictx
, uint64_t *limit
);
48 static int set_limit(ImageCtxT
*ictx
, uint64_t limit
);
50 static int get_timestamp(ImageCtxT
*ictx
, uint64_t snap_id
, struct timespec
*timestamp
);
52 static int is_protected(ImageCtxT
*ictx
, const char *snap_name
, bool *protect
);
54 static int get_namespace(ImageCtxT
*ictx
, const char *snap_name
,
55 cls::rbd::SnapshotNamespace
*snap_namespace
);
62 extern template class librbd::api::Snapshot
<librbd::ImageCtx
>;
64 #endif // CEPH_LIBRBD_API_SNAPSHOT_H