From: Willem Jan Withagen Date: Tue, 1 Sep 2020 23:47:25 +0000 (+0200) Subject: cephfs_mirror: Fix Clang compile errors X-Git-Tag: v16.1.0~1200^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F36933%2Fhead;p=ceph.git 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 --- diff --git a/src/tools/cephfs_mirror/ClusterWatcher.h b/src/tools/cephfs_mirror/ClusterWatcher.h index ac95b563cb6e..e3b131f9a648 100644 --- a/src/tools/cephfs_mirror/ClusterWatcher.h +++ b/src/tools/cephfs_mirror/ClusterWatcher.h @@ -12,7 +12,6 @@ #include "msg/Dispatcher.h" #include "Types.h" -class CephContext; class MonClient; namespace cephfs { diff --git a/src/tools/cephfs_mirror/FSMirror.h b/src/tools/cephfs_mirror/FSMirror.h index c2b70189218a..7f08c83860e4 100644 --- a/src/tools/cephfs_mirror/FSMirror.h +++ b/src/tools/cephfs_mirror/FSMirror.h @@ -11,7 +11,6 @@ #include "InstanceWatcher.h" #include "MirrorWatcher.h" -class CephContext; class ContextWQ; namespace cephfs { diff --git a/src/tools/cephfs_mirror/Mirror.cc b/src/tools/cephfs_mirror/Mirror.cc index 5a14fd8d5fbf..9eb1ba371246 100644 --- a/src/tools/cephfs_mirror/Mirror.cc +++ b/src/tools/cephfs_mirror/Mirror.cc @@ -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(m_work_queue, on_finish)); diff --git a/src/tools/cephfs_mirror/Mirror.h b/src/tools/cephfs_mirror/Mirror.h index 6bc2f60a52cd..3d1b3699589e 100644 --- a/src/tools/cephfs_mirror/Mirror.h +++ b/src/tools/cephfs_mirror/Mirror.h @@ -14,7 +14,6 @@ #include "FSMirror.h" #include "Types.h" -class CephContext; class Messenger; class MonClient; class ContextWQ;