src/fssum: Use htobe64() instead of a custom macro

Remove unnecessary htonll() macro definition.

Macros and functions starting with two underscores are usually
internal and shouldn't be used by applications when a version
without "__" is available.

Signed-off-by: Rostislav Skudnov <rostislav@tuxera.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <eguan@redhat.com>
This commit is contained in:
Rostislav Skudnov
2018-01-23 08:08:18 +00:00
committed by Eryu Guan
parent 57b7c3bac4
commit 53b8b92652
+2 -7
View File
@@ -40,6 +40,7 @@
#include <netinet/in.h>
#include <inttypes.h>
#include <assert.h>
#include <endian.h>
#define CS_SIZE 16
#define CHUNKS 128
@@ -49,12 +50,6 @@
#define SEEK_DATA 3
#define SEEK_HOLE 4
#endif
#if __BYTE_ORDER == __LITTLE_ENDIAN
#define htonll(x) __bswap_64 (x)
#else
#define htonll(x) (x)
#endif
#endif
/* TODO: add hardlink recognition */
@@ -216,7 +211,7 @@ sum_add_sum(sum_t *dst, sum_t *src)
void
sum_add_u64(sum_t *dst, uint64_t val)
{
uint64_t v = htonll(val);
uint64_t v = htobe64(val);
sum_add(dst, &v, sizeof(v));
}