From: Jason Dillaman Date: Tue, 16 Jan 2018 16:58:23 +0000 (-0500) Subject: cls/rbd: cleanup helper method visibility X-Git-Tag: v13.0.2~426^2~11 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=19a9c3bfa5de9aff55ef27b3e6f9cf2c3869500c;p=ceph.git cls/rbd: cleanup helper method visibility Signed-off-by: Jason Dillaman --- diff --git a/src/cls/rbd/cls_rbd.cc b/src/cls/rbd/cls_rbd.cc index 9b77297089e..f5b7050b25c 100644 --- a/src/cls/rbd/cls_rbd.cc +++ b/src/cls/rbd/cls_rbd.cc @@ -5200,6 +5200,14 @@ int image_get_group(cls_method_context_t hctx, namespace group { +static const string RBD_GROUP_SNAP_KEY_PREFIX = "snapshot_"; + +std::string snap_key(std::string snap_id) { + ostringstream oss; + oss << RBD_GROUP_SNAP_KEY_PREFIX << snap_id; + return oss.str(); +} + static int group_snap_list(cls_method_context_t hctx, cls::rbd::GroupSnapshot start_after, uint64_t max_return, diff --git a/src/cls/rbd/cls_rbd.h b/src/cls/rbd/cls_rbd.h index 14c73d9151e..c340d3ce9ec 100644 --- a/src/cls/rbd/cls_rbd.h +++ b/src/cls/rbd/cls_rbd.h @@ -1,5 +1,6 @@ // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab + #ifndef __CEPH_CLS_RBD_H #define __CEPH_CLS_RBD_H @@ -164,15 +165,4 @@ struct cls_rbd_snap { }; WRITE_CLASS_ENCODER(cls_rbd_snap) -namespace group { - - static const string RBD_GROUP_SNAP_KEY_PREFIX = "snapshot_"; - - std::string snap_key(std::string snap_id) { - ostringstream oss; - oss << RBD_GROUP_SNAP_KEY_PREFIX << snap_id; - return oss.str(); - } -} - -#endif +#endif // __CEPH_CLS_RBD_H diff --git a/src/test/cls_rbd/test_cls_rbd.cc b/src/test/cls_rbd/test_cls_rbd.cc index cde7c5416d6..5543048a084 100644 --- a/src/test/cls_rbd/test_cls_rbd.cc +++ b/src/test/cls_rbd/test_cls_rbd.cc @@ -2308,7 +2308,7 @@ TEST_F(TestClsRbd, group_snap_set) { auto it = keys.begin(); ASSERT_EQ(1U, keys.size()); - string snap_key = group::snap_key(snap.id); + string snap_key = "snapshot_" + stringify(snap.id); ASSERT_EQ(snap_key, *it); } @@ -2399,7 +2399,7 @@ TEST_F(TestClsRbd, group_snap_remove) { auto it = keys.begin(); ASSERT_EQ(1U, keys.size()); - string snap_key = group::snap_key(snap.id); + string snap_key = "snapshot_" + stringify(snap.id); ASSERT_EQ(snap_key, *it); // Remove the snapshot