]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cls/rbd: cleanup helper method visibility
authorJason Dillaman <dillaman@redhat.com>
Tue, 16 Jan 2018 16:58:23 +0000 (11:58 -0500)
committerJason Dillaman <dillaman@redhat.com>
Fri, 26 Jan 2018 15:32:40 +0000 (10:32 -0500)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/cls/rbd/cls_rbd.cc
src/cls/rbd/cls_rbd.h
src/test/cls_rbd/test_cls_rbd.cc

index 9b77297089e504ccc09010519a646abb01a93bef..f5b7050b25c692ba6d1a114a47f632b023569a2f 100644 (file)
@@ -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,
index 14c73d9151e5d505090f9f0f1805bdf8423c675f..c340d3ce9ecf6e2193c8403c4300aa5efe3eb332 100644 (file)
@@ -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
index cde7c5416d654268b9469308b02bab4e8835eb1a..5543048a084d1458ab9fd42af3952cbf34dd6abc 100644 (file)
@@ -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