]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cls/rbd: removed unused pool id from MirrorPeer
authorJason Dillaman <dillaman@redhat.com>
Thu, 12 Sep 2019 14:34:54 +0000 (10:34 -0400)
committerJason Dillaman <dillaman@redhat.com>
Tue, 8 Oct 2019 15:16:46 +0000 (11:16 -0400)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/cls/rbd/cls_rbd.cc
src/cls/rbd/cls_rbd_client.cc
src/cls/rbd/cls_rbd_client.h
src/cls/rbd/cls_rbd_types.cc
src/cls/rbd/cls_rbd_types.h

index fba8d5c0639829ac3e6a76c8fc5543d065dbf761..47815dd19d15d3f8f86cea2b1ff2fe0db3bd6661 100644 (file)
@@ -5553,9 +5553,7 @@ int mirror_peer_add(cls_method_context_t hctx, bufferlist *in,
       CLS_ERR("peer uuid '%s' already exists",
               peer.uuid.c_str());
       return -ESTALE;
-    } else if (peer.cluster_name == mirror_peer.cluster_name &&
-               (peer.pool_id == -1 || mirror_peer.pool_id == -1 ||
-                peer.pool_id == mirror_peer.pool_id)) {
+    } else if (peer.cluster_name == mirror_peer.cluster_name) {
       CLS_ERR("peer cluster name '%s' already exists",
               peer.cluster_name.c_str());
       return -EEXIST;
index 4f2b3f510aac6d0271f26bcaec97fe44484cb0ab..9aa2b24a1a9d1faf101a0722d0ee7e06e55cd477 100644 (file)
@@ -1832,8 +1832,8 @@ int mirror_peer_list(librados::IoCtx *ioctx,
 
 int mirror_peer_add(librados::IoCtx *ioctx, const std::string &uuid,
                     const std::string &cluster_name,
-                    const std::string &client_name, int64_t pool_id) {
-  cls::rbd::MirrorPeer peer(uuid, cluster_name, client_name, pool_id);
+                    const std::string &client_name) {
+  cls::rbd::MirrorPeer peer(uuid, cluster_name, client_name);
   bufferlist in_bl;
   encode(peer, in_bl);
 
index 3ff6f32caa30b25b79c549e08e46cce2579d6445..ed0c9c2678fce5e8a72e6d9d75a38e2ec04bbb09 100644 (file)
@@ -385,8 +385,7 @@ int mirror_peer_list(librados::IoCtx *ioctx,
                      std::vector<cls::rbd::MirrorPeer> *peers);
 int mirror_peer_add(librados::IoCtx *ioctx, const std::string &uuid,
                     const std::string &cluster_name,
-                    const std::string &client_name,
-                    int64_t pool_id = -1);
+                    const std::string &client_name);
 int mirror_peer_remove(librados::IoCtx *ioctx,
                        const std::string &uuid);
 int mirror_peer_set_client(librados::IoCtx *ioctx,
index 1d7f932e9709ca706480c45eb8b33fdffa194b7c..4a432aabec78884bfa6b8ce0abe2aaefa2c3c973 100644 (file)
@@ -13,6 +13,7 @@ void MirrorPeer::encode(bufferlist &bl) const {
   encode(uuid, bl);
   encode(cluster_name, bl);
   encode(client_name, bl);
+  int64_t pool_id = -1;
   encode(pool_id, bl);
   ENCODE_FINISH(bl);
 }
@@ -22,6 +23,7 @@ void MirrorPeer::decode(bufferlist::const_iterator &it) {
   decode(uuid, it);
   decode(cluster_name, it);
   decode(client_name, it);
+  int64_t pool_id;
   decode(pool_id, it);
   DECODE_FINISH(it);
 }
@@ -30,19 +32,17 @@ void MirrorPeer::dump(Formatter *f) const {
   f->dump_string("uuid", uuid);
   f->dump_string("cluster_name", cluster_name);
   f->dump_string("client_name", client_name);
-  f->dump_int("pool_id", pool_id);
 }
 
 void MirrorPeer::generate_test_instances(std::list<MirrorPeer*> &o) {
   o.push_back(new MirrorPeer());
-  o.push_back(new MirrorPeer("uuid-123", "cluster name", "client name", 123));
+  o.push_back(new MirrorPeer("uuid-123", "cluster name", "client name"));
 }
 
 bool MirrorPeer::operator==(const MirrorPeer &rhs) const {
   return (uuid == rhs.uuid &&
           cluster_name == rhs.cluster_name &&
-          client_name == rhs.client_name &&
-          pool_id == rhs.pool_id);
+          client_name == rhs.client_name);
 }
 
 std::ostream& operator<<(std::ostream& os, const MirrorMode& mirror_mode) {
@@ -67,11 +67,8 @@ std::ostream& operator<<(std::ostream& os, const MirrorPeer& peer) {
   os << "["
      << "uuid=" << peer.uuid << ", "
      << "cluster_name=" << peer.cluster_name << ", "
-     << "client_name=" << peer.client_name;
-  if (peer.pool_id != -1) {
-    os << ", pool_id=" << peer.pool_id;
-  }
-  os << "]";
+     << "client_name=" << peer.client_name
+     << "]";
   return os;
 }
 
index 74dfe1d99de207ce49059abf8dc077f73870f66e..66bfa98fbbc0aba3efc875eeb645e15e7e272d4b 100644 (file)
@@ -72,15 +72,13 @@ struct MirrorPeer {
   MirrorPeer() {
   }
   MirrorPeer(const std::string &uuid, const std::string &cluster_name,
-             const std::string &client_name, int64_t pool_id)
-    : uuid(uuid), cluster_name(cluster_name), client_name(client_name),
-      pool_id(pool_id) {
+             const std::string &client_name)
+    : uuid(uuid), cluster_name(cluster_name), client_name(client_name) {
   }
 
   std::string uuid;
   std::string cluster_name;
   std::string client_name;
-  int64_t pool_id = -1;
 
   inline bool is_valid() const {
     return (!uuid.empty() && !cluster_name.empty() && !client_name.empty());