From: Jason Dillaman Date: Thu, 12 Sep 2019 14:34:54 +0000 (-0400) Subject: cls/rbd: removed unused pool id from MirrorPeer X-Git-Tag: v15.1.0~1245^2~18 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=482b2867c8f5e8dc88a961976f17785925c25e21;p=ceph.git cls/rbd: removed unused pool id from MirrorPeer Signed-off-by: Jason Dillaman --- diff --git a/src/cls/rbd/cls_rbd.cc b/src/cls/rbd/cls_rbd.cc index fba8d5c0639..47815dd19d1 100644 --- a/src/cls/rbd/cls_rbd.cc +++ b/src/cls/rbd/cls_rbd.cc @@ -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; diff --git a/src/cls/rbd/cls_rbd_client.cc b/src/cls/rbd/cls_rbd_client.cc index 4f2b3f510aa..9aa2b24a1a9 100644 --- a/src/cls/rbd/cls_rbd_client.cc +++ b/src/cls/rbd/cls_rbd_client.cc @@ -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); diff --git a/src/cls/rbd/cls_rbd_client.h b/src/cls/rbd/cls_rbd_client.h index 3ff6f32caa3..ed0c9c2678f 100644 --- a/src/cls/rbd/cls_rbd_client.h +++ b/src/cls/rbd/cls_rbd_client.h @@ -385,8 +385,7 @@ int mirror_peer_list(librados::IoCtx *ioctx, std::vector *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, diff --git a/src/cls/rbd/cls_rbd_types.cc b/src/cls/rbd/cls_rbd_types.cc index 1d7f932e970..4a432aabec7 100644 --- a/src/cls/rbd/cls_rbd_types.cc +++ b/src/cls/rbd/cls_rbd_types.cc @@ -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 &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; } diff --git a/src/cls/rbd/cls_rbd_types.h b/src/cls/rbd/cls_rbd_types.h index 74dfe1d99de..66bfa98fbbc 100644 --- a/src/cls/rbd/cls_rbd_types.h +++ b/src/cls/rbd/cls_rbd_types.h @@ -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());