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>
#include "msg/Dispatcher.h"
#include "Types.h"
-class CephContext;
class MonClient;
namespace cephfs {
#include "InstanceWatcher.h"
#include "MirrorWatcher.h"
-class CephContext;
class ContextWQ;
namespace cephfs {
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));
#include "FSMirror.h"
#include "Types.h"
-class CephContext;
class Messenger;
class MonClient;
class ContextWQ;