dedup

data deduplication program
git clone git://git.2f30.org/dedup.git
Log | Files | Refs | README | LICENSE

commit 748b1ecb66e6c66d9fd18b84e58c1fbecb88839b
parent a3b3fb6126e50d105436b50fc3c077d4e33f3959
Author: sin <sin@2f30.org>
Date:   Thu, 18 Apr 2019 09:31:02 +0100

Make match_ver() private

Diffstat:
Mdedup.h | 1-
Mutils.c | 26+++++++++++++-------------
2 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/dedup.h b/dedup.h @@ -208,6 +208,5 @@ ssize_t xread(int fd, void *buf, size_t nbytes); ssize_t xwrite(int fd, const void *buf, size_t nbytes); void init_blk_hdr(struct blk_hdr *hdr, int compr_algo, int hash_algo); void init_snap_hdr(struct snap_hdr *hdr); -void match_ver(uint64_t v); void load_blk_hdr(int fd, struct blk_hdr *hdr, int *compr_algo, int *hash_algo); void load_snap_hdr(int fd, struct snap_hdr *hdr); diff --git a/utils.c b/utils.c @@ -9,6 +9,19 @@ #include "blake2.h" #include "dedup.h" +static void +match_ver(uint64_t v) +{ + uint8_t maj, min; + + min = v & VER_MIN_MASK; + maj = (v >> VER_MAJ_SHIFT) & VER_MAJ_MASK; + if (maj == VER_MAJ && min == VER_MIN) + return; + errx(1, "format version mismatch: expected %u.%u but got %u.%u", + VER_MAJ, VER_MIN, maj, min); +} + void str2bin(char *s, uint8_t *d) { @@ -87,19 +100,6 @@ init_snap_hdr(struct snap_hdr *hdr) } void -match_ver(uint64_t v) -{ - uint8_t maj, min; - - min = v & VER_MIN_MASK; - maj = (v >> VER_MAJ_SHIFT) & VER_MAJ_MASK; - if (maj == VER_MAJ && min == VER_MIN) - return; - errx(1, "format version mismatch: expected %u.%u but got %u.%u", - VER_MAJ, VER_MIN, maj, min); -} - -void load_blk_hdr(int fd, struct blk_hdr *hdr, int *compr_algo, int *hash_algo) { uint64_t v;