lib/util: remove _spdk prefix from functions.
Signed-off-by: Seth Howell <seth.howell@intel.com> Change-Id: Id87b6eae46e7503796904676edfa22d821673a9a Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2462 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
parent
0af754f0f7
commit
57c2b0c5a3
@ -93,7 +93,7 @@ base64_urlsafe_dec_table[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static int
|
static int
|
||||||
_spdk_base64_encode(char *dst, const char *enc_table, const void *src, size_t src_len)
|
base64_encode(char *dst, const char *enc_table, const void *src, size_t src_len)
|
||||||
{
|
{
|
||||||
uint32_t raw_u32;
|
uint32_t raw_u32;
|
||||||
|
|
||||||
@ -102,7 +102,7 @@ _spdk_base64_encode(char *dst, const char *enc_table, const void *src, size_t sr
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __aarch64__
|
#ifdef __aarch64__
|
||||||
_spdk_base64_encode_neon64(&dst, enc_table, &src, &src_len);
|
base64_encode_neon64(&dst, enc_table, &src, &src_len);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
while (src_len >= 4) {
|
while (src_len >= 4) {
|
||||||
@ -139,22 +139,22 @@ out:
|
|||||||
int
|
int
|
||||||
spdk_base64_encode(char *dst, const void *src, size_t src_len)
|
spdk_base64_encode(char *dst, const void *src, size_t src_len)
|
||||||
{
|
{
|
||||||
return _spdk_base64_encode(dst, base64_enc_table, src, src_len);
|
return base64_encode(dst, base64_enc_table, src, src_len);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
spdk_base64_urlsafe_encode(char *dst, const void *src, size_t src_len)
|
spdk_base64_urlsafe_encode(char *dst, const void *src, size_t src_len)
|
||||||
{
|
{
|
||||||
return _spdk_base64_encode(dst, base64_urfsafe_enc_table, src, src_len);
|
return base64_encode(dst, base64_urfsafe_enc_table, src, src_len);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __aarch64__
|
#ifdef __aarch64__
|
||||||
static int
|
static int
|
||||||
_spdk_base64_decode(void *dst, size_t *_dst_len, const uint8_t *dec_table,
|
base64_decode(void *dst, size_t *_dst_len, const uint8_t *dec_table,
|
||||||
const uint8_t *dec_table_opt, const char *src)
|
const uint8_t *dec_table_opt, const char *src)
|
||||||
#else
|
#else
|
||||||
static int
|
static int
|
||||||
_spdk_base64_decode(void *dst, size_t *_dst_len, const uint8_t *dec_table, const char *src)
|
base64_decode(void *dst, size_t *_dst_len, const uint8_t *dec_table, const char *src)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
size_t src_strlen;
|
size_t src_strlen;
|
||||||
@ -199,7 +199,7 @@ _spdk_base64_decode(void *dst, size_t *_dst_len, const uint8_t *dec_table, const
|
|||||||
src_in = (const uint8_t *) src;
|
src_in = (const uint8_t *) src;
|
||||||
|
|
||||||
#ifdef __aarch64__
|
#ifdef __aarch64__
|
||||||
_spdk_base64_decode_neon64(&dst, dec_table_opt, &src_in, &src_strlen);
|
base64_decode_neon64(&dst, dec_table_opt, &src_in, &src_strlen);
|
||||||
|
|
||||||
if (src_strlen == 0) {
|
if (src_strlen == 0) {
|
||||||
return 0;
|
return 0;
|
||||||
@ -244,9 +244,9 @@ int
|
|||||||
spdk_base64_decode(void *dst, size_t *dst_len, const char *src)
|
spdk_base64_decode(void *dst, size_t *dst_len, const char *src)
|
||||||
{
|
{
|
||||||
#ifdef __aarch64__
|
#ifdef __aarch64__
|
||||||
return _spdk_base64_decode(dst, dst_len, base64_dec_table, base64_dec_table_neon64, src);
|
return base64_decode(dst, dst_len, base64_dec_table, base64_dec_table_neon64, src);
|
||||||
#else
|
#else
|
||||||
return _spdk_base64_decode(dst, dst_len, base64_dec_table, src);
|
return base64_decode(dst, dst_len, base64_dec_table, src);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -254,9 +254,9 @@ int
|
|||||||
spdk_base64_urlsafe_decode(void *dst, size_t *dst_len, const char *src)
|
spdk_base64_urlsafe_decode(void *dst, size_t *dst_len, const char *src)
|
||||||
{
|
{
|
||||||
#ifdef __aarch64__
|
#ifdef __aarch64__
|
||||||
return _spdk_base64_decode(dst, dst_len, base64_urlsafe_dec_table, base64_urlsafe_dec_table_neon64,
|
return base64_decode(dst, dst_len, base64_urlsafe_dec_table, base64_urlsafe_dec_table_neon64,
|
||||||
src);
|
src);
|
||||||
#else
|
#else
|
||||||
return _spdk_base64_decode(dst, dst_len, base64_urlsafe_dec_table, src);
|
return base64_decode(dst, dst_len, base64_urlsafe_dec_table, src);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -116,7 +116,7 @@ load_64byte_table(const uint8_t *p)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_spdk_base64_encode_neon64(char **dst, const char *enc_table, const void **src, size_t *src_len)
|
base64_encode_neon64(char **dst, const char *enc_table, const void **src, size_t *src_len)
|
||||||
{
|
{
|
||||||
const uint8x16x4_t tbl_enc = load_64byte_table(enc_table);
|
const uint8x16x4_t tbl_enc = load_64byte_table(enc_table);
|
||||||
|
|
||||||
@ -155,8 +155,8 @@ _spdk_base64_encode_neon64(char **dst, const char *enc_table, const void **src,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_spdk_base64_decode_neon64(void **dst, const uint8_t *dec_table_neon64, const uint8_t **src,
|
base64_decode_neon64(void **dst, const uint8_t *dec_table_neon64, const uint8_t **src,
|
||||||
size_t *src_len)
|
size_t *src_len)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* First LUT tbl_dec1 will use VTBL instruction (out of range indices are set to 0 in destination).
|
* First LUT tbl_dec1 will use VTBL instruction (out of range indices are set to 0 in destination).
|
||||||
|
@ -161,8 +161,8 @@ spdk_bit_array_capacity(const struct spdk_bit_array *ba)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static inline int
|
static inline int
|
||||||
_spdk_bit_array_get_word(const struct spdk_bit_array *ba, uint32_t bit_index,
|
bit_array_get_word(const struct spdk_bit_array *ba, uint32_t bit_index,
|
||||||
uint32_t *word_index, uint32_t *word_bit_index)
|
uint32_t *word_index, uint32_t *word_bit_index)
|
||||||
{
|
{
|
||||||
if (spdk_unlikely(bit_index >= ba->bit_count)) {
|
if (spdk_unlikely(bit_index >= ba->bit_count)) {
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
@ -179,7 +179,7 @@ spdk_bit_array_get(const struct spdk_bit_array *ba, uint32_t bit_index)
|
|||||||
{
|
{
|
||||||
uint32_t word_index, word_bit_index;
|
uint32_t word_index, word_bit_index;
|
||||||
|
|
||||||
if (_spdk_bit_array_get_word(ba, bit_index, &word_index, &word_bit_index)) {
|
if (bit_array_get_word(ba, bit_index, &word_index, &word_bit_index)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -191,7 +191,7 @@ spdk_bit_array_set(struct spdk_bit_array *ba, uint32_t bit_index)
|
|||||||
{
|
{
|
||||||
uint32_t word_index, word_bit_index;
|
uint32_t word_index, word_bit_index;
|
||||||
|
|
||||||
if (_spdk_bit_array_get_word(ba, bit_index, &word_index, &word_bit_index)) {
|
if (bit_array_get_word(ba, bit_index, &word_index, &word_bit_index)) {
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -204,7 +204,7 @@ spdk_bit_array_clear(struct spdk_bit_array *ba, uint32_t bit_index)
|
|||||||
{
|
{
|
||||||
uint32_t word_index, word_bit_index;
|
uint32_t word_index, word_bit_index;
|
||||||
|
|
||||||
if (_spdk_bit_array_get_word(ba, bit_index, &word_index, &word_bit_index)) {
|
if (bit_array_get_word(ba, bit_index, &word_index, &word_bit_index)) {
|
||||||
/*
|
/*
|
||||||
* Clearing past the end of the bit array is a no-op, since bit past the end
|
* Clearing past the end of the bit array is a no-op, since bit past the end
|
||||||
* are implicitly 0.
|
* are implicitly 0.
|
||||||
@ -216,8 +216,8 @@ spdk_bit_array_clear(struct spdk_bit_array *ba, uint32_t bit_index)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static inline uint32_t
|
static inline uint32_t
|
||||||
_spdk_bit_array_find_first(const struct spdk_bit_array *ba, uint32_t start_bit_index,
|
bit_array_find_first(const struct spdk_bit_array *ba, uint32_t start_bit_index,
|
||||||
spdk_bit_array_word xor_mask)
|
spdk_bit_array_word xor_mask)
|
||||||
{
|
{
|
||||||
uint32_t word_index, first_word_bit_index;
|
uint32_t word_index, first_word_bit_index;
|
||||||
spdk_bit_array_word word, first_word_mask;
|
spdk_bit_array_word word, first_word_mask;
|
||||||
@ -257,7 +257,7 @@ spdk_bit_array_find_first_set(const struct spdk_bit_array *ba, uint32_t start_bi
|
|||||||
{
|
{
|
||||||
uint32_t bit_index;
|
uint32_t bit_index;
|
||||||
|
|
||||||
bit_index = _spdk_bit_array_find_first(ba, start_bit_index, 0);
|
bit_index = bit_array_find_first(ba, start_bit_index, 0);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If we ran off the end of the array and found the 1 bit in the extra word,
|
* If we ran off the end of the array and found the 1 bit in the extra word,
|
||||||
@ -275,7 +275,7 @@ spdk_bit_array_find_first_clear(const struct spdk_bit_array *ba, uint32_t start_
|
|||||||
{
|
{
|
||||||
uint32_t bit_index;
|
uint32_t bit_index;
|
||||||
|
|
||||||
bit_index = _spdk_bit_array_find_first(ba, start_bit_index, SPDK_BIT_ARRAY_WORD_C(-1));
|
bit_index = bit_array_find_first(ba, start_bit_index, SPDK_BIT_ARRAY_WORD_C(-1));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If we ran off the end of the array and found the 0 bit in the extra word,
|
* If we ran off the end of the array and found the 0 bit in the extra word,
|
||||||
|
Loading…
Reference in New Issue
Block a user