Rmvoe unused function buf_is_zero, if someone misses it, a faster one is
available in include/inline_memory.h.
Signed-off-by: Piotr Dałek <piotr.dalek@ts.fujitsu.com>
#include <sys/mount.h>
#endif
-// test if an entire buf is zero in 8-byte chunks
-bool buf_is_zero(const char *buf, size_t len)
-{
- size_t ofs;
- int chunk = sizeof(uint64_t);
-
- for (ofs = 0; ofs < len; ofs += sizeof(uint64_t)) {
- if (*(uint64_t *)(buf + ofs) != 0) {
- return false;
- }
- }
- for (ofs = (len / chunk) * chunk; ofs < len; ofs++) {
- if (buf[ofs] != '\0') {
- return false;
- }
- }
- return true;
-}
-
-
int64_t unit_to_bytesize(string val, ostream *pss)
{
if (val.empty()) {
#ifndef CEPH_UTIL_H
#define CEPH_UTIL_H
-// is buf~len completely zero (in 8-byte chunks)
-
#include "common/Formatter.h"
#include "include/types.h"
-bool buf_is_zero(const char *buf, size_t len);
-
int64_t unit_to_bytesize(string val, ostream *pss);
struct ceph_data_stats