]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
build: split ceph_ver.h
authorAdam Kupczyk <akupczyk@ibm.com>
Mon, 24 Jun 2024 08:22:46 +0000 (08:22 +0000)
committerAdam Kupczyk <akupczyk@ibm.com>
Wed, 17 Jul 2024 14:29:22 +0000 (14:29 +0000)
Split ceph_ver.h into:
1) ceph_ver.h containing git-related macros
2) ceph_release.h containing just human written ceph version number /
   ceph version name.

The benefit is that denc.h which needs to know CEPH_RELEASE value
can skip including git-related macros. There are many compilation units
that use denc.h and only few that need git-related macros.
Reduces amount of files to recompile after SHA1 changes.
It is only relevant for developer environment.

Signed-off-by: Adam Kupczyk <akupczyk@ibm.com>
(cherry picked from commit 1a56293f2c890d9222fab5e1e91c34e2d864aef9)

src/CMakeLists.txt
src/ceph_release.h.in.cmake [new file with mode: 0644]
src/ceph_ver.h.in.cmake
src/include/denc.h

index 90c9c48e06e125a7e802fed5a8aafe1bd87930bb..da3102f9e5a295491362c863a5c495b5b5345bae 100644 (file)
@@ -70,6 +70,10 @@ configure_file(
   ${CMAKE_SOURCE_DIR}/src/ceph_ver.h.in.cmake
   ${CMAKE_BINARY_DIR}/src/include/ceph_ver.h
   @ONLY)
+configure_file(
+  ${CMAKE_SOURCE_DIR}/src/ceph_release.h.in.cmake
+  ${CMAKE_BINARY_DIR}/src/include/ceph_release.h
+  @ONLY)
 
 add_definitions(
   -DHAVE_CONFIG_H
diff --git a/src/ceph_release.h.in.cmake b/src/ceph_release.h.in.cmake
new file mode 100644 (file)
index 0000000..f622fc5
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef CEPH_RELEASE_H
+#define CEPH_RELEASE_H
+
+#define CEPH_RELEASE @CEPH_RELEASE@
+#define CEPH_RELEASE_NAME "@CEPH_RELEASE_NAME@"
+#define CEPH_RELEASE_TYPE "@CEPH_RELEASE_TYPE@"
+
+#endif
index d7e1c8e9bddff8ebc129820375f759dc5b74dd15..028a1c527b444a9fd7c4f0294c118a4399bb7abb 100644 (file)
@@ -3,8 +3,7 @@
 
 #define CEPH_GIT_VER @CEPH_GIT_VER@
 #define CEPH_GIT_NICE_VER "@CEPH_GIT_NICE_VER@"
-#define CEPH_RELEASE @CEPH_RELEASE@
-#define CEPH_RELEASE_NAME "@CEPH_RELEASE_NAME@"
-#define CEPH_RELEASE_TYPE "@CEPH_RELEASE_TYPE@"
+
+#include "ceph_release.h"
 
 #endif
index 1ebc395e70ee46946bdebdd7409a1a0a90cb4a2b..00a2901656557de0efdf40cb324de1c80b7d582b 100644 (file)
@@ -51,7 +51,7 @@
 
 #include "common/convenience.h"
 #include "common/error_code.h"
-#include "ceph_ver.h"
+#include "ceph_release.h"
 
 template<typename T, typename=void>
 struct denc_traits {
@@ -1849,13 +1849,14 @@ inline std::enable_if_t<traits::supported && !traits::featured> decode_nohead(
 // DENC_START interface suggests it is checking compatibility,
 // but the feature was unimplemented until SQUID.
 // Due to -2 compatibility rule we cannot bump up compat until U____ release.
+// SQUID=19 T____=20 U____=21
 
 #define DENC_START(v, compat, p)                                       \
   __u8 struct_v = v;                                                   \
   __u8 struct_compat = compat;                                         \
   char *_denc_pchar;                                                   \
   uint32_t _denc_u32;                                                  \
-  static_assert(CEPH_RELEASE >= 21 || compat == 1);                    \
+  static_assert(CEPH_RELEASE >= (19/*squid*/ + 2) || compat == 1);     \
   _denc_start(p, &struct_v, &struct_compat, &_denc_pchar, &_denc_u32); \
   do {
 
@@ -1865,7 +1866,7 @@ inline std::enable_if_t<traits::supported && !traits::featured> decode_nohead(
   __u8 struct_compat = compat;                                         \
   char *_denc_pchar;                                                   \
   uint32_t _denc_u32;                                                  \
-  static_assert(CEPH_RELEASE >= 21 || compat == 2);                    \
+  static_assert(CEPH_RELEASE >= (19/*squid*/ + 2) || compat == 2);     \
   _denc_start(p, &struct_v, &struct_compat, &_denc_pchar, &_denc_u32); \
   do {