]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
include: move ALLPERMS definition to compat.h 50989/head
authorLucian Petrut <lpetrut@cloudbasesolutions.com>
Thu, 30 Mar 2023 12:14:10 +0000 (12:14 +0000)
committerXiubo Li <xiubli@redhat.com>
Tue, 11 Apr 2023 02:46:21 +0000 (10:46 +0800)
The Windows CI job started to fail as some libcephfs tests that use
ALLPERMS have been moved [1] to a separate file which doesn't have
the ALLPERMS definition.

  /ceph/src/test/libcephfs/suidsgid.cc:240:36: error: ‘ALLPERMS’ was
  not declared in this scope
  240 |   ASSERT_EQ(stx.stx_mode & (mode_t)ALLPERMS, before_mode);

We'll move this definition to compat.h so that we won't have to
redefine it in each file that uses it.

Note that we're moving the Windows "fs_compat.h" include up,
ensuring that the constants used by ALLPERMS are defined.

[1] https://github.com/ceph/ceph/commit/254eeb2730881ee48b4743e1422749d5b643f52a

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
(cherry picked from commit a2966c08171e006acfd9c32b00a1294f428c7e62)

src/include/compat.h
src/test/libcephfs/test.cc
src/test/libcephfs/vxattr.cc

index 4881e01ff98f7abd8f1586b961d29ed0db14660f..915bd9ac73a74d5b75590fdf85c71fa6a2462373 100644 (file)
 #endif 
 
 #include <sys/stat.h>
+
+#ifdef _WIN32
+#include "include/win32/fs_compat.h"
+#endif
+
 #ifndef ACCESSPERMS
 #define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO)
 #endif
 
+#ifndef ALLPERMS
+#define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO)
+#endif
+
 #if defined(__FreeBSD__)
 
 // FreeBSD supports Linux procfs with its compatibility module
@@ -232,7 +241,6 @@ int ceph_memzero_s(void *dest, size_t destsz, size_t count);
 #include <time.h>
 
 #include "include/win32/win32_errno.h"
-#include "include/win32/fs_compat.h"
 
 // There are a few name collisions between Windows headers and Ceph.
 // Updating Ceph definitions would be the prefferable fix in order to avoid
index 8035d2ab44d6b64b298fd9f06cc5ef8fca2c2928..253442a88447eb4f2ac6d54dfe21a0f0b643b0dc 100644 (file)
 #include <thread>
 #include <regex>
 
-#ifndef ALLPERMS
-#define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO)
-#endif
-
 using namespace std;
 
 TEST(LibCephFS, OpenEmptyComponent) {
index 2a5ad70e4a0263923b79de8496d62b4891eabc29..4a67c55d51a1e589d53320412f528188eb0f4848 100644 (file)
 #include <regex>
 #include <string>
 
-#ifndef ALLPERMS
-#define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO)
-#endif
-
 using namespace std;
 
 TEST(LibCephFS, LayoutVerifyDefaultLayout) {