]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cached_extent: add get_crc32 helper
authorSamuel Just <sjust@redhat.com>
Fri, 29 May 2020 21:18:29 +0000 (14:18 -0700)
committerSamuel Just <sjust@redhat.com>
Tue, 2 Jun 2020 23:56:41 +0000 (16:56 -0700)
Signed-off-by: Samuel Just <sjust@redhat.com>
src/crimson/os/seastore/cached_extent.h

index a2038ca691b7a6b4f129588f8b0dec64639f1351..93560c549ec34d67523c1fd1fbaca6d3129e1e57 100644 (file)
@@ -196,6 +196,14 @@ public:
     return version;
   }
 
+  /// Returns crc32c of buffer
+  uint32_t get_crc32c(uint32_t crc) {
+    return ceph_crc32c(
+      crc,
+      reinterpret_cast<const unsigned char *>(get_bptr().c_str()),
+      get_length());
+  }
+
   /// Get ref to raw buffer
   bufferptr &get_bptr() { return ptr; }
   const bufferptr &get_bptr() const { return ptr; }