From 643aa4abd019b60d5ffc9a0bbc33a06897a99ceb Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Fri, 27 Jul 2018 23:36:02 +0800 Subject: [PATCH 1/2] tools/ceph-dencoder: move ceph-dencoder to tools/ceph-dencoder Signed-off-by: Kefu Chai --- src/tools/CMakeLists.txt | 58 +------------------ src/tools/ceph-dencoder/CMakeLists.txt | 57 ++++++++++++++++++ .../{ => ceph-dencoder}/ceph_dencoder.cc | 0 .../ceph-dencoder/ceph_time.h} | 0 .../ceph-dencoder/sstring.h} | 0 .../encoding => tools/ceph-dencoder}/types.h | 4 +- 6 files changed, 60 insertions(+), 59 deletions(-) create mode 100644 src/tools/ceph-dencoder/CMakeLists.txt rename src/tools/{ => ceph-dencoder}/ceph_dencoder.cc (100%) rename src/{test/encoding/test_ceph_time.h => tools/ceph-dencoder/ceph_time.h} (100%) rename src/{test/encoding/test_sstring.h => tools/ceph-dencoder/sstring.h} (100%) rename src/{test/encoding => tools/ceph-dencoder}/types.h (99%) diff --git a/src/tools/CMakeLists.txt b/src/tools/CMakeLists.txt index ef7e302e208..3789e3c274a 100644 --- a/src/tools/CMakeLists.txt +++ b/src/tools/CMakeLists.txt @@ -107,60 +107,4 @@ if(WITH_RBD) endif() endif(WITH_RBD) -## dencoder -set_source_files_properties( - ${CMAKE_SOURCE_DIR}/src/test/encoding/ceph_dencoder.cc - APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_BINARY_DIR}/src/include/ceph_ver.h) - -if(HAS_VTA) - set_source_files_properties(test/encoding/ceph_dencoder.cc - PROPERTIES COMPILE_FLAGS -fno-var-tracking-assignments) -endif() - -set(dencoder_srcs - ceph_dencoder.cc - $) -if(WITH_RADOSGW) - list(APPEND dencoder_srcs - ${CMAKE_SOURCE_DIR}/src/rgw/rgw_dencoder.cc) -endif() - -add_executable(ceph-dencoder ${dencoder_srcs}) - -if(WITH_RADOSGW) - list(APPEND DENCODER_EXTRALIBS - rgw_a - cls_rgw_client) -endif() - -if(WITH_RBD) - list(APPEND DENCODER_EXTRALIBS - cls_rbd_client - rbd_mirror_types - rbd_types - rbd_replay_types) - if(WITH_KRBD) - list(APPEND DENCODER_EXTRALIBS - krbd) - endif() -endif() - -target_link_libraries(ceph-dencoder - global - os - osd - mds - mon - journal - ${DENCODER_EXTRALIBS} - cls_lock_client - cls_refcount_client - cls_log_client - cls_statelog_client - cls_version_client - cls_user_client - cls_journal_client - cls_timeindex_client - ${EXTRALIBS} - ${CMAKE_DL_LIBS}) -install(TARGETS ceph-dencoder DESTINATION bin) +add_subdirectory(ceph-dencoder) diff --git a/src/tools/ceph-dencoder/CMakeLists.txt b/src/tools/ceph-dencoder/CMakeLists.txt new file mode 100644 index 00000000000..be0f9d1863b --- /dev/null +++ b/src/tools/ceph-dencoder/CMakeLists.txt @@ -0,0 +1,57 @@ +## dencoder +set_source_files_properties( + ceph_dencoder.cc + APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_BINARY_DIR}/src/include/ceph_ver.h) + +if(HAS_VTA) + set_source_files_properties(ceph_dencoder.cc + PROPERTIES COMPILE_FLAGS -fno-var-tracking-assignments) +endif() + +set(dencoder_srcs + ceph_dencoder.cc + $) +if(WITH_RADOSGW) + list(APPEND dencoder_srcs + ${CMAKE_SOURCE_DIR}/src/rgw/rgw_dencoder.cc) +endif() + +add_executable(ceph-dencoder ${dencoder_srcs}) + +if(WITH_RADOSGW) + list(APPEND DENCODER_EXTRALIBS + rgw_a + cls_rgw_client) +endif() + +if(WITH_RBD) + list(APPEND DENCODER_EXTRALIBS + cls_rbd_client + rbd_mirror_types + rbd_types + rbd_replay_types) + if(WITH_KRBD) + list(APPEND DENCODER_EXTRALIBS + krbd) + endif() +endif() + +target_link_libraries(ceph-dencoder + global + os + osd + mds + mon + journal + ${DENCODER_EXTRALIBS} + cls_lock_client + cls_refcount_client + cls_log_client + cls_statelog_client + cls_version_client + cls_user_client + cls_journal_client + cls_timeindex_client + ${EXTRALIBS} + ${CMAKE_DL_LIBS}) +install(TARGETS ceph-dencoder DESTINATION bin) diff --git a/src/tools/ceph_dencoder.cc b/src/tools/ceph-dencoder/ceph_dencoder.cc similarity index 100% rename from src/tools/ceph_dencoder.cc rename to src/tools/ceph-dencoder/ceph_dencoder.cc diff --git a/src/test/encoding/test_ceph_time.h b/src/tools/ceph-dencoder/ceph_time.h similarity index 100% rename from src/test/encoding/test_ceph_time.h rename to src/tools/ceph-dencoder/ceph_time.h diff --git a/src/test/encoding/test_sstring.h b/src/tools/ceph-dencoder/sstring.h similarity index 100% rename from src/test/encoding/test_sstring.h rename to src/tools/ceph-dencoder/sstring.h diff --git a/src/test/encoding/types.h b/src/tools/ceph-dencoder/types.h similarity index 99% rename from src/test/encoding/types.h rename to src/tools/ceph-dencoder/types.h index 01c0e5dc623..5bd6e70bcf0 100644 --- a/src/test/encoding/types.h +++ b/src/tools/ceph-dencoder/types.h @@ -1,9 +1,9 @@ -#include "test_ceph_time.h" +#include "ceph_time.h" TYPE(real_time_wrapper) TYPE(coarse_real_time_wrapper) TYPE(timespan_wrapper) -#include "test_sstring.h" +#include "sstring.h" TYPE(sstring_wrapper) #include "include/CompatSet.h" From 0855ce0bde2592cf6b10bd37e58cf811937d7106 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Fri, 27 Jul 2018 23:41:46 +0800 Subject: [PATCH 2/2] tools/ceph-dencoder: include types.h with full path it's a regression introduced by d9ab25329e2b564f71359bcb07d032516df112a2 Signed-off-by: Kefu Chai --- src/tools/ceph-dencoder/ceph_dencoder.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/ceph-dencoder/ceph_dencoder.cc b/src/tools/ceph-dencoder/ceph_dencoder.cc index 74f3ca34f68..f8b8fe39994 100644 --- a/src/tools/ceph-dencoder/ceph_dencoder.cc +++ b/src/tools/ceph-dencoder/ceph_dencoder.cc @@ -33,7 +33,7 @@ #define TYPE_FEATUREFUL_NOCOPY(t) #define TYPE_NOCOPY(t) #define MESSAGE(t) -#include "include/types.h" +#include "tools/ceph-dencoder/types.h" #undef TYPE #undef TYPE_STRAYDATA #undef TYPE_NONDETERMINISTIC @@ -302,7 +302,7 @@ int main(int argc, const char **argv) #define TYPE_FEATUREFUL_NOCOPY(t) dencoders[T_STRINGIFY(t)] = new DencoderImplFeaturefulNoCopy(false, false); #define TYPE_NOCOPY(t) dencoders[T_STRINGIFY(t)] = new DencoderImplNoFeatureNoCopy(false, false); #define MESSAGE(t) dencoders[T_STRINGIFY(t)] = new MessageDencoderImpl; -#include "include/types.h" +#include "tools/ceph-dencoder/types.h" #undef TYPE #undef TYPE_STRAYDATA #undef TYPE_NONDETERMINISTIC