]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
cephfs_mirror: Fix Clang compile errors
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)
commitc53d85ce476964db6b552f1b94040dd4e7dc39b4
treed6f85afd18092e67b9c87bd54d565badf6bf710f
parentc27bf1ced2c6e3dea32f4c109267e09c4f0b8e47
cephfs_mirror: Fix Clang compile errors

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