XRootD
XrdOssCsiCrcUtils Class Reference

#include <XrdOssCsiCrcUtils.hh>

+ Collaboration diagram for XrdOssCsiCrcUtils:

Static Public Member Functions

static uint32_t crc32c_combine (uint32_t crc1, uint32_t crc2, size_t len2)
 
static uint32_t crc32c_extendwith_zero (uint32_t crc, size_t len)
 
static uint32_t crc32c_split1 (uint32_t crctot, uint32_t crc2, size_t len2)
 
static uint32_t crc32c_split2 (uint32_t crctot, uint32_t crc1, size_t len2)
 

Detailed Description

Definition at line 38 of file XrdOssCsiCrcUtils.hh.

Member Function Documentation

◆ crc32c_combine()

static uint32_t XrdOssCsiCrcUtils::crc32c_combine ( uint32_t  crc1,
uint32_t  crc2,
size_t  len2 
)
inlinestatic

Definition at line 49 of file XrdOssCsiCrcUtils.hh.

50  {
51  if (len2==0)
52  return crc1;
53 
54  assert(len2<=XrdSys::PageSize);
55 
56  const uint32_t c1 = XrdOucCRC::Calc32C(g_bz, len2, ~crc1);
57  return ~c1^crc2;
58  }
static uint32_t Calc32C(const void *data, size_t count, uint32_t prevcs=0)
Definition: XrdOucCRC.cc:190
static const int PageSize

References XrdOucCRC::Calc32C(), and XrdSys::PageSize.

Referenced by XrdOssCsiPages::StoreRangeUnaligned_postblock(), and XrdOssCsiPages::StoreRangeUnaligned_preblock().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ crc32c_extendwith_zero()

static uint32_t XrdOssCsiCrcUtils::crc32c_extendwith_zero ( uint32_t  crc,
size_t  len 
)
inlinestatic

Definition at line 107 of file XrdOssCsiCrcUtils.hh.

108  {
109  if (len==0)
110  return crc;
111 
112  assert(len<=XrdSys::PageSize);
113  return XrdOucCRC::Calc32C(g_bz, len, crc);
114  }

References XrdOucCRC::Calc32C(), and XrdSys::PageSize.

Referenced by XrdOssCsiPages::StoreRangeUnaligned_preblock(), and XrdOssCsiPages::UpdateRangeHoleUntilPage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ crc32c_split1()

static uint32_t XrdOssCsiCrcUtils::crc32c_split1 ( uint32_t  crctot,
uint32_t  crc2,
size_t  len2 
)
inlinestatic

Definition at line 69 of file XrdOssCsiCrcUtils.hh.

70  {
71  if (len2==0)
72  return crctot;
73 
74  assert(len2<=XrdSys::PageSize);
75  uint32_t crc = (crctot ^ crc2);
76  for(size_t i=0;i<8*len2;i++) {
77  crc = (crc<<1)^((crc&0x80000000) ? (CrcPoly << 1 | 0x1) : 0);
78  }
79  return crc;
80  }

References XrdSys::PageSize.

Referenced by XrdOssCsiPages::FetchRangeUnaligned_postblock(), and XrdOssCsiPages::FetchRangeUnaligned_preblock().

+ Here is the caller graph for this function:

◆ crc32c_split2()

static uint32_t XrdOssCsiCrcUtils::crc32c_split2 ( uint32_t  crctot,
uint32_t  crc1,
size_t  len2 
)
inlinestatic

Definition at line 90 of file XrdOssCsiCrcUtils.hh.

91  {
92  if (len2==0)
93  return 0;
94 
95  assert(len2<=XrdSys::PageSize);
96  uint32_t c1 = XrdOucCRC::Calc32C(g_bz, len2, ~crc1);
97  return ~c1^crctot;
98  }

References XrdOucCRC::Calc32C(), and XrdSys::PageSize.

Referenced by XrdOssCsiPages::FetchRangeUnaligned_preblock().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

The documentation for this class was generated from the following files: