]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: move BlueRocksEnv::split() to .cc
authorKefu Chai <kchai@redhat.com>
Tue, 16 Mar 2021 01:13:00 +0000 (09:13 +0800)
committerIgor Fedotov <ifedotov@suse.com>
Tue, 8 Jun 2021 10:41:05 +0000 (13:41 +0300)
this helper is only used by the functions in the .cc file, and it does
not reference BlueRocksEnv member variable or methods. so move it to
an anonymous namespace.

Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit c1c90582dbe9274c5004f65d817cc83ef1b3062d)

src/os/bluestore/BlueRocksEnv.cc
src/os/bluestore/BlueRocksEnv.h

index 60593ec8214e77816b808865c6e94fcbaf046b36..b3dd73a74428289f30c469328adbca1609413e22 100644 (file)
@@ -7,6 +7,8 @@
 #include "kv/RocksDBStore.h"
 #include "string.h"
 
+namespace {
+
 rocksdb::Status err_to_status(int r)
 {
   switch (r) {
@@ -28,6 +30,17 @@ rocksdb::Status err_to_status(int r)
   }
 }
 
+void split(const std::string &fn, std::string *dir, std::string *file)
+{
+  size_t slash = fn.rfind('/');
+  *file = fn.substr(slash + 1);
+  while (slash && fn[slash-1] == '/')
+    --slash;
+  *dir = fn.substr(0, slash);
+}
+
+}
+
 // A file abstraction for reading sequentially through a file
 class BlueRocksSequentialFile : public rocksdb::SequentialFile {
   BlueFS *fs;
index 82cffcd809bdd27d7313c38b3a6c715cdc576ec4..62bcddcf67626e4e802081849d1f3b0ff46be352 100644 (file)
 class BlueFS;
 
 class BlueRocksEnv : public rocksdb::EnvWrapper {
-  void split(const std::string &fn, std::string *dir, std::string *file) {
-    size_t slash = fn.rfind('/');
-    *file = fn.substr(slash + 1);
-    while (slash && fn[slash-1] == '/')
-      --slash;
-    *dir = fn.substr(0, slash);
-  }
-
 public:
   // Create a brand new sequentially-readable file with the specified name.
   // On success, stores a pointer to the new file in *result and returns OK.