X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fceph%2Fsrc%2Flibrbd%2FTypes.h;fp=src%2Fceph%2Fsrc%2Flibrbd%2FTypes.h;h=0000000000000000000000000000000000000000;hb=7da45d65be36d36b880cc55c5036e96c24b53f00;hp=8efe8a7763c421064b25823cca5369db804d3c8b;hpb=691462d09d0987b47e112d6ee8740375df3c51b2;p=stor4nfv.git diff --git a/src/ceph/src/librbd/Types.h b/src/ceph/src/librbd/Types.h deleted file mode 100644 index 8efe8a7..0000000 --- a/src/ceph/src/librbd/Types.h +++ /dev/null @@ -1,73 +0,0 @@ -// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- -// vim: ts=8 sw=2 smarttab - -#ifndef LIBRBD_TYPES_H -#define LIBRBD_TYPES_H - -#include "include/types.h" -#include "cls/rbd/cls_rbd_types.h" -#include - -namespace librbd { - -/** @brief Unique identification of a parent in clone relationship. - * Cloning an image creates a child image that keeps a reference - * to its parent. This allows copy-on-write images. */ -struct ParentSpec { - int64_t pool_id; - std::string image_id; - snapid_t snap_id; - - ParentSpec() : pool_id(-1), snap_id(CEPH_NOSNAP) { - } - ParentSpec(int64_t pool_id, std::string image_id, snapid_t snap_id) - : pool_id(pool_id), image_id(image_id), snap_id(snap_id) { - } - - bool operator==(const ParentSpec &other) { - return ((this->pool_id == other.pool_id) && - (this->image_id == other.image_id) && - (this->snap_id == other.snap_id)); - } - bool operator!=(const ParentSpec &other) { - return !(*this == other); - } -}; - -/// Full information about an image's parent. -struct ParentInfo { - /// Identification of the parent. - ParentSpec spec; - - /** @brief Where the portion of data shared with the child image ends. - * Since images can be resized multiple times, the portion of data shared - * with the child image is not necessarily min(parent size, child size). - * If the child image is first shrunk and then enlarged, the common portion - * will be shorter. */ - uint64_t overlap; - - ParentInfo() : overlap(0) { - } -}; - -struct SnapInfo { - std::string name; - cls::rbd::SnapshotNamespace snap_namespace; - uint64_t size; - ParentInfo parent; - uint8_t protection_status; - uint64_t flags; - utime_t timestamp; - SnapInfo(std::string _name, - const cls::rbd::SnapshotNamespace &_snap_namespace, - uint64_t _size, const ParentInfo &_parent, - uint8_t _protection_status, uint64_t _flags, utime_t _timestamp) - : name(_name), snap_namespace(_snap_namespace), size(_size), - parent(_parent), protection_status(_protection_status), flags(_flags), - timestamp(_timestamp) { - } -}; - -} // namespace librbd - -#endif // LIBRBD_TYPES_H