X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fceph%2Fsrc%2Flibrbd%2Fimage%2FSetSnapRequest.h;fp=src%2Fceph%2Fsrc%2Flibrbd%2Fimage%2FSetSnapRequest.h;h=0000000000000000000000000000000000000000;hb=7da45d65be36d36b880cc55c5036e96c24b53f00;hp=f6f5da06860c7bd31be778260101cd54d198f3b8;hpb=691462d09d0987b47e112d6ee8740375df3c51b2;p=stor4nfv.git diff --git a/src/ceph/src/librbd/image/SetSnapRequest.h b/src/ceph/src/librbd/image/SetSnapRequest.h deleted file mode 100644 index f6f5da0..0000000 --- a/src/ceph/src/librbd/image/SetSnapRequest.h +++ /dev/null @@ -1,124 +0,0 @@ -// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- -// vim: ts=8 sw=2 smarttab - -#ifndef CEPH_LIBRBD_IMAGE_SNAP_SET_REQUEST_H -#define CEPH_LIBRBD_IMAGE_SNAP_SET_REQUEST_H - -#include "cls/rbd/cls_rbd_client.h" -#include - -class Context; - -namespace librbd { - -template class ExclusiveLock; -class ImageCtx; -template class ObjectMap; - -namespace image { - -template class RefreshParentRequest; - -template -class SetSnapRequest { -public: - static SetSnapRequest *create(ImageCtxT &image_ctx, - const cls::rbd::SnapshotNamespace& snap_namespace, - const std::string &snap_name, - Context *on_finish) { - return new SetSnapRequest(image_ctx, snap_namespace, snap_name, on_finish); - } - - ~SetSnapRequest(); - - void send(); - -private: - /** - * @verbatim - * - * - * | - * | (set snap) - * |-----------> BLOCK_WRITES - * | | - * | v - * | SHUTDOWN_EXCLUSIVE_LOCK (skip if lock inactive - * | | or disabled) - * | v - * | REFRESH_PARENT (skip if no parent - * | | or refresh not needed) - * | v - * | OPEN_OBJECT_MAP (skip if map disabled) - * | | - * | v - * | - * | | - * | v - * | FINALIZE_REFRESH_PARENT (skip if no parent - * | | or refresh not needed) - * | v - * | - * | - * \-----------> INIT_EXCLUSIVE_LOCK (skip if active or - * | disabled) - * v - * REFRESH_PARENT (skip if no parent - * | or refresh not needed) - * v - * - * | - * v - * FINALIZE_REFRESH_PARENT (skip if no parent - * | or refresh not needed) - * v - * - * - * @endverbatim - */ - - SetSnapRequest(ImageCtxT &image_ctx, const cls::rbd::SnapshotNamespace& snap_namespace, - const std::string &snap_name, - Context *on_finish); - - ImageCtxT &m_image_ctx; - cls::rbd::SnapshotNamespace m_snap_namespace; - std::string m_snap_name; - Context *m_on_finish; - - uint64_t m_snap_id; - ExclusiveLock *m_exclusive_lock; - ObjectMap *m_object_map; - RefreshParentRequest *m_refresh_parent; - - bool m_writes_blocked; - - void send_block_writes(); - Context *handle_block_writes(int *result); - - void send_init_exclusive_lock(); - Context *handle_init_exclusive_lock(int *result); - - Context *send_shut_down_exclusive_lock(int *result); - Context *handle_shut_down_exclusive_lock(int *result); - - Context *send_refresh_parent(int *result); - Context *handle_refresh_parent(int *result); - - Context *send_open_object_map(int *result); - Context *handle_open_object_map(int *result); - - Context *send_finalize_refresh_parent(int *result); - Context *handle_finalize_refresh_parent(int *result); - - int apply(); - void finalize(); - void send_complete(); -}; - -} // namespace image -} // namespace librbd - -extern template class librbd::image::SetSnapRequest; - -#endif // CEPH_LIBRBD_IMAGE_SNAP_SET_REQUEST_H