]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cephfs_mirror: Fix Clang compile errors 36933/head
authorWillem Jan Withagen <wjw@digiware.nl>
Tue, 1 Sep 2020 23:47:25 +0000 (01:47 +0200)
committerWillem Jan Withagen <wjw@digiware.nl>
Tue, 1 Sep 2020 23:47:25 +0000 (01:47 +0200)
Don't use `class CephContext;` in this way.
Including `./src/include/common_fwd.h` does it in a crimson compatible
way.

```
/home/jenkins/workspace/ceph-master-compile/src/tools/cephfs_mirror/ClusterWatcher.h:15:1: error: declaration conflicts with target of using declaration already in scope
class CephContext;
^
/home/jenkins/workspace/ceph-master-compile/src/include/common_fwd.h:10:9: note: target of using declaration
  class CephContext;
        ^
/home/jenkins/workspace/ceph-master-compile/src/include/common_fwd.h:22:24: note: using declaration
using TOPNSPC::common::CephContext;
```

Also fix a reference in a lambda-block,
```
/home/jenkins/workspace/ceph-master-compile/src/tools/cephfs_mirror/Mirror.cc:266:51: error: 'fs_name' in capture list does not name a variable
    Context *on_finish = new LambdaContext([this, fs_name](int r) {
                                                  ^
/home/jenkins/workspace/ceph-master-compile/src/tools/cephfs_mirror/Mirror.cc:267:62: error: reference to local binding 'fs_name' declared in enclosing function 'cephfs::mirror::Mirror::run'
                                             handle_shutdown(fs_name, r);
                                                             ^
/home/jenkins/workspace/ceph-master-compile/src/tools/cephfs_mirror/Mirror.cc:259:15: note: 'fs_name' declared here
  for (auto &[fs_name, fs_mirror] : m_fs_mirrors) {
              ^
```

fixes: https://github.com/ceph/ceph/pull/35697
Signed-off-by: Willem Jan Withagen <wjw@digiware.nl>
src/tools/cephfs_mirror/ClusterWatcher.h
src/tools/cephfs_mirror/FSMirror.h
src/tools/cephfs_mirror/Mirror.cc
src/tools/cephfs_mirror/Mirror.h

index ac95b563cb6e791cc80f9db7ee60458d7e8f7d35..e3b131f9a648fed8abe474753a39b593b60e699a 100644 (file)
@@ -12,7 +12,6 @@
 #include "msg/Dispatcher.h"
 #include "Types.h"
 
-class CephContext;
 class MonClient;
 
 namespace cephfs {
index c2b70189218a6b33e5cad306135b7922ec46ec5d..7f08c83860e4fbf69f2c179ce780a3cf28871c97 100644 (file)
@@ -11,7 +11,6 @@
 #include "InstanceWatcher.h"
 #include "MirrorWatcher.h"
 
-class CephContext;
 class ContextWQ;
 
 namespace cephfs {
index 5a14fd8d5fbfc13cabd0252f982c42833cf52e42..9eb1ba371246e5e8ba6486877ec730e8a46b1bbe 100644 (file)
@@ -263,7 +263,7 @@ void Mirror::run() {
       continue;
     }
 
-    Context *on_finish = new LambdaContext([this, fs_name](int r) {
+    Context *on_finish = new LambdaContext([this, fs_name = fs_name](int r) {
                                              handle_shutdown(fs_name, r);
                             });
     fs_mirror->shutdown(new C_AsyncCallback<ContextWQ>(m_work_queue, on_finish));
index 6bc2f60a52cdf3e751a5151f2502a5cae9600932..3d1b3699589e1699655babbcf6fd3b8a969e8dee 100644 (file)
@@ -14,7 +14,6 @@
 #include "FSMirror.h"
 #include "Types.h"
 
-class CephContext;
 class Messenger;
 class MonClient;
 class ContextWQ;