]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/tar: rename BLOCK_SIZE to TAR_BLOCK_SIZE
authorCasey Bodley <cbodley@redhat.com>
Thu, 23 Mar 2023 02:02:50 +0000 (22:02 -0400)
committerMark Kogan <mkogan@redhat.com>
Tue, 4 Aug 2026 07:20:07 +0000 (07:20 +0000)
there's a conflicting BLOCK_SIZE macro defined inside the liburing headers

Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 87c44fb323c12d2e53cc0a9eaa9a045bf4fd8ce8)

src/rgw/rgw_tar.h

index d30a01a7a70f14717b01fd1f6d1ed0d3464a0140..65ccab5e8e2f91fb04c843fdc986da6fbca2d5f1 100644 (file)
@@ -16,7 +16,7 @@
 namespace rgw {
 namespace tar {
 
-static constexpr size_t BLOCK_SIZE = 512;
+static constexpr size_t TAR_BLOCK_SIZE = 512;
 
 
 static inline std::pair<class StatusIndicator,
@@ -82,8 +82,8 @@ protected:
     char __padding[355];
   } *header;
 
-  static_assert(sizeof(*header) == BLOCK_SIZE,
-                "The TAR header must be exactly BLOCK_SIZE length");
+  static_assert(sizeof(*header) == TAR_BLOCK_SIZE,
+                "The TAR header must be exactly TAR_BLOCK_SIZE length");
 
   /* The label is far more important from what the code really does. */
   static size_t pos2len(const size_t pos) {
@@ -91,7 +91,7 @@ protected:
   }
 
 public:
-  explicit HeaderView(const char (&header)[BLOCK_SIZE])
+  explicit HeaderView(const char (&header)[TAR_BLOCK_SIZE])
     : header(reinterpret_cast<const header_t*>(header)) {
   }
 
@@ -138,11 +138,11 @@ public:
 static inline std::pair<StatusIndicator,
                         boost::optional<HeaderView>>
 interpret_block(const StatusIndicator& status, ceph::bufferlist& bl) {
-  static constexpr std::array<char, BLOCK_SIZE> zero_block = {0, };
-  const char (&block)[BLOCK_SIZE] = \
-    reinterpret_cast<const char (&)[BLOCK_SIZE]>(*bl.c_str());
+  static constexpr std::array<char, TAR_BLOCK_SIZE> zero_block = {0, };
+  const char (&block)[TAR_BLOCK_SIZE] = \
+    reinterpret_cast<const char (&)[TAR_BLOCK_SIZE]>(*bl.c_str());
 
-  if (std::memcmp(zero_block.data(), block, BLOCK_SIZE) == 0) {
+  if (std::memcmp(zero_block.data(), block, TAR_BLOCK_SIZE) == 0) {
     return std::make_pair(StatusIndicator(status, true), boost::none);
   } else {
     return std::make_pair(StatusIndicator(status, false), HeaderView(block));