X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fceph%2Fsrc%2Finclude%2Fcrc32c.h;fp=src%2Fceph%2Fsrc%2Finclude%2Fcrc32c.h;h=0000000000000000000000000000000000000000;hb=7da45d65be36d36b880cc55c5036e96c24b53f00;hp=dd4ede666ec1dca7cb346615aaa955a510fb1a98;hpb=691462d09d0987b47e112d6ee8740375df3c51b2;p=stor4nfv.git diff --git a/src/ceph/src/include/crc32c.h b/src/ceph/src/include/crc32c.h deleted file mode 100644 index dd4ede6..0000000 --- a/src/ceph/src/include/crc32c.h +++ /dev/null @@ -1,57 +0,0 @@ -#ifndef CEPH_CRC32C_H -#define CEPH_CRC32C_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef uint32_t (*ceph_crc32c_func_t)(uint32_t crc, unsigned char const *data, unsigned length); - -/* - * this is a static global with the chosen crc32c implementation for - * the given architecture. - */ -extern ceph_crc32c_func_t ceph_crc32c_func; - -extern ceph_crc32c_func_t ceph_choose_crc32(void); - -/** - * calculate crc32c for data that is entirely 0 (ZERO) - * - * Note: works the same as ceph_crc32c_func for data == nullptr, - * but faster than the optimized assembly on certain architectures. - * This is faster than intel optimized assembly, but not as fast as - * ppc64le optimized assembly. - * - * @param crc initial value - * @param length length of buffer - */ -uint32_t ceph_crc32c_zeros(uint32_t crc, unsigned length); - -/** - * calculate crc32c - * - * Note: if the data pointer is NULL, we calculate a crc value as if - * it were zero-filled. - * - * @param crc initial value - * @param data pointer to data buffer - * @param length length of buffer - */ -static inline uint32_t ceph_crc32c(uint32_t crc, unsigned char const *data, unsigned length) -{ -#ifndef HAVE_POWER8 - if (!data && length > 16) - return ceph_crc32c_zeros(crc, length); -#endif /* HAVE_POWER8 */ - - return ceph_crc32c_func(crc, data, length); -} - -#ifdef __cplusplus -} -#endif - -#endif